Building Drake as a Catkin Package in ROS Kinetic and Ubuntu 16.04 (Xenial)

Step 1: Install Prerequisites

Install Ubuntu 16.04 LTS (Xenial Xerus) and ROS Kinetic. We recommend installing the “desktop-full” version of ROS to get its full feature set.

Add your public SSH key to your account by following these instructions. This is necessary because the instructions below assume you can clone Git repositories from using SSH rather than HTTPS.

Install package ros-kinetic-ackermann-msgs:

sudo apt-get install ros-kinetic-ackermann-msgs

Once the OS and ROS are installed, install Catkin Tools by following the instructions here. We use catkin_tools due to its better support building pure CMake packages alongside Catkin packages.

Step 2: Create Directories for Holding a ROS Catkin Workspace

This assumes you want to create a new ROS workspace in ~/dev called drake_catkin_workspace. The commands below can be customized with a different workspace name and location. If you already have a ROS Catkin workspace and simply want to add Drake as a package within it, you can skip this step and go straight to Step 3: Add drake and drake_ros_integration to the Workspace.

Execute the following commands to create a directory structure for holding the ROS workspace:

mkdir -p ~/dev/drake_catkin_workspace/src

Step 3: Add drake and drake_ros_integration to the Workspace

Add drake and drake_ros_integration to the workspace:

cd ~/dev/drake_catkin_workspace/src
git clone
git remote set-url origin[your github user name]/drake.git
git remote add upstream
git remote set-url --push upstream no_push
ln -s drake/ros drake_ros_integration

Note that drake_ros_integration is a symbolic link. This allows us to keep everything in Drake’s main repository without needing to reorganize the files in it (see Drake issue #4445).

Step 4: Install Drake’s Dependencies

Drake includes a convenient Ubuntu 16.04 shell script that installs all of its dependencies. This script is located in ~/dev/drake_catkin_workspace/src/drake/setup/ubuntu/16.04/

There is currently a conflict between Drake’s need for libvtk5-dev and ROS Kinetic’s need for libvtk6-dev. To resolve this issue, we do the following:

Open ~/dev/drake_catkin_workspace/src/drake/setup/ubuntu/16.04/ and delete the following lines:


Then execute the script:

cd ~/dev/drake_catkin_workspace/src/drake/setup/ubuntu/16.04
sudo ./

Step 5: Build the Workspace

Execute the following commands to build the workspace:

cd ~/dev/drake_catkin_workspace
source /opt/ros/kinetic/setup.bash
catkin init
catkin config --cmake-args -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DWITH_DIRECTOR=OFF
catkin build

Director is disabled because it relies on vtk5, which is incompatible with ROS Kinetic.

Step 6: Modify Environment Variables to Allow VTK5 Libraries to be Found

Try launching drake-visualizer:

cd ~/dev/drake_catkin_workspace

You may encounter the following error:

./install/bin/drake-visualizer: error while loading shared libraries: cannot open shared object file: No such file or directory

To fix this error, modify your LD_LIBRARY_PATH and PYTHON_PATH environment variables as follows:

export LD_LIBRARY_PATH=$HOME/dev/drake_catkin_workspace/install/lib/vtk-5.10:$LD_LIBRARY_PATH
export PYTHONPATH=$HOME/dev/drake_catkin_workspace/build/drake/externals/vtk/Wrapping/Python:$HOME/dev/drake_catkin_workspace/build/drake/externals/vtk/bin:$PYTHONPATH

You should now be able to run drake-visualizer. For more background information, see this thread.

This concludes the instructions for how to install and build Drake using ROS Kinetic on Ubuntu 16.04. See these additional notes on where to proceed from here.


If you’re unable to launch drake-visualizer due to a “No module named vtkCommonCorePython” error, see this FAQ.