Generating an IKFast kinematic plugin for MoveIt - SvenzvaRobotics/svenzva_ros GitHub Wiki
In this quick writeup, we explore the steps to generate an IKFast plugin through OpenRave.
If you're an average user, probably not. The default kinematic solver that MoveIt uses (KDL) is quite good in the standard Revel configuration. If you require super fast kinematic computations or have modified your robot to have less or more than 6 DOF, generating an IKFast plugin may be desirable.
Yes! There are already some great tutorials and information here and here.
However, openrave is fairly finicky, and the environments and libraries that openrave uses on are continuously changing. The existing guides provide a snapshot of steps that worked at that time.
This guide does much the same, just forward in time. Some steps still overlap.
My system is running Ubuntu 16.04 on kernel 4.4.0-62-generic, running ROS Kinetic. Installed is openrave 8.0 according to installation instructions. My workspace contains all Svenzva code packages and their dependencies.
As a case study, I'll be generating an IKFast Plugin for a modified version of the Revel Robotic Arm with 5 joints instead of the standard 6.
- Jump to robot description file root
roscd svenzva_description/robots
- Generate robot in collada form
rosrun collada_urdf urdf_to_collada svenzva_arm.urdf svenzva_arm.dae
- Round floating point numbers in collada file. Note that if the number is too big, the equations will be too complex to solve. I've found that rounding to 3 always gives a solution (of course, at the sacrifice of precision)
rosrun moveit_ikfast round_collada_numbers.py svenzva_arm.dae svenzva_arm.rounded.dae 3
- Create an XML description file of the robot. My xml file looks like this:
<robot file="svenzva_arm.rounded.dae">
<Manipulator name="svenzva_arm">
<base>base_link</base>
<effector>link_5</effector>
</Manipulator>
</robot>
I named this file robot.xml
which we reference in the next step.
- Generate the plugin.
openrave.py --database inversekinematics --robot=<YOUR_OWN_PATH>/svenzva_description/robots/robot.xml --iktype=translationdirection5d --iktests=100
For generating a TranslationDirection5D type plugin, this process took 28.4 seconds on my machine. This is subject to vary, but if it takes more than 10 minutes, its likely in a loop and the process should be ended.
If it completes, it will tell you the output path of the .so and the results of running 100 random inverse kinematic tests. If the results are acceptable, you can now use the plugin with MoveIt!