This guide documents the installation process of the Ubuntu 22.04 (Jammy Jellyfish) operating system and the configuration of the ROS 2 Humble Hawksbill robotics framework.
Before starting, define your installation method.
You may choose to install Ubuntu on a Virtual Machine (using software like VirtualBox or VMware). This is a safe option for initial testing and does not affect your current operating system.
- Pros: Easy to set up, no risk of losing Windows/Mac data.
- Cons: Graphics performance (GPU) is significantly reduced, which may cause lag in ROS simulation tools (such as Gazebo and RViz).
Attention: This tutorial focuses on Native Installation (USB Boot) to ensure direct hardware access and maximum performance. If you choose to use a VM, install Ubuntu 22.04 on it and skip directly to Section 2.
Ensure you are running a clean and updated installation of Ubuntu 22.04 LTS.
- Bootable USB drive (minimum 8GB).
- Official Ubuntu 22.04 LTS ISO: Click here to download (releases.ubuntu.com)
- Note: Make sure to download the "Desktop image" version.
- Boot via USB (BIOS/UEFI).
- Select the standard installation.
- Important: Check the option "Install third-party software for graphics and Wi-Fi hardware" during installation to ensure proprietary drivers (NVIDIA, Wi-Fi, etc.) are installed.
After the first login, open the terminal and update the base system:
sudo apt update && sudo apt upgrade -yFollowing the official documentation and system requirements.
ROS 2 requires an environment with UTF-8 support.
Execute the commands below to ensure the correct configuration:
sudo apt update && sudo apt install locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8Verify the settings with the command: locale
It is necessary to enable the Ubuntu Universe repository and add the ROS 2 GPG key.
-
Enable Universe:
sudo apt install software-properties-common sudo add-apt-repository universe
-
Add GPG Key and Repository:
sudo apt update && sudo apt install curl -y sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
Warning: Due to recent updates in Ubuntu 22.04 (systemd/udev), it is crucial to run the upgrade command before installing ROS packages to avoid dependency conflicts.
-
Update repository cache:
sudo apt update sudo apt upgrade
-
Desktop Version Installation (Recommended): Includes ROS, RViz, demos, and tutorials.
sudo apt install ros-humble-desktop
-
Development Tools: Required to build packages later (Colcon).
sudo apt install ros-dev-tools
For the terminal to recognize ROS commands, the setup script must be loaded.
Run this in every new terminal:
source /opt/ros/humble/setup.bashAutomation (Optional):
To add this to your .bashrc and automatically load it in every new terminal session:
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
source ~/.bashrc#4. Installation Verification (Talker/Listener Demo)
To validate communication between Nodes, we will use the C++ (Talker) and Python (Listener) examples.
-
Terminal 1 (Talker):
source /opt/ros/humble/setup.bash ros2 run demo_nodes_cpp talker -
Terminal 2 (Listener):
source /opt/ros/humble/setup.bash ros2 run demo_nodes_py listener
If the Listener receives the "Hello World" messages from the Talker, the installation was successful.