1. Introduction
![]()
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
- Reference: ROS Setup.md
-
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.
![]()
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.bashYou need to run this in every new terminal session unless automated.
Option 2 (Recommended): Add sourcing to shell startup script
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
source ~/.bashrcOption 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
srcsubdirectory where package source code resides. Usually starts empty.
Steps
- Source main ROS2 installation (underlay)
source /opt/ros/humble/setup.bash- Create a training workspace and
srcfolder
mkdir -p training_ws/src
cd training_ws/srcROS 2 supports overlaying multiple workspaces. The main installation is the underlay, local workspaces are overlays. Source the underlay first to provide necessary build dependencies.
3.2 Build Workspace Using Colcon
- Reference: Build a 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
- Reference: Topics and Turtlesim
5.2 tf2
- Reference: tf2 Tutorial
6. References
- ROS 2 Humble Documentation
- ROS Setup.md
- Build a workspace using colcon
- Create a package
- Create a publisher and subscriber node
- Topics and Turtlesim
- tf2 Tutorial



