Skip to content

CatkinBuild

Anton Deguet edited this page Jul 14, 2024 · 39 revisions

Introduction

We suggest 3 different ways to retrieve all the dVRK required source repositories and compile them. The first two methods are for Linux/ROS users only and rely on the catkin build tools. Pleas note that we do not support catkin_make .

catkin build and rosinstall

The vcs configuration file is provided in dVRK 2.x and higher but can also be used with older versions (see https://github.com/jhu-saw/vcs). The vcs file defines all the github repositories that need to be cloned in your workspace as well as which branches.

Debian packages

This section assumes you already have ROS installed (see https://www.ros.org). You will need to install a few more packages for the dVRK software. This has to be done once per computer.

  • Ubuntu 16.04 with ROS Kinetic (not supported for release 2.2 and up): sudo apt-get install libxml2-dev libraw1394-dev libncurses5-dev qtcreator swig flite sox espeak cmake-curses-gui cmake-qt-gui libopencv-dev git subversion gfortran libcppunit-dev qt5-default python-vcstool python-catkin-tools
  • Ubuntu 18.04 with ROS Melodic: sudo apt install libxml2-dev libraw1394-dev libncurses5-dev qtcreator swig sox espeak cmake-curses-gui cmake-qt-gui git subversion gfortran libcppunit-dev libqt5xmlpatterns5-dev libbluetooth-dev libhidapi-dev python-vcstool python-catkin-tools
  • Ubuntu 20.04 with ROS Noetic:sudo apt install libxml2-dev libraw1394-dev libncurses5-dev qtcreator swig sox espeak cmake-curses-gui cmake-qt-gui git subversion gfortran libcppunit-dev libqt5xmlpatterns5-dev libbluetooth-dev libhidapi-dev python3-pyudev python3-vcstool python3-catkin-tools python3-osrf-pycommon python-is-python3

⚠️ for any dVRK software version greater than 2.1

  • Ubuntu 16.04 support has been dropped
  • Ubuntu 18.04 support requires clang instead of gcc. You will need to install clang with sudo apt install clang and configure your workspace using: catkin config --cmake-args -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release

Catkin workspace, clone and build

⚠️ ROS uses Python extensively for the build process. Make sure you use the default Python and de-activate any local Python install (which python should return /usr/bin/python). You should also make sure your ROS environment variables match the workspace and ROS version you're using (check with env | grep -i ros).

If you're using ROS Noetic and the master branch, you can just copy/paste the following block of commands in a terminal. For other configurations, make sure your replace noetic by melodic or whatever version of ROS you're using. For the devel branches, replace master by devel.

source /opt/ros/noetic/setup.bash # or use whatever version of ROS is installed!
mkdir ~/catkin_ws                  # create the catkin workspace
cd ~/catkin_ws                     # go in the workspace
catkin init                        # create files for catkin build tool
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release # all code should be compiled in release mode
mkdir src
cd src                             # go in source directory to pull code
vcs import --recursive --workers 1 --input https://raw.githubusercontent.com/jhu-saw/vcs/main/ros1-dvrk-2.2.1.vcs
catkin build --summary             # ... and finally compile everything

If you want to use the release 2.1, replace the vcs command with:

vcs import --recursive --workers 1 --input https://raw.githubusercontent.com/jhu-saw/vcs/main/ros1-dvrk-2.1.0.vcs

For the development branches, use:

vcs import --recursive --workers 1 --input https://raw.githubusercontent.com/jhu-saw/vcs/main/ros1-dvrk-devel.vcs

Environment variables

This is recommended if you're going to use a single catkin workspace (as most users do): https://github.com/jhu-cisst/cisst/wiki/Compiling-cisst-and-SAW-with-CMake#setting-up-your-environment-variables-for-ros

catkin build and git submodules

This approach is a bit more complicated and will add some extra repositories for SAW components not needed for the dVRK software. Compilation time will be slightly longer. Most repositories in cisst/SAW will be cloned using git sub-modules.

cisstNetlib, cisst, SAW components and cisst-ros bridge

You will first need to build cisst and its dependencies. Follow the instructions provided for cisst/SAW catkin build and then come back to this page for the dVRK/ROS specific packages.

dvrk-ros

These packages are not part of the cisst-saw repositories so you have to clone them manually. You first need to download the cisst-saw libraries and components (see instructions above) and then do:

cd ~/catkin_ws/src
git clone https://github.com/jhu-dvrk/dvrk-ros
git clone https://github.com/jhu-dvrk/dvrk-gravity-compensation
git clone https://github.com/collaborative-robotics/crtk_msgs crtk/crtk_msgs
git clone https://github.com/collaborative-robotics/crtk_python_client crtk/crtk_python_client
git clone https://github.com/collaborative-robotics/crtk_matlab_client crtk/crtk_matlab_client
catkin build --summary

cmake; make and git submodules

This is not recommended for most users but can be useful if you don't have ROS or want to compile some of the dVRK code on Windows. See: https://github.com/jhu-dvrk/sawIntuitiveResearchKit/wiki/Build

Clone this wiki locally