From the openrave web site, "OpenRAVE? provides an environment for testing, developing, and deploying motion planning algorithms in real-world robotics applications." For linuxcnc, we are using the ikfast module to create the IK component, and the qtcoin display application to show the robot model.
The modified version adds a c code generator that works with linuxcnc. Use the --outputlang=c to create the c code.
The ikfast updates to linuxcnc can be found here, https://github.com/ftkalcevic/LinuxCNC, in the "ikfast" branch. There is a new src/emc/kinematics/ikfastkins.c module that uses the ikfast generated code. There is also some example configurations in configs/ikfast-demo directory.
Simple robot defined using openrave xml
same simple robot, but defined using collada file
The robot model is used in all openrave computations, including the generation of the ikfast source. Therefore it is important that it is created accurately.
The creator of openrave recommends opening an interactive openrave session and continually reloading the model...
$> openrave.py -i In [1]: env.Reset(); env.Load('simple.robot.detailed.xml')
The recommended way of generating the ik code is to use the openrave.py program, but advanced users can use ikfast.py directly. It is best to generate the cpp component first and use that for automatic testing. Automatic testing doesn't work with .c output.
For example, to generate the 3d translation ik...
$> openrave.py --database inversekinematics --robot=../simple.robot.xml --iktype=Translation 3D --freejoint=Wrist --freejoint=WristR --numiktests=1000 getIndicesFromJointNames [3, 4] ['Wrist', 'WristR'] openravepy.databases.inversekinematics: generate, Generating inverse kinematics for manip arm: Translation3D [0, 1, 2] (this might take up to 10 min) openravepy.databases.inversekinematics: generate, creating ik file /home/frankt/ .openrave/kinematics.587828202130adcfd9bfdcd543fb17e2/ikfast62.Translation3D.0_1 _2_f3_4.cpp ... Lots more output .... openravepy.databases.inversekinematics: save, inversekinematics generation is do ne, compiled shared object: /home/frankt/.openrave/kinematics.587828202130adcfd9 bfdcd543fb17e2/ikfast62.Translation3D.i686.0_1_2_f3_4.so openravepy.databases.inversekinematics: RunFromParser, testing the success rate of robot ../simple.robot.xml [ikfastmodule.cpp:946] FindIKSolution: No ik solution found, i = 0 Joint Val: 0 0 0 0 0 Transform: 855638019 0 0 0.4799 raw ik command: 0 0 0 0 0 0 0 0 0 0 0 0.4799 0.2606354555368424 0.40057338399291 04 [ikfastmodule.cpp:1001] FindIKSolutions: No ik solution found for, i = 0 Joint Val: 0 0 0 0 0 Transform: 855638019 0 0 0.4799 openravepy.databases.inversekinematics: testik, success rate: 0.999000, wrong so lutions: 0.000000, no solutions: 0.001000, missing solution: 0.000000
Specifying --numiktests runs a series of tests with the ik module to confirm it works correctly. I suspect the output shown above is a bug, as the first test coordinate looks dodgey. This is important because may ik solutions don't provide a very high success rate.
$> openrave.py --database inversekinematics --robot=../simple.robot.xml --iktype=Translation3D --freejoint=Wrist --freejoint=WristR? --outputlang=c
Barret Wam 7DoF? robot