Component:Ikfast

From OpenRAVE

Jump to: navigation, search

Contents

ikfast

Part of OpenRAVE.

Given any set of joints in any OpenRAVE robot, ikfast automatically generates closed-form 6D/3D inverse kinematics solutions for those joints given the position of the end effector of one of the robot links. It is not trivial to create hand-optimized inverse kinematics solutions for arms that can capture all degenerate cases, having closed-form IK speeds up many tasks including planning algorithms, so it really is a must for most robotics researchers. IKfast will hopefully be a useful tool for researchers throughout the world.

Closed-form solutions are necessary for motion planning due to 2 reasons:

  • Numerical inverse kinematics solvers will always be much slower than closed form solutions. Planners require being able to process thousands of configurations per second. The closed-form code generated by ikfast can produce solutions on the order of ~6 microseconds! As a comparison, most numerical solutions are on the order of 10 milliseconds (assuming good convergence).
  • The null space of the solution set can be explored because all solutions are computed.

ikfast uses sympy for the symbolic math and consists of only one python file: ikfast.py. A patched version sympy 0.6.3 is included in any installation of OpenRAVE. For the curious, the patches applied are in ikfast/sympy_0.6.3_patches.diff.

Features

  • Generate inverse kinematics for 6 joints for an end effector rotation and translation (6D).
    • At the moment, algorithm assumes that the translation and rotational components of the kinematics can be separated.
  • Generate inverse kinematics for 3 joints for an end effector rotation only (3D).
  • All possible discrete solutions calculated (usually up to 8)
  • Generated C++ code independent of OpenRAVE or any other library.
  • Automatically detects degenerate cases where 2 or more axes align and cause infinite solutions.
  • Invalid solutions are detected by checking if square roots are given negative values or arc sines and arc cosines are given inputs exceeding the [-1,1] range.
  • All divide by zero conditions are automatically checked and handled.

OpenRAVE Usage (recommended)

OpenRAVE allows ikfast to be called for any robot using the inversekinematics database generator. It will generate the C++ code, compile it, and automatically link it with openrave.

Stand-alone Usage

It is possible to run ikfast.py by itself (it is in $OPENRAVE_INSTALL/share/openrave/openravepy) without OpenRAVE.

To get help and a description of the ikfast arguments type

./ikfast.py --help

Windows users will have to install python manually and add it to the environment path.

Forward Kinematics File

ikfast can be also used as a standalone program without openrave by providing a forward kinematics file for the robot. The KinBody::WriteForwardKinematics function outputs into this format. It is also possible to do this in a command line with openrave.py:

openrave.py -p "open('fkfile.txt','w').write(env.GetBodies()[0].GetForwardKinematics()); sys.exit(0)" myrobot.robot.xml

Compiling and Using

In order to compile the generated c++ file in Linux/MacOSX do:

gcc -lstdc++ -o ik_barrettwam ik_barrettwam.cpp

This will generate a small program that outputs all solutions given the end effector with respect to the robot base.

Robots

Here are some robots with their auto-generated ik files:

Barrett WAM - 7DOF

media:ik_barrettwam.cpp

Mitsubishi PA-10 - 7DOF

media:ik_pa10.cpp

Puma Arm - 6DOF

media:ik_puma.cpp

Manus Arm - 6DOF

media:ik_manusleftarm.cpp

Man1 - 7DOF

media:ik_man1left.cpp media:ik_man1right.cpp

Authors

Rosen Diankov - PhD graduate student at the Robotics Institute at Carnegie Mellon University.

Personal tools