(DRAFT) Installing ROS on Debian/Buster

The ROS packages for Debian do not yet include all packages for a fully functional ROS installation.

This tutorial will describe what you need to do to get a working ROS-setup on Debian/Buster

Goal

We will try to compile missing ROS-packages. The goal would be to have a ROS-workspace with all missing packages for desktop-full and then overlay your own ROS-workspace to start actually using ROS.

After that you should be able to mostly follow the ROS-documentation at (wiki).ros.org when learning ROS or to just git clone packages and compile them for your own use. Or develop your own packages based on the Debian-ROS-Packages or the packages in your underlaying ROS-workspace.

Install ROS

We assume that you are on a system with Debian Buster installed and no other sources are available. (E.g. no mixed setup with stretch and buster packages for example and no packages.ros.org in your sources.list)

You should install every available package that is related to ROS. ros-desktop-full is a good start, but you will need more. Let's see:

# apt install ros-desktop-full
# apt search ros| grep -B1 -i 'robot os'

This should give you a good idea of what is available. Install as much as you can ;-)

You will also need development tools to compile the missing ROS-packages, maybe we also need some Debian tools for rebuilding debian packages

 # apt install build-essential dpkg-dev git 

ROS depends on OpenCV so install that too. Some ROS-Packages do depend on planning libraries, so we can install them when available.

 # apt install libopencv-dev liborocos-kdl-dev libompl-dev

Building Packages

We will build the missing package in an extra workspace. This functions as a underlay. The ROS-build tool can overlay multiple workspaces. Your own development can take place in another workspace.

ROS is already organised in releases and metapackages. The Debian packages do not strictly follow this scheme, but we will start from a ROS-kinetic release.

Tools needed

We will use rosinstall_generator, wstool and catkin_make which are already installed installed if you followed this guide.

The rosinstall_generator tool helps getting all packages needed for a specific ROS release. With the right options the already installed Debian packages are recognized. Let's create a workspace and then use rosinstall_generator to create a download for the two metapackages desktop_full and moveit

 $ mkdir ~/ros-underlay
 $ cd ~/ros-underlay
 $ rosinstall_generator desktop_full moveit --rosdistro kinetic --exclude RPP --exclude-path /usr/share --deps --wet-only > kinetic_debian_moveit.rosinstall

The options --exclude RPP signals that we want to ignore already available packages from the RosPackagePath. And the --exclude-path /usr/share does basically the same.

We need to tweek this file a bit, because not all packages build cleanly on Debian/buster. You can directly download a working file here: kinetic_debian_moveit.rosinstall and omit the step running rosinstall_generator. The diff looks something like this:

   1 --- kinetic_plain.rosinstall    2018-06-18 21:19:37.114704616 +0200
   2 +++ kinetic_debian_moveit.rosinstall    2018-06-18 11:05:08.781848587 +0200
   3 @@ -27,6 +27,10 @@
   4      uri: https://github.com/ros-gbp/common_tutorials-release.git
   5      version: release/kinetic/turtle_actionlib/0.1.10-0
   6  - git:
   7 +    local-name: control_msgs
   8 +    uri: https://github.com/ros-gbp/control_msgs-release.git
   9 +    version: release/kinetic/control_msgs/1.4.0-0
  10 +- git:
  11      local-name: diagnostics/diagnostic_aggregator
  12      uri: https://github.com/ros-gbp/diagnostics-release.git
  13      version: release/kinetic/diagnostic_aggregator/1.9.3-0
  14 @@ -177,7 +181,7 @@
  15  - git:
  16      local-name: laser_filters
  17      uri: https://github.com/ros-gbp/laser_filters-release.git
  18 -    version: release/kinetic/laser_filters/1.8.5-0
  19 +    version: release/melodic/laser_filters/1.8.6-0
  20  - git:
  21      local-name: laser_pipeline
  22      uri: https://github.com/ros-gbp/laser_pipeline-release.git
  23 @@ -233,7 +237,7 @@
  24  - git:
  25      local-name: moveit/moveit_kinematics
  26      uri: https://github.com/ros-gbp/moveit-release.git
  27 -    version: release/kinetic/moveit_kinematics/0.9.12-1
  28 +    version: release/melodic/moveit_kinematics/0.10.1-0
  29  - git:
  30      local-name: moveit/moveit_planners
  31      uri: https://github.com/ros-gbp/moveit-release.git
  32 @@ -549,7 +553,7 @@
  33  - git:
  34      local-name: srdfdom
  35      uri: https://github.com/ros-gbp/srdfdom-release.git
  36 -    version: release/kinetic/srdfdom/0.4.2-1
  37 +    version: release/melodic/srdfdom/0.5.1-0
  38  - git:
  39      local-name: stage
  40      uri: https://github.com/ros-gbp/stage-release.git

This might change due to changes in Debian packages. When you get errors in the compile process a version upgrade like above might help.

The rosinstall_generator creates a file that we can feed into the next tool wstool

 $ wstool init -j8 src kinetic_debian_moveit.rosinstall

This will create a file src/.rosinstall.

Because some packages do not build or are not detected by the rosinstall_generator, we need to ingore some paths in the src directory.

The catkin build tool will ignore certain paths when it sees a CATKIN_IGNORE file in a directory. The following packages are not strictly needed or are available as debian packages but not found.

 $ touch ./src/ompl/CATKIN_IGNORE
 $ touch ./src/geometry_tutorials/turtle_tf/CATKIN_IGNORE
 $ touch ./src/common_tutorials/nodelet_tutorial_math/CATKIN_IGNORE
 $ touch ./src/gennodejs/CATKIN_IGNORE
 $ touch ./src/geneus/CATKIN_IGNORE
 $ touch ./src/stage/CATKIN_IGNORE
 $ touch ./src/stage_ros/CATKIN_IGNORE 
 $ touch ./src/moveit/moveit_setup_assistant/CATKIN_IGNORE

You could of course remove these packages also from the kinetic_debian_moveit.rosinstall file.

Now we should be ready to compile.

 $ cd ~/ros-underlay
 $ catkin_make

This should give you a working ROS installation.

Overlay your own workspace

With caktin you can now create another workspace and use the ros-underlay workspace as a base.

 $ mkdir ~/ros
 $ cd ~/ros
 $ source ~/ros-underlay/devel/setup.(ba)sh
 $ <create a ros package in src or download something from ros.org>
 $ catkin_make

This should build your new package with the other packages already available.

When something does not work

Rebuild or Update Debian-Packages from source