Skip to content
Dianmu Zhang edited this page Nov 16, 2017 · 1 revision

IKBT: solving closed-form Inverse Kinematics with Behavior Tree

Manuscript

IKBT is a package for symbolic solution of manipulator inverse kinematic equations.
It is implemented with sympy (the python symbolic manipluation classes). The package is organized around a behavior tree encoding the higher level solution logic, and 'leaves' which implement specific solvers, manipulations, tests, and solution quality metrics. Unit tests are provided for all leaves.

We suggest you first run the Wrist since it is relatively fast:

python test_Robots_new.py Wrist

This will produce text output, and

* LaTex report output, see LaTex/HOWTO.pdf
* Python code output, see CodeGen/HOWTO.txt

The script test_Robots_new also tests itself by checkking that the output matches known correct solutions.

To solve your own problem open the file ikbtfunctions/ik_robots.py and create an entry for your robot. You should copy an entry for an existing robot and edit it's entries. Create an "unknown" for each joint variable and package them into the vector "variables". Enter the DH parameters in matrix form. Also, enter the name of your robot into the list of valid names (ikbtfunctions/ik_robots.py, line 16). The vector "vv" encodes whether each joint is rotary (1) or prismatic (0). If your robot is less than 6 DOF, create empty rows: [ 0 , 0, 0, 0 ], in the DH table so that it has six rows. Many standard symbols in robot kinematics are pre-defined for you but if you use any new ones, be sure to define them using sp.var(). See "Wrist" for an example in which the three joint variables "A, B, C" are set up for sympy by sp.var('A B C').

Pre-computed forward kinematics.

Sometimes computation of the forward kinematic equations (and their subsequent simplification) can be time consuming. When debugging an inverse kinematics solution (for example modifying the BT), it can slow the cycle if these have to be redone each time. Therefore, the software has a mechanism using Python "pickle" files, to cache the forward kinematics computation and not repeat it. Forward kinematics pickle files are stored in the directory fk_eqns/. This directory will be automatically created if you don't have it. In some cases you may have to delete the pickle file for your robot. To do that, >rm fk_eqns/NAME_pickle.p. IKBT will generally tell you when you should do this, but it is OK to just >rm -rf fk_eqns/ .

Clone this wiki locally