ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This is what I did to get OpenRAVE to generate an IKFast plugin for your urdf.

I'll assume that you've already:

  • converted the top-level .xacro to a .urdf, and
  • have converted it to Collada (using rosrun collada_urdf urdf_to_collada ..)

I decided to use the personalrobotics/ros-openrave Docker image, as installing OpenRAVE from sources on recent Ubuntu / Debian versions is not trivial, and takes quite some time (as you probably discovered).

We need to tweak the image a bit though, so:

$ mkdir /tmp/prro_work && cd /tmp/prro_work
$ cat << EOF > Dockerfile
FROM personalrobotics/ros-openrave
RUN apt-get update || true && apt-get install -y --no-install-recommends build-essential python-pip && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN pip install sympy==0.7.1
EOF

# Replace `$DOCKER_IMAGE` with some descriptive name here
$ docker build -t $DOCKER_IMAGE .

Now wait for Docker to build the new image.

Then we need a small wrapper 'robot' for OpenRAVE:

<robot file="$NAME_OF_YOUR_COLLADA_FILE">
  <Manipulator name="NAME_OF_THE_ROBOT_IN_URDF">
    <base>base_link</base>
    <effector>tool0</effector>
  </Manipulator>
</robot>

save this as wrapper.xml (you can obviously change the name if you want). OpenRAVE supports relative filenames for the file attribute of the robot element in our wrapper.xml, so it's easiest if you place wrapper.xml in the same directory that contains the .dae of your robot model.

And make sure to update base_link and tool0 to whatever you want as your base and effector links (these elements correspond to the --baselink and --eelink arguments that you pass to ikfast.py normally). In almost all cases these should correspond to whatever you have modelled as those links in your urdf.

Now generate the plugin:

$ cd /to/wherever/you/have/your/dae/and/your/wrapper
$ mkdir output

# the first volume here is the 'work dir', ie: where we have stored the wrapper and the .dae
# the second volume is where OpenRAVE stores the generated `.cpp`.
# there is no 'output file' argument to `openrave.py --database inversekinematics ..`, so
# this will have to do.
$ docker run -it --rm -v `pwd`:/ikfast -v `pwd`/output:/root/.openrave $DOCKER_IMAGE openrave0.9.py --database inversekinematics --robot=/ikfast/wrapper.xml --iktype=translationyaxisangle4d --iktests=1000

Because we installed build-essential inside the image, we can ask OpenRAVE to run some IK tests for us. OpenRAVE will automatically compile the plugin after it has generated it and run the tests. Pay attention to the final output. On my machine it is something like:

openravepy.databases.inversekinematics: testik, success rate: 1.000000, wrong solutions: 0.000000, no solutions: 0.000000, missing solution: 0.036000

If everything went well, you should now have a ikfast71.TranslationYAxisAngle4D.0_1_2_3.cpp and a ikfast.h in the output/ dir that we created earlier. You should be able to continue with the tutorial now and finish creating the MoveIt IKFast plugin.

This is what I did to get OpenRAVE to generate an IKFast plugin for your urdf.

I'll assume that you've already:

  • converted the top-level .xacro to a .urdf, and
  • have converted it to Collada (using rosrun collada_urdf urdf_to_collada ..)

I decided to use the personalrobotics/ros-openrave Docker image, as installing OpenRAVE from sources on recent Ubuntu / Debian versions is not trivial, and takes quite some time (as you probably discovered).

We need to tweak the image a bit though, so:

$ mkdir /tmp/prro_work && cd /tmp/prro_work
$ cat << EOF > Dockerfile
FROM personalrobotics/ros-openrave
RUN apt-get update || true && apt-get install -y --no-install-recommends build-essential python-pip && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN pip install sympy==0.7.1
EOF

# Replace `$DOCKER_IMAGE` with some descriptive name here
$ docker build -t $DOCKER_IMAGE .

Now wait for Docker to build the new image.

Then we need a small wrapper 'robot' for OpenRAVE:

<robot file="$NAME_OF_YOUR_COLLADA_FILE">
  <Manipulator name="NAME_OF_THE_ROBOT_IN_URDF">
    <base>base_link</base>
    <effector>tool0</effector>
  </Manipulator>
</robot>

save this as wrapper.xml (you can obviously change the name if you want). OpenRAVE supports relative filenames for the file attribute of the robot element in our wrapper.xml, so it's easiest if you place wrapper.xml in the same directory that contains the .dae of your robot model.

And make sure to update base_link and tool0 to whatever you want as your base and effector links (these elements correspond to the --baselink and --eelink arguments that you pass to ikfast.py normally). In almost all cases these should correspond to whatever you have modelled as those links in your urdf.

Now generate the plugin:

$ cd /to/wherever/you/have/your/dae/and/your/wrapper
$ mkdir output

# the first volume here is the 'work dir', ie: where we have stored the wrapper and the .dae
# the second volume is where OpenRAVE stores the generated `.cpp`.
# there is no 'output file' argument to `openrave.py --database inversekinematics ..`, so
# this will have to do.
$ docker run -it --rm -v `pwd`:/ikfast -v `pwd`/output:/root/.openrave $DOCKER_IMAGE openrave0.9.py --database inversekinematics --robot=/ikfast/wrapper.xml --iktype=translationyaxisangle4d --iktests=1000

Because we installed build-essential inside the image, we can ask OpenRAVE to run some IK tests for us. OpenRAVE will automatically compile the plugin after it has generated it and run the tests. Pay attention to the final output. On my machine it is something like:

openravepy.databases.inversekinematics: testik, success rate: 1.000000, wrong solutions: 0.000000, no solutions: 0.000000, missing solution: 0.036000

If everything went well, you should now have a ikfast71.TranslationYAxisAngle4D.0_1_2_3.cpp and a ikfast.h in the output/ dir that we created earlier. You should be able to continue with the tutorial now and finish creating the MoveIt IKFast plugin.


Documentation I used for this is basically what I referenced in #q196753.

This is what I did to get OpenRAVE to generate an IKFast plugin for your urdf.

I'll assume that you've already:

  • converted the top-level .xacro to a .urdf, and
  • have converted it to Collada (using rosrun collada_urdf urdf_to_collada ..)

I decided to use the personalrobotics/ros-openrave Docker image, as installing OpenRAVE from sources on recent Ubuntu / Debian versions is not trivial, and takes quite some time (as you probably discovered).

We need to tweak the image a bit though, so:

$ mkdir /tmp/prro_work && cd /tmp/prro_work
$ cat << EOF > Dockerfile
FROM personalrobotics/ros-openrave
RUN apt-get update || true && apt-get install -y --no-install-recommends build-essential python-pip && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN pip install sympy==0.7.1
EOF

# Replace `$DOCKER_IMAGE` with some descriptive name here
$ docker build -t $DOCKER_IMAGE .

This makes pip install an older version of sympy in /usr/local, which is then used by OpenRAVE instead of the sympy that is installed by apt. The IKFast generator is very specific about the version of sympy and this version seems to work - in any case it works with your .dae.

Now wait for Docker to build the new image.

Then we need a small wrapper 'robot' for OpenRAVE:

<robot file="$NAME_OF_YOUR_COLLADA_FILE">
  <Manipulator name="NAME_OF_THE_ROBOT_IN_URDF">
    <base>base_link</base>
    <effector>tool0</effector>
  </Manipulator>
</robot>

save this as wrapper.xml (you can obviously change the name if you want). OpenRAVE supports relative filenames for the file attribute of the robot element in our wrapper.xml, so it's easiest if you place wrapper.xml in the same directory that contains the .dae of your robot model.

And make sure to update base_link and tool0 to whatever you want as your base and effector links (these elements correspond to the --baselink and --eelink arguments that you pass to ikfast.py normally). In almost all cases these should correspond to whatever you have modelled as those links in your urdf.

Now generate the plugin:

$ cd /to/wherever/you/have/your/dae/and/your/wrapper
$ mkdir output

# the first volume here is the 'work dir', ie: where we have stored the wrapper and the .dae
# the second volume is where OpenRAVE stores the generated `.cpp`.
# there is no 'output file' argument to `openrave.py --database inversekinematics ..`, so
# this will have to do.
$ docker run -it --rm -v `pwd`:/ikfast -v `pwd`/output:/root/.openrave $DOCKER_IMAGE openrave0.9.py --database inversekinematics --robot=/ikfast/wrapper.xml --iktype=translationyaxisangle4d --iktests=1000

Because we installed build-essential inside the image, we can ask OpenRAVE to run some IK tests for us. OpenRAVE will automatically compile the plugin after it has generated it and run the tests. Pay attention to the final output. On my machine it is something like:

openravepy.databases.inversekinematics: testik, success rate: 1.000000, wrong solutions: 0.000000, no solutions: 0.000000, missing solution: 0.036000

If everything went well, you should now have a ikfast71.TranslationYAxisAngle4D.0_1_2_3.cpp and a ikfast.h in the output/ dir that we created earlier. You should be able to continue with the tutorial now and finish creating the MoveIt IKFast plugin.


Documentation I used for this is basically what I referenced in #q196753.

This is what I did to get OpenRAVE to generate an IKFast plugin for your urdf.

I'll assume that you've already:

  • converted the top-level .xacro to a .urdf, and
  • have converted it to Collada (using rosrun collada_urdf urdf_to_collada ..)

I decided to use the personalrobotics/ros-openrave Docker image, as installing OpenRAVE from sources on recent Ubuntu / Debian versions is not trivial, and takes quite some time (as you probably discovered).

We need to tweak the image a bit though, so:

$ mkdir /tmp/prro_work && cd /tmp/prro_work
$ cat << EOF > Dockerfile
FROM personalrobotics/ros-openrave
RUN apt-get update || true && apt-get install -y --no-install-recommends build-essential python-pip && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN pip install sympy==0.7.1
EOF

# Replace `$DOCKER_IMAGE` with some descriptive name here
$ docker build -t $DOCKER_IMAGE .

This makes pip install an older version of sympy in /usr/local, which is then used by OpenRAVE instead of the sympy that is installed by apt. The IKFast generator is very specific about the version of sympy and this version seems to work - in any case it works with your .dae.

Now wait for Docker to build the new image.

Then we need a small wrapper 'robot' for OpenRAVE:

<robot file="$NAME_OF_YOUR_COLLADA_FILE">
  <Manipulator name="NAME_OF_THE_ROBOT_IN_URDF">
    <base>base_link</base>
    <effector>tool0</effector>
  </Manipulator>
</robot>

save this as wrapper.xml (you can obviously change the name if you want). OpenRAVE supports relative filenames for the file attribute of the robot element in our wrapper.xml, so it's easiest if you place wrapper.xml in the same directory that contains the .dae of your robot model.

And make sure to update base_link and tool0 to whatever you want as your base and effector links (these elements correspond to the --baselink and --eelink arguments that you pass to ikfast.py normally). In almost all cases these should correspond to whatever you have modelled as those links in your urdf.

Now generate the plugin:

$ cd /to/wherever/you/have/your/dae/and/your/wrapper
$ mkdir output

# the first volume here is the 'work dir', ie: where we have stored the wrapper and the .dae
# 
# the second volume is where OpenRAVE stores the generated `.cpp`.
# there is no 'output file' argument to `openrave.py --database inversekinematics ..`, so
# this will have to do.
# 
# make sure to replace $DOCKER_IMAGE with whatever you used earlier
$ docker run -it --rm -v `pwd`:/ikfast -v `pwd`/output:/root/.openrave $DOCKER_IMAGE openrave0.9.py --database inversekinematics --robot=/ikfast/wrapper.xml --iktype=translationyaxisangle4d --iktests=1000

Because we installed build-essential inside the image, we can ask OpenRAVE to run some IK tests for us. OpenRAVE will automatically compile the plugin after it has generated it and run the tests. Pay attention to the final output. On my machine it is something like:

openravepy.databases.inversekinematics: testik, success rate: 1.000000, wrong solutions: 0.000000, no solutions: 0.000000, missing solution: 0.036000

If everything went well, you should now have a ikfast71.TranslationYAxisAngle4D.0_1_2_3.cpp and a ikfast.h in the output/ dir that we created earlier. You should be able to continue with the tutorial now and finish creating the MoveIt IKFast plugin.


Documentation I used for this is basically what I referenced in #q196753.

This is what I did to get OpenRAVE to generate an IKFast plugin for your urdf.

I'll assume that you've already:

  • converted the top-level .xacro to a .urdf, and
  • have converted it to Collada (using rosrun collada_urdf urdf_to_collada ..)

I decided to use the personalrobotics/ros-openrave Docker image, as installing OpenRAVE from sources on recent Ubuntu / Debian versions is not trivial, and takes quite some time (as you probably discovered).

We need to tweak the image a bit though, so:

$ mkdir /tmp/prro_work && cd /tmp/prro_work
$ cat << EOF > Dockerfile
FROM personalrobotics/ros-openrave
RUN apt-get update || true && apt-get install -y --no-install-recommends build-essential python-pip && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN pip install sympy==0.7.1
EOF

# Replace `$DOCKER_IMAGE` with some descriptive name here
$ docker build -t $DOCKER_IMAGE .

This makes pip install an older version of sympy in /usr/local, which is then used by OpenRAVE instead of the sympy that is installed by apt. The IKFast generator is very specific about the version of sympy and this version seems to work - in any case it works with your .dae.

Now wait for Docker to build the new image.

Then we need a small wrapper 'robot' for OpenRAVE:

<robot file="$NAME_OF_YOUR_COLLADA_FILE">
  <Manipulator name="NAME_OF_THE_ROBOT_IN_URDF">
    <base>base_link</base>
    <effector>tool0</effector>
  </Manipulator>
</robot>

save this as wrapper.xml (you can obviously change the name if you want). OpenRAVE supports relative filenames for the file attribute of the robot element in our wrapper.xml, so it's easiest if you place wrapper.xml in the same directory that contains the .dae of your robot model.

And make sure to update base_link and tool0 to whatever you want as your base and effector links (these elements correspond to the --baselink and --eelink arguments that you pass to ikfast.py normally). In almost all cases these should correspond to whatever you have modelled as those links in your urdf.

Now generate the plugin:

$ cd /to/wherever/you/have/your/dae/and/your/wrapper
$ mkdir output

# the first volume here is the 'work dir', ie: where we have stored the wrapper and the .dae
and
# the Collada file.
# 
# the second volume is where OpenRAVE stores the generated `.cpp`.
# there is no 'output file' argument to `openrave.py --database inversekinematics ..`, so
# ..`,
# so this will have to do.
# 
# make sure to replace $DOCKER_IMAGE with whatever you used earlier
$ docker run -it --rm -v `pwd`:/ikfast -v `pwd`/output:/root/.openrave $DOCKER_IMAGE openrave0.9.py --database inversekinematics --robot=/ikfast/wrapper.xml --iktype=translationyaxisangle4d --iktests=1000

Because we installed build-essential inside the image, we can ask OpenRAVE to run some IK tests for us. OpenRAVE will automatically compile the plugin after it has generated it and run the tests. Pay attention to the final output. On my machine it is something like:

openravepy.databases.inversekinematics: testik, success rate: 1.000000, wrong solutions: 0.000000, no solutions: 0.000000, missing solution: 0.036000

If everything went well, you should now have a ikfast71.TranslationYAxisAngle4D.0_1_2_3.cpp and a ikfast.h in the output/ dir that we created earlier. You should be able to continue with the tutorial now and finish creating the MoveIt IKFast plugin.


Documentation I used for this is basically what I referenced in #q196753.

This is what I did to get OpenRAVE to generate an IKFast plugin for your urdf.

I'll assume that you've already:

  • converted the top-level .xacro to a .urdf, and
  • have converted it to Collada (using rosrun collada_urdf urdf_to_collada ..)

I decided to use the personalrobotics/ros-openrave Docker image, as installing OpenRAVE from sources on recent Ubuntu / Debian versions is not trivial, and takes quite some time (as you probably discovered).

We need to tweak the image a bit though, so:

$ mkdir /tmp/prro_work && cd /tmp/prro_work
$ cat << EOF > Dockerfile
FROM personalrobotics/ros-openrave
RUN apt-get update || true && apt-get install -y --no-install-recommends build-essential python-pip && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN pip install sympy==0.7.1
EOF

# Replace `$DOCKER_IMAGE` with some descriptive name here
$ docker build -t $DOCKER_IMAGE .

This makes pip install an older version of sympy in /usr/local, which is then used by OpenRAVE instead of the sympy that is installed by apt. The IKFast generator is very specific about the version of sympy and this version seems to work - in any case it works with your .dae.

Now wait for Docker to build the new image.

Then we need a small wrapper 'robot' for OpenRAVE:

<robot file="$NAME_OF_YOUR_COLLADA_FILE">
  <Manipulator name="NAME_OF_THE_ROBOT_IN_URDF">
    <base>base_link</base>
    <effector>tool0</effector>
  </Manipulator>
</robot>

save this as wrapper.xml (you can obviously change the name if you want). OpenRAVE supports relative filenames for the file attribute of the robot element in our wrapper.xml, so it's easiest if you place wrapper.xml in the same directory that contains the .dae of your robot model.

And make sure to update base_link and tool0 to whatever you want as your base and effector links (these elements correspond to the --baselink and --eelink arguments that you pass to ikfast.py normally). normally, but by name, not an index). In almost all cases these should correspond to whatever you have modelled as those links in your urdf.

Now generate the plugin:

$ cd /to/wherever/you/have/your/dae/and/your/wrapper
$ mkdir output

# the first volume here is the 'work dir', ie: where we have stored the wrapper and
# the Collada file.
# 
# the second volume is where OpenRAVE stores the generated `.cpp`.
# there is no 'output file' argument to `openrave.py --database inversekinematics ..`,
# so this will have to do.
# 
# make sure to replace $DOCKER_IMAGE with whatever you used earlier
$ docker run -it --rm -v `pwd`:/ikfast -v `pwd`/output:/root/.openrave $DOCKER_IMAGE openrave0.9.py --database inversekinematics --robot=/ikfast/wrapper.xml --iktype=translationyaxisangle4d --iktests=1000

Because we installed build-essential inside the image, we can ask OpenRAVE to run some IK tests for us. OpenRAVE will automatically compile the plugin after it has generated it and run the tests. Pay attention to the final output. On my machine it is something like:

openravepy.databases.inversekinematics: testik, success rate: 1.000000, wrong solutions: 0.000000, no solutions: 0.000000, missing solution: 0.036000

If everything went well, you should now have a ikfast71.TranslationYAxisAngle4D.0_1_2_3.cpp and a ikfast.h in the output/ dir that we created earlier. You should be able to continue with the tutorial now and finish creating the MoveIt IKFast plugin.


Documentation I used for this is basically what I referenced in #q196753.

This is what I did to get OpenRAVE to generate an IKFast plugin for your urdf.

I'll assume that you've already:

  • converted the top-level .xacro to a .urdf, and
  • have converted it to Collada (using rosrun collada_urdf urdf_to_collada ..)

I decided to use the personalrobotics/ros-openrave Docker image, as installing OpenRAVE from sources on recent Ubuntu / Debian versions is not trivial, and takes quite some time (as you probably discovered).

We need to tweak the image a bit though, so:

$ mkdir /tmp/prro_work && cd /tmp/prro_work
$ cat << EOF > Dockerfile
FROM personalrobotics/ros-openrave
RUN apt-get update || true && apt-get install -y --no-install-recommends build-essential python-pip liblapack-dev && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN pip install sympy==0.7.1
EOF

# Replace `$DOCKER_IMAGE` with some descriptive name here
$ docker build -t $DOCKER_IMAGE .

This makes pip install an older version of sympy in /usr/local, which is then used by OpenRAVE instead of the sympy that is installed by apt. The IKFast generator is very specific about the version of sympy and this version seems to work - in any case it works with your .dae.

Now wait for Docker to build the new image.

Then we need a small wrapper 'robot' for OpenRAVE:

<robot file="$NAME_OF_YOUR_COLLADA_FILE">
  <Manipulator name="NAME_OF_THE_ROBOT_IN_URDF">
    <base>base_link</base>
    <effector>tool0</effector>
  </Manipulator>
</robot>

save this as wrapper.xml (you can obviously change the name if you want). OpenRAVE supports relative filenames for the file attribute of the robot element in our wrapper.xml, so it's easiest if you place wrapper.xml in the same directory that contains the .dae of your robot model.

And make sure to update base_link and tool0 to whatever you want as your base and effector links (these elements correspond to the --baselink and --eelink arguments that you pass to ikfast.py normally, but by name, not an index). In almost all cases these should correspond to whatever you have modelled as those links in your urdf.

Now generate the plugin:

$ cd /to/wherever/you/have/your/dae/and/your/wrapper
$ mkdir output

# the first volume here is the 'work dir', ie: where we have stored the wrapper and
# the Collada file.
# 
# the second volume is where OpenRAVE stores the generated `.cpp`.
# there is no 'output file' argument to `openrave.py --database inversekinematics ..`,
# so this will have to do.
# 
# make sure to replace $DOCKER_IMAGE with whatever you used earlier
$ docker run -it --rm -v `pwd`:/ikfast -v `pwd`/output:/root/.openrave $DOCKER_IMAGE openrave0.9.py --database inversekinematics --robot=/ikfast/wrapper.xml --iktype=translationyaxisangle4d --iktests=1000

Because we installed build-essential inside the image, we can ask OpenRAVE to run some IK tests for us. OpenRAVE will automatically compile the plugin after it has generated it and run the tests. Pay attention to the final output. On my machine it is something like:

openravepy.databases.inversekinematics: testik, success rate: 1.000000, wrong solutions: 0.000000, no solutions: 0.000000, missing solution: 0.036000

If everything went well, you should now have a ikfast71.TranslationYAxisAngle4D.0_1_2_3.cpp and a ikfast.h in the output/ dir that we created earlier. You should be able to continue with the tutorial now and finish creating the MoveIt IKFast plugin.


Documentation I used for this is basically what I referenced in #q196753.