1. Introduction

ROS 2 Humble

The Robot Operating System (ROS) is a set of software libraries and tools for building robot applications. From drivers and state-of-the-art algorithms to powerful developer tools, ROS has the open source tools you need for your next robotics project.


2. Installation

2.1 Install ROS2

2.2 Configure ROS2 Environment

ROS 2 development environment needs to be configured before use. This can be done by sourcing setup files in each terminal session or adding the source command to your startup script.

ROS2 environment

Option 1: Source manually each terminal session

# Replace ".bash" with your shell if not using bash
# Possible values: setup.bash, setup.sh, setup.zsh
source /opt/ros/humble/setup.bash

You need to run this in every new terminal session unless automated.

echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
source ~/.bashrc

Option 3: Manual editing using nano

sudo apt-get install nano     # Install nano if needed
nano ~/.bashrc                # Open .bashrc
# Add the following line at the end of the file
source /opt/ros/humble/setup.bash
# Save and close (Ctrl+X, then Y, then Enter)

3. Workspaces

3.1 Create an Empty Workspace

A workspace is a directory containing ROS 2 packages. It typically has a src subdirectory where package source code resides. Usually starts empty.

Steps

  1. Source main ROS2 installation (underlay)
source /opt/ros/humble/setup.bash
  1. Create a training workspace and src folder
mkdir -p training_ws/src
cd training_ws/src
  • Workspace structure

3.2 Build Workspace Using Colcon


4. Packages

4.1 Install ROS Packages

Binary packages

Precompiled versions that install directly via a package manager (e.g., apt). Recommended for most users since dependencies and updates are handled automatically.

Building from source

Download and compile the code manually. Recommended if binaries aren’t available, or to access the latest version of ROS.

4.2 Create a Package

4.3 Create a ROS Node


5. Tutorials / Examples

5.1 Topics and Turtlesim

5.2 tf2


6. References