Here's an update on my progress with the InMoov arm Inverse Kinematics.

 

 

 

This demo shows the usage of MyRobotLab with the new AngularJS based WebGUI rendering the InMoov arm using ThreeJS in the web gui.  An XBox 360 controller was used to move the position of the InMoov hand around in the x,y,z coordinate system.  The cooresponding Servo angles are computed and published to the InMoov arm.

This is work in progress, as there's still some calibration to be done but the movements definitely seem to be generally in the expected directions.  There are some places where the IK algorithm throws a divide by zero and other bad math stuff, but with some nudging it starts working again.

 

 

GroG

8 years 2 months ago

Very Cool Kwatters !

I wanna see the 'real' Arm Too !    As a challenge you should touch something using the 2 joysticks with the real arm !

Awesome !

I was hoping to get it to sign it's name on the whiteboard, but i don't think the motor control is accurate enough..  (and without ik 6D it'll be difficult to keep the marker on the board properly..  )

I need to address some of the erratic robot arm movement behavior with the ik3d solver so the video will be easier/better...  I also want to get the servos to provide feedback and update the current postion of the DH model.   hope to do something with it either later today or maybe tomorrow before the super bowl :)

Alessandruino

8 years 2 months ago

Cool demo kevin ! wow... your servos seems very quiet ! are you using different motors/potentiometers?

Ale

juerg

8 years 2 months ago

Hi Kevin

As I got stuck because I could not get the 3d point with the InverseKinematics3D service I tried to read into the DH-Parameters and come up with my own calculations for head and left/right palm. I still would like to give a try to position neck and rothead based on the 3d coordinates.

As this looks to be working in my PC-environment I wanted to add it ito my MRL script for seeing the real action. However my script uses numpy and - despite having numpy set up on my odroid InMoov controller the MRL python window is not seeing it.

Any help? Or can I use MRL latest to get the 3d Point of palm and head?

Hi Juerg,

  I think you need/want roll,pitch, and yaw , not X,Y,Z for the head position.

The IK service can definitely return x,y,z of the hand (it does not provide orientation data for roll , pitch, yaw  (yet) )

Lets talk about roll, pitch and yaw..  The default InMoov head does not support "roll"   (unless you have the Bob Houston updated neck printed and an extra servo.)  

So that leaves us simply with pitch and yaw.  Pitch is controlled with the "neck" servo,  Yaw is controlled by the "rothead" servo. 

What you want to know is what settings for yaw and pitch will look at the 3D x,y, and z position of the InMoov hand...

So, you can get the current x,y,z position of the inmoov arm with the IK3D service... then the calculation is to translate/rotate that coordinate system to one for the inmoov head.  Once you've done that, it's should be straight forward to compute the yaw and pitch to look at that point in space...

As for numpy.. sorry. jython doesn't support numpy.

-Kevin

 

Thanks for your reply. Agree that I will need to set pitch and yaw of the head (I have only the standard head controls in place) but think I can calculate this from the 2 x,y,z positions.

For matrix multplication in jython I found a reference to a matrix toolbox but do you think I can make that available within the MRL jython script?

Is it correct then that with your previous release I wasn't able to get the y,x,z postion of the hand? There was some talk about problems with latest - should I use latest anyway?

Hi Juerg,

  There is a matrix class in java that you should be able to use from jython.  I'll check if there are other options that are jython friendly.  The palm position has been available for a while, but what I recently added was the encoder offset and calibration from the InMoov arm to the DHRobotArm model.  I think where you'll run into difficulity is that the IK3D service publishes the servo angles, so you can tell the IK3D service to move the inmoov hand to a particular x,y,z position  (assuming the arm can get there)  and it publishes the angles to the InMoovArm, however, if you move the servos on the InMoov arm, the IK3D service does not currently update the DHRobotArm links to those new angle values...

  At it's core, the DHRobotArm class does all the good stuff.  It consists of a list of DHLinks.  You can compute the position of any arbitrary robot arm (or leg) with this class by calling getPalmPosition()  

Here's an example python script that shows how to build a dh robot arm in python and to move it around in a straight line

 

[[/home/kwatters/DHParamsIK3D.py]]

juerg

8 years 2 months ago

In reply to by kwatters

Kevin, great stuff, will play around with it. It was also very interesting to create my own set of DH parameters (starting at the base of the body) and matrix-multiply my way to the palm and head.

Found also formulas that should allow to calculate roll, pitch and yaw from the matrices on the way to the palm:

http://robotics.stackexchange.com/questions/8516/getting-pitch-yaw-and-roll-from-rotation-matrix-in-dh-parameter

I will give this a try too as I am curious about the results and whether I can verify it on my Marvin.

The thing I couldn't grasp so far are the methods to find the best path to a new position, I know that a few methods exists, each with its pro and contra, but the math is a bit out of my scope :-(. And it's not the end of the line, there are mechanical restrictions, there is also another arm that could be in the way of a movement and of course I would like to avoid Marvin banging his hand into my windows or my desk.. It would be nice to enhance InMoov to be a bit more aware of its environment and add a little bit of the - for humans normal - self control.

But there are many places in the web that might help me to understand or even implement maybe some of the magic. I will keep trying. Thanks again for your time and responses.

Juerg

Hi Jeurg, 

  Thanks for the pointer to the calcuations for Roll / Pitch / Yaw.  I suspect that they should be pretty straight forward to get into the IK3D service to make it an IK6D service :)  I had plans on making it roll/pitch/yaw aware from the start, so it should be easy to extend it.  I believe that we can compute the roll/pitch/yaw from the "homogenous transform matrix" that we're currently using to compute the robot hand position.  When it comes to solving the IK for it,  I suspect that we'll start getting a lot of failed solutions because the InMoov arm isn't "fully compliant"  in that it only has 5 degrees of freedom  (not 6...  x,y,z,roll,pitch,yaw)    

  I think you have hit on a some of the most difficult tasks in robotics at the moment.  This is to make the robot aware of it's body and it's surroundings.  In addition,  it's also to choose a good path to get to the destination.  As you point out a straight line isn't always the best way to move depending on how the robot arm is configured.  

  I have only attempted to chose the straight line path to the destination points, but I suspect that there are some much fancier ways to plot the finaly path to the destination.  These include ways to minimize the amount of energy spent in getting to the destination and pre-computed waypoints.  I'm sure there are so many more, I'm just hoping that the DH stuff that I've done already can make it easier for others to get started...

Hi Kevin

found jnumeric and downloaded it. Copied jnumeric-0.1a3.jar into the MRL folder. Set CLASSPATH to point to the jnumeric-jar but get an error trying to import jnumeric in my MRL-python-script. Wasn't able to find a comprehensive description of how to make jnumeric work. Maybe you can help?

Juerg

juerg

8 years 2 months ago

Beside having no success with JNumeric so far (my best version throws an error when importing the newly compiled jar with reference to trying to overwrite __findattr__)?

I tried also the script you posted. Thought I could get the palm pos of InMoov by running this script:

ikLeft = Runtime.createAndStart("ikLeft", "InverseKinematics3D")
leftArm=Runtime.start("leftArm", "InMoovArm")
leftArm.connect("/dev/ttyACM0")
ikLeft.setCurrentArm(leftArm.getDHRobotArm())
ikLeft.addListener("publishJoinAnglesLeft", leftArm.getName(), "onJointAngles")
 
# print out the current postion of the arm.
print "omoplate: ", leftArm.omoplate.getPos()
print "shoulder: ", leftArm.shoulder.getPos()
print "rotate:   ", leftArm.rotate.getPos()
print "bicep:    ", leftArm.bicep.getPos()
# 10,30,90,5
print ikLeft.getCurrentArm().getPalmPosition()
# (x=320.000, y=80.000, z=280.000 roll=0.000 , pitch=0.000, yaw=0.000)
 
ikLeft.moveTo(300,80,250)
# this throws an error from Matrix.java.221