myrobotlab not working as it should!!!

I am trying to making inmoov hand using leap motion with the help of myrobotlab.

But myrobotlab is not working properly as when ever i upload the python script it shows me the following errors

in myrobotlab 1.0.2693 manticore

1.Arduino>MRL bad magic number 0-9

2.inmoov right hand is not connected

even though i have checked that all the servos are attached to the right pins in arduino plus i am uploading the correct mrlcomm.ino to the arduino...it shows me in MRL that arduino is connected to UNO Com port3 as well....but when i run the script it shows me the above mentioned errors

In myrobotlab 1.0.1412

everything is fine except that it showsthe error mrlcomm35 expected 34. still it works but when i place my hand above the leap motion, for sometime it detects the motion then hangs for some time and after a few moments its slows down.

In myrobotlab 1.0.107

everthing works fine but for a few seconds, it works well and servos move according to the finger movements but after that it hangs and this working and hanging process continues till myrobotlab is closed

these are some of the problems that i am facing right now.

really need some help on this!!!!

kwatters's picture

LeapMotion and InMoov hand control

Hi Fahad,

  Welcome.  So, there are many versions of MRL out there.  Version 1.0.107 is ancient history.  (though, it was pretty stable.. even if the features were limited.)

  The latest official release is Manticore.  This is what you should be using.  If you are feeling brave you can try the latest pre-release of Nixie by clicking on the "latest" link at the top of the shoutbox.

  The myrobotlab.log file contains more debugging information.  This is a good place to start looking.  If you reproduce the error and have a log file. when you're running MRL you can send a "no worky"... That will post your log files so we can have a look.

  We would need more information to help you debug what's going on.  First, what's your setup?  windows? linux? mac?  why type of arduino?  uno ? mega? other?  Are you using a script to start the leap motion and the inmoov hand?  

  Your Arduino must be programmed with the MrlComm.ino that comes with the release of MRL that you are using.  Otherwise there could be a version mismatch.  Also,  it's normal that the first packet or two that is read from the arduino will show bad magic numbers, but after 2  or 3 of those messages, it should be fine and work correctly. 

  If you get bad magic number over and over again, and the arduino is loaded with the MrlComm properly.  I would look at your power supply for the Arduino.  It's common that if the arduino's voltage drops too low, even briefly, that it will cause bad magic numbers. 

  I suspect these are your issues.

If it's still no worky...  send a  "No Worky!"

 

Good luck!

  -Kevin

Fahad Ali's picture

thanks for the reply

thanks for the reply Kevin.

here is what i have done now.

i have reset my computer(lenovo core i3, windows 10 64bit,using java 64bit).

i downloaded and installed myrobotlab 1.0.2693 manticore and arduino 1.8.7(using arduino uno).

uploaded the mrlcomm.ino which was inside the folder of myrobotlab 1.0.2693 to the arduino.

after that i opened the myrobotlab and uploaded the following script to the python tab and execute it.

# Leap + InMoov hand version MRL above 2000 
inmoov = Runtime.createAndStart("inmoov","InMoov")
inmoov.startRightHand("COM3")
inmoov.rightHand.index.map(0,180,0,160)
inmoov.rightHand.thumb.map(0,180,55,135)
inmoov.rightHand.majeure.map(0,180,50,170)
inmoov.rightHand.ringFinger.map(0,180,48,145)
inmoov.rightHand.pinky.map(0,180,30,168)
inmoov.rightHand.wrist.map(0,180,10,170)#rollwrist
inmoov.rightHand.setVelocity(-1,-1,-1,-1,-1,-1)
sleep(1)
inmoov.rightHand.startLeapTracking()
# inmoov.rightHand.stopLeapTracking()

a single servo motor moves for the first time when i execute the script. after that nothing happens

i have checked the power supply as well.

i have sent the " no-worky" as well.

calamity's picture

Hi Fahad from your info, you

Hi Fahad

from your info, you are probably powering your servo from the arduino.

The arduino can't provide enough current for the servos. It will reset if you does, losing the connection with the computer. You even risk of damaging your arduino.

Servos must be powered from an external source

Fahad Ali's picture

@calamity @kwatters guys a

@calamity

@kwatters

guys a little help here please.

Fahad Ali's picture

Hi there,I am using a supply

Hi there, I am using a supply of 5V and 4A to power up the five servos.

kwatters's picture

The arduino is connected

Hi Fahad Ali,

  So, I looked at your no-worky.  ( here for reference : http://myrobotlab.org/myrobotlab_log/upload/Fahad%20Ali/1548580182.myrobotlab.log )

Few things.

1. it seems that you have some stale data in your  .myrobotlab directory.  (in particular some .json files that may have been from a previous/different version of MRL that you installed.)   It's important when you install a new version of MyRobotLab that it is in a new fresh/clean directory.  (These exceptions were cosmetic and are not the root issue of your problem)

2.  The Arduino did connect as can be seen from the following line in your log file  "35355 [Thread-7] INFO class org.myrobotlab.framework.Service - connected COM3 responded version 20 ... goodtimes..." So, this means you uploaded the MrlComm.ino sketch correctly and the Arduino is actually responding.

3. the arduino is sending signals to move the servos , those appear to be coming from the leap motion. Sometimes those commands are sending bogus data like move to an angle of -19 ... and other errors related to trying to move the servos to positions that are out of range.

So... at a glance, I think it seems to be working for you based on the log files. I would try by starting a much simpler test.

Don't start the leap motion stuff. Just start by starting and connecting the InMoov Hand. Then, verify that you can move the servos through the gui. You should see them move and you should see log messages like:

"291232 [inmoov.rightHand] INFO class org.myrobotlab.service.Servo - servoWrite(46)" for example to tell a particular servo to move to 46 degrees.

Of note. (And this is probably your issue.. ) I see lots of messages in your log files that look like this

291289 [inmoov.rightHand] ERROR class org.myrobotlab.framework.Service - inmoov.rightHand.thumb.moveTo(38) out of range

291289 [inmoov.rightHand] ERROR class org.myrobotlab.framework.Service  - inmoov.rightHand.pinky.moveTo(28) out of range

 

These messages ...  in particular the  "out of range" message .. says that the pinky servo has a min/max mapping that will not allow the servo to move to the angle = 38   ...  So,  I would suggest, review the input/output min/max mappings for the servos.  Set them to be 0-180 so you get the full range of movement.  

Upon further review of the code..  This indeed is exactly what is happening..  the method  "startLeapTracking" is overriding the min/max mappings for the data from the leap motion and I think this is why the servos aren't moving.

https://github.com/MyRobotLab/myrobotlab/blob/master/src/org/myrobotlab/...

 

So... I would recommend adding a couple lines to your script like the following  (after you try to start the leap motion tracking.)

# for each finger 

inmoov.rightHand.pinky.map(0, 180, 0 , 180)    

 

Good luck!

Fahad Ali's picture

thanks for the reply

thanks for the reply....really appreciate it!!

i will try and let you know whether it works or not!!

Fahad Ali's picture

all the fingers are working

all the fingers are working fine on myrobotlab 1.0.107

i have used the following script

inmoov = Runtime.createAndStart("inmoov","InMoov")
inmoov.startRightHand("COM3")
inmoov.rightHand.index.setMinMax(0,160)
inmoov.rightHand.thumb.setMinMax(55,135)
inmoov.rightHand.majeure.setMinMax(50,170)
inmoov.rightHand.ringFinger.setMinMax(48,145)
inmoov.rightHand.pinky.setMinMax(30,168)
sleep(1)
inmoov.rightHand.startLeapTracking()
# inmoov.rightHand.stopLeapTracking()
 
i want the wrist movement as well...what should i do?
i have tried to change the above script by adding a new line for wrist movemnt but it doesnot work i.e
inmoov = Runtime.createAndStart("inmoov","InMoov")
inmoov.startRightHand("COM3")
inmoov.rightHand.index.setMinMax(0,160)
inmoov.rightHand.thumb.setMinMax(55,135)
inmoov.rightHand.majeure.setMinMax(50,170)
inmoov.rightHand.ringFinger.setMinMax(48,145)
inmoov.rightHand.pinky.setMinMax(30,168)
inmoov.rightHand.wrist.setMinMax(30,168)
sleep(1)
inmoov.rightHand.startLeapTracking()
# inmoov.rightHand.stopLeapTracking()
 
any solution for the wrist movement???
 
and finally i want to make it wireless as well using myrobotlab 1.0.107..what should a do for this as well??

will really appreciate your quick response!!

kwatters's picture

To the Nixie Board!

I created an issue for the nixie project to make sure leap motion is still worky and that the example scripts are good.

 

https://github.com/MyRobotLab/myrobotlab/issues/422