ROS2 (Dashing) in Debian Unstable (2019.10.04)

These instructions are based on the ROS2 official installation webpage:

There are small differences. This may change with future ROS2 updates.

  • Add ROS2 apt repository (lsb_release -cs sets the repository to “sid” which is a mistake, it must be forced to “buster”)
sudo apt update && sudo apt install curl gnupg2 lsb-release
curl -s | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64,arm64] buster main" > /etc/apt/sources.list.d/ros2-latest.list'
  • Install development tools and ROS tools:
sudo apt update && sudo apt install -y \
build-essential \
cmake \
git \
python3-colcon-common-extensions \
python3-pip \
python-rosdep \
python3-vcstool \
# install some pip packages needed for testing
python3 -m pip install -U \
argcomplete \
flake8 \
flake8-blind-except \
flake8-builtins \
flake8-class-newline \
flake8-comprehensions \
flake8-deprecated \
flake8-docstrings \
flake8-import-order \
flake8-quotes \
pytest-repeat \
pytest-rerunfailures \
pytest \
pytest-cov \
pytest-runner \
# install Fast-RTPS dependencies
sudo apt install --no-install-recommends -y \
libasio-dev \
# install CycloneDDS dependencies
sudo apt install --no-install-recommends -y \
  • Create workspace and clone repos:
mkdir -p ~/ros2_dashing/src
cd ~/ros2_dashing
vcs import src < ros2.repos
  • Install dependencies using rosdep
sudo rosdep init
rosdep update
rosdep install --os=debian:buster --from-paths src --ignore-src --rosdistro dashing -y --skip-keys "console_bridge fastcdr fastrtps libopensplice67 libopensplice69 rti-connext-dds-5.3.1 urdfdom_headers"
  • Configure the system to use gcc and g++ version 8 instead of version 9:
sudo apt-get install gcc-8 g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 --slave /usr/bin/g++ g++ /usr/bin/g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
  • Build the code in the workspace
cd ~/ros2_dashing/
colcon build --symlink-install
  • Try some examples
  • In one terminal:
. ~/ros2_dashing/install/local_setup.bash
ros2 run demo_nodes_cpp talker
  • In another terminal:
. ~/ros2_dashing/install/local_setup.bash
ros2 run demo_nodes_py listener
  • tutorials/ros2_in_debian_unstable.txt
  • Last modified: 2019/11/05 15:27
  • by admin