Ask Your Question

Generating ikfast plugin for 5 DOF robot

asked 2014-11-04 19:06:36 -0500

pascal.fortin gravatar image

updated 2014-11-05 06:31:37 -0500

Airuno2L gravatar image

Hi everyone,

we are currently working on an ERICC 1 robot (probably >30 years old) and need to update its control systems, etc. Considering that it is a 5 DOF robot, we are having a lot of difficulty with the inverse kinematics problem. It seems that KDL is able to find a solution every once in a while but it is not reliable (< 10 % of the time and not validated).

After a quick search, we found that the encouraged method for < 6 DOF robot is to use ikfast which we are currently trying to implement. We are following the tutorial.

The URDF we are using was created by us and a package containing all the meshes and the URDF can be found here: Robot_description package (sorry for the download format, I am not used to using git or anything else I hope it is not too bad)

From these files, we are able to convert the URDF to collada succesfully as explained in the tutorial using :

rosrun collada_urdf urdf_to_collada
my_robot.urdf ericc_collada.dae

then, when we visualize it using openrave, we can see the robot as in the following picture (can't upload too new on the group):

ERICC collada openrave

If we look at it quickly, we can see that it was imported properly (at least visually) but there is no reference frame at the tip of the end effector as I expected when reading a previous post about 5 DOF katana arm.

If I try to generate the solver, using :

python `openrave-config --python-dir`/openravepy/_openravepy_/ --robot=ericc_collada.dae --iktype=translationdirection5d --baselink=0 --eelink=5 --savefile=ikfast_ericc

It tries various methods and end up with this error message

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/openravepy/_openravepy_/", line 6121, in <module>
    chaintree = solver.generateIkSolver(options.baselink,options.eelink,options.freeindices,solvefn=solvefn)
  File "/usr/lib/python2.7/dist-packages/openravepy/_openravepy_/", line 1639, in generateIkSolver
    chaintree = solvefn(self, LinksRaw, jointvars, isolvejointvars)
  File "/usr/lib/python2.7/dist-packages/openravepy/_openravepy_/", line 2055, in solveFullIK_TranslationDirection5D
    endbranchtree2 += self.solveAllEquations(AllEquations,curvars=curvars,othersolvedvars = self.freejointvars+usedvars,solsubs = solsubs,endbranchtree=endbranchtree)
  File "/usr/lib/python2.7/dist-packages/openravepy/_openravepy_/", line 4264, in solveAllEquations
    return self.addSolution(solutions,AllEquations,curvars,othersolvedvars,solsubs,endbranchtree,currentcases=currentcases)
  File "/usr/lib/python2.7/dist-packages/openravepy/_openravepy_/", line 4340, in addSolution
    return [solution[0].subs(solsubs)]+self.solveAllEquations(AllEquations,curvars=newvars,othersolvedvars=othersolvedvars+[var],solsubs=solsubs+self.Variable(var).subs,endbranchtree=endbranchtree,currentcases=currentcases)
  File "/usr/lib/python2.7/dist-packages/openravepy/_openravepy_/", line 4321, in solveAllEquations
    raise self.CannotSolveError('failed to find a variable to solve')
__main__.CannotSolveError: 'failed to find a variable to solve'

Any suggestions as to how I could fix this issue ?

SETUP informations: Ubuntu 12.04 LTS 64 bits, ROS hydro, Openrave 0.8

Best regards,

Pascal Fortin

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted

answered 2014-11-12 11:33:48 -0500

gvdhoorn gravatar image

updated 2017-09-26 11:03:16 -0500

Edit (2017-09-26): I've written an updated version of this in #q263925. That also uses a Docker image to avoid having to install OpenRave on the ROS machine (which is non-trivial on current versions of Ubuntu).

For some of my 5dof manipulators, I've run into the same issue.

What worked for me was to wrap the Collada file describing your manipulator in an OpenRAVE robot definition file (that is not official terminology). This provides OpenRAVE IKFast with enough information to be able to generate a plugin for your robot. This also requires passing different parameters to be passed to the script (I used version 0.8): --database inversekinematics --robot=/path/to/collada_file_with_manipulator.xml --iktype=translationdirection5d --iktests=100

The iktests parameter value was just a default, you can make it larger or smaller.

Unfortunately I cannot find my collada_file_with_manipulator.xml right now, so I cannot provide it to you, but I used something like:

<robot file="/path/to/converted.urdf.dae">
  <Manipulator name="YOUR_NAME">

Note that you don't need to manually edit the Collada file you got by converting your urdf, you can reference it in your wrapper model definition using the file attribute.

I used the following pages for information:

edit flag offensive delete link more

answered 2018-03-17 20:34:07 -0500

hamzamerzic gravatar image

I have created a tool for online generation of ikfast solvers - meaning no need to do any manual setting up. You can find the tool here: . Feedback is highly appreciated!

edit flag offensive delete link more


First bit of feedback from me would probably be: where is the source? :)

Submitting my (potentially confidential) robot models is not something I'd be comfortable with. So being able to host an instance of your application on my own servers would immediately make this more interesting.

gvdhoorn gravatar image gvdhoorn  ( 2018-03-18 05:01:01 -0500 )edit

Yes, I am aware that this is an issue and even though I am not permanently storing user provided files, there is no way for me to prove this claim. As an intermediate step, one can use the docker image that includes (the newest) ikfast version

hamzamerzic gravatar image hamzamerzic  ( 2018-03-18 07:06:38 -0500 )edit

answered 2018-03-17 11:52:27 -0500

updated 2018-03-17 11:55:11 -0500

I've tested gvdhoorn's method and it worked!

To complement gvdhoorn's answer, here is an example xml file for Collada wrapper [1]:

<robot file="irb6600_with_linear_track_workspace.dae">
  <Manipulator name="framefab_irb6600_workspace">


edit flag offensive delete link more

answered 2020-11-19 16:30:36 -0500

As stated here:

We developed a Docker image that is slightly simpler to use (then OpenRave's one) and it also generates Python library:

To generate *.cpp files one command is enough:

docker run -v [folder_with_robot.urdf]:/output cyberbotics/pyikfast [base_link] [effector]

The command above will also generate a Python library, so you can install as:

pip3 install [folder_with_robot.urdf]

Let me know if you any suggestion how to improve the script!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-11-04 19:06:36 -0500

Seen: 2,296 times

Last updated: Nov 19 '20