IK-Geo

July 11, 2024 · View on GitHub

This implementation of the core IK-Geo algorithms was adapted from IK-Geo. For details on the algorithms used, refer to the original source or to the paper "IK-Geo: Unified Robot Inverse Kinematics Using Subproblem Decomposition".

To install

This can be installed from pypi with:

pip install ik_geo

To install the package from this repository locally, use:

pip install .

To Use

Refer to examples/sample.py for a full code example. To compute the IK solutions for a specific robot, you can either select one of the hardcoded robots available or provide your own kinematics. If you provide your own kinematics, you must do so as a Product of Exponentials (POE). This is either with 6 or 7 h vectors (rotation axes) and 7 or 8 p vectors (displacements), respectively. Note that 7-joint bots are not yet supported, so the user must choose one joint to fix to give 6 h vectors and 7 p vectors

Once you have your kinematics, you need to choose the correct decomposition strategy from: { "spherical_two_parallel", "spherical_two_intersecting", "spherical", "three_parallel_two_intersecting", "three_parallel", "two_parallel", "two_intersecting", "gen_six_dof" } to use. If you choose the wrong one, you will get wrong answers.

Once you have configured your IK solver, you can get a list of IK solutions by calling the desired ik function:

from ik_geo import Robot

h # 6x3 array
p # 7x3 array

robot = Robot.spherical_two_intersecting(h,p)

R = [[0, 0, 1], [0, 1, 0], [-1, 0, 0]]
t = [-1, 3, 0]

# For all possible solutions, as well as whether or not they are least squares
solutions = robot.get_ik(R, t)

# For all possible IK solutions sorted by error
solutions = robot.get_ik_sorted(R, t)

Performance

While this implementation can be used on a wide range of manipulators, it performs much better on when the solution can be found entirely analytically. The following table shows which method is used for each type of kinematics:

Solution TypeRobot Kinematic FamilyExample
Closed-formSpherical jointFranka Production 3, fixed q5q_5
     and two intersecting axesKUKA LBR iiwa 7 R800 , fixed q3q_3
     and two parallel axesABB IRB 6640
Three parallel axesN/A
     and two intersecting axesUniversal Robots UR5
     and two parallel axesN/A
1D searchTwo intersecting axesKassow Robots KR810, fixed q7q_7
     and two intersecting axesFANUC CRX-10iA/L
     and two parallel axesKawasaki KJ125
Two parallel axesN/A
     and two parallel axesN/A
Two intersecting axes k,k+2k, k+2ABB YuMi, fixed q3q_3
     and two intersecting axesRRC K-1207i, fixed q6q_6
     and two parallel axesN/A
2D searchGeneral 6RKassow Robots KR810, fixed q6q_6