Skip to main content

Install ROS2 HUMBLE

System requirements

  • Debian 12 BookWorm

Sett up the locale

echo -e "export LC_ALL=en_US.UTF-8\nexport LANG=en_US.UTF-8\n" >> $HOME/.bashrc
source $HOME/.bashrc

Install the required tools

sudo apt update && sudo apt full-upgrade

sudo apt install -y \
python3-flake8-blind-except \
python3-flake8-class-newline \
python3-flake8-deprecated \
python3-mypy \
python3-pip \
python3-pytest \
python3-pytest-cov \
python3-pytest-mock \
python3-pytest-repeat \
python3-pytest-rerunfailures \
python3-pytest-runner \
python3-pytest-timeout \

pip install vcstool

sudo apt install build-essential

Capacity

  • Ensure that there is at least 15 GB of free space in the workspace for compiling the source code

Compile

  • Create a working directory
mkdir -p ros2_humble/src
cd ros2_humble
  • Get source code
wget https://raw.githubusercontent.com/ros2/ros2/humble/ros2.repos
vcs import src < ros2.repos
  • Installation of dependencies
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-6.0.1 urdfdom_headers python3-vcstool"
  • Compile the source code
colcon build --symlink-install

How to use

  • Set up the environment
echo -e "source ${path_to_ros2_source}/ros2_humble/install/setup.bash" >> $HOME/.bashrc
source $HOME/.bashrc
  • Example
  1. Open a terminal and run the c++ talker example.
ros2 run demo_nodes_cpp talker
  1. Open another terminal and run the python listener example
ros2 run demo_nodes_py listener
  1. Authentication

After executing these two commands, you should see a message from the talker side:

ros2 run demo_nodes_cpp talker
[INFO] [1728966840.691346935] [talker]: Publishing: 'Hello World: 1'
[INFO] [1728966841.691537928] [talker]: Publishing: 'Hello World: 2'
[INFO] [1728966842.691572879] [talker]: Publishing: 'Hello World: 3'
[INFO] [1728966843.691563207] [talker]: Publishing: 'Hello World: 4'
[INFO] [1728966844.691568120] [talker]: Publishing: 'Hello World: 5'

and a message from the listener:

ros2 run demo_nodes_py listener
[INFO] [1728966840.716456921] [listener]: I heard: [Hello World: 1]
[INFO] [1728966841.698002748] [listener]: I heard: [Hello World: 2]
[INFO] [1728966842.697675740] [listener]: I heard: [Hello World: 3]
[INFO] [1728966843.697643318] [listener]: I heard: [Hello World: 4]
[INFO] [1728966844.697551980] [listener]: I heard: [Hello World: 5]

this verifies that both the C++ and Python APIs are working.