Installing Orocos KDL in Debian

WARNING: This tutorial will soon be deprecated because we are going to migrate to ARCOS-KDL.

cd ~/local/src
git clone
cd orocos-kdl
make install-python

Installing inside a Python Virtual Environment

WARNING! This is still work in progress First install the dependencies for making a virtualenv

  sudo apt install python-virtualenv

Now create a virtual environment and activate it. Please note that we are using the variable PYTHON_VENVS here. This is the place where the virtual environment will be created. So before executing the following code assign it a value, for example


The above is just an example. You should set PYTHON_VENVS to any path you want your virtual environments to live in. Putting them directly in your home is a bad idea…

Also note that the environment variable VIRTUAL_ENV only exists if you are inside an activated virtual environment. In this particular case, it points to ${PYTHON_VENVS}/arcos

  virtualenv --python=python2 arcos
  cd arcos
  source bin/activate
  mkdir src
  mkdir DIR
  export PREFIX=${VIRTUAL_ENV}/DIR/kdl
  cd src
  git clone 
  cd orocos-kdl
  make install-python

Installing from Master

It is also possible to install orocos-kdl from master and have access to their latest improvements. If you already folloed the instructions above, you don't have to follow these ones.

cd ~/local/src/
git clone
cd orocos_kinematics_dynamics/orocos_kdl
mkdir build
cd build
ccmake ..

This will configure the Cmake environment to build orocos-kdl. Select ~/local/DIR/orocos_kdl/ as the installation directory. And make sure that the correct eigen3 dir is found. To configure press 'c', and to generate presss 'g'.

Once generated:

make -j8
make install
cd ~/local/DIR/
xstow orocos_kdl

Now we need to install the python bidings.

cd ~/local/src/orocos_kinematics_dynamics/python_orocos_kdl/
mkdir build
cd build
ccmake ..

Select ~/local/DIR/py_kdl as the installation directory. You should make sure that orocos is using the correct python interpreter, if the default of your system is Python3, then make sure that it is looking for Python3. It may be required to toggle advanced options for that (press 't'). Generate the make files

make install
cd ~/local/DIR/
xstow py_kdl

Now, for a very Quick test, open a python interpreter and import PyKDL, if you should not receive error messages.

import PyKDL


If you want to play with kinematic chains and visualize them in real time, do the following:

  • Install the Humanoid robot Simulator
  • Checkout examples branch in pyrotivo
  • Reinstall pyrovito
  • in a shell execute the yarp server
  • in another shell execute pyrovito
  • open another shell:
cd local/src/pyrovito/examples

once you are in IPython:

import numpy as np
import iexample as ix
import json
# load the kinematic configurations
with open("kinematics_conf.json", "r") as conf_file:
    conf = json.load(conf_file)
    kuka = conf["kuka"]
    simple = conf["simple"]
# start the handler
handler = ix.InteractiveHandler()
# Create a tiny box
box = handler.create_object("box", scale=[0.1, 0.1, 0.1])
# Create the kuka arm
arm = handler.create_chain(kuka)
box.update_twist(np.array([0.0, 0.0, 0.0, 0.0, 0.0, 2.0]))
  • tutorials/installing_orocos_kdl_in_debian.txt
  • Last modified: 2019/06/14 23:38
  • by dgarcia