ROS 2 Beginner Guide (2026): Everything You Need to Get Started
ROS 2 (Robot Operating System 2) is the standard middleware for robotics software. It handles communication between the different parts of a robot system: cameras, arms, navigation planners, AI models, and actuators. Nearly every robot development platform (NVIDIA Isaac, Unitree SDK, UFACTORY xArm) integrates with ROS 2.
If you are entering robotics from a software development or AI background, ROS 2 is the one technology you cannot avoid. This guide covers what it is, how to install it, the core concepts, and a first working project.
What ROS 2 actually is (and is not)
It is: A middleware framework. A set of libraries and tools that handle message passing between different processes (called “nodes”) in a robot system. It provides standardized interfaces so that a camera driver, a path planner, and a motor controller can all talk to each other without custom integration code.
It is not: An operating system (despite the name). It runs on top of Ubuntu Linux. It is also not a robot controller, a physics simulator, or a machine learning framework. Those are separate tools that plug into ROS 2.
Why it exists: Without ROS 2, every robot project would need to build its own communication layer, its own sensor interfaces, and its own coordinate system management. ROS 2 provides all of this as a standard so developers can focus on their specific application logic.
Which version to install (2026)
| Distro | Release | Ubuntu | Status | Recommendation |
|---|---|---|---|---|
| Jazzy Jalisco | May 2024 | 24.04 Noble | LTS (supported through 2029) | Use this |
| Kilted | May 2025 | 24.04 Noble | Latest non-LTS | Only if you need bleeding-edge features |
| Humble Hawksbill | May 2022 | 22.04 Jammy | LTS (EOL 2027) | Legacy, avoid for new projects |
Use Jazzy. It is the current LTS release, supported through 2029, runs on Ubuntu 24.04, and is what NVIDIA Isaac officially supports. Kilted has newer features but less stability testing and less third-party package support.
Installation (Ubuntu 24.04)
# Set locale
sudo locale-gen en_US.UTF-8
export LANG=en_US.UTF-8
# Add ROS 2 repository
sudo apt install software-properties-common
sudo add-apt-repository universe
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 $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
# Install ROS 2 Jazzy (full desktop)
sudo apt update
sudo apt install ros-jazzy-desktop
# Source ROS 2 in every terminal
echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc
source ~/.bashrc
Verify installation:
ros2 run demo_nodes_cpp talker
# In another terminal:
ros2 run demo_nodes_cpp listener
If you see “Publishing: Hello World” in one terminal and “I heard: Hello World” in the other, ROS 2 is working.
Core concepts (the minimum you need)
Nodes
A node is a single process that does one thing. A camera driver is a node. A path planner is a node. A motor controller is a node. Nodes communicate with each other by sending messages.
# List running nodes
ros2 node list
# Get info about a node
ros2 node info /camera_driver
Topics (publish/subscribe)
Topics are named message channels. A node publishes data to a topic, and any other node can subscribe to receive it. This is asynchronous, the publisher does not wait for subscribers.
# List active topics
ros2 topic list
# See what is being published on a topic
ros2 topic echo /camera/image_raw
# Check the message type
ros2 topic info /camera/image_raw
Example: A camera driver node publishes images on the topic /camera/image_raw. A perception node subscribes to that topic, runs object detection, and publishes results on /objects/detected. A planning node subscribes to that topic to decide where to move.
Services (request/response)
Services are synchronous: one node sends a request and waits for a response. Use these for things like “calculate an inverse kinematics solution” or “take a photo now.”
Actions (long-running tasks)
Actions are for tasks that take time and should be cancellable. “Navigate to coordinate (5, 3)” is an action, not a service, because it takes seconds/minutes, can be cancelled mid-execution, and provides progress feedback.
Transform system (tf2)
tf2 manages coordinate frames. A camera sees objects in camera coordinates. A robot arm operates in base coordinates. tf2 converts between them. This is critical for any multi-sensor robot.
# See the transform tree
ros2 run tf2_tools view_frames
First project: a simple publisher/subscriber
Create a workspace and a package:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
# Create a Python package
ros2 pkg create --build-type ament_python my_robot_pkg --dependencies rclpy std_msgs
Write a publisher (my_robot_pkg/publisher.py):
import rclpy
from rclpy.node import Node
from std_msgs.msg import String
class MinimalPublisher(Node):
def __init__(self):
super().__init__('minimal_publisher')
self.publisher_ = self.create_publisher(String, 'robot_status', 10)
timer_period = 1.0 # seconds
self.timer = self.create_timer(timer_period, self.timer_callback)
self.i = 0
def timer_callback(self):
msg = String()
msg.data = f'Robot status update #{self.i}'
self.publisher_.publish(msg)
self.get_logger().info(f'Publishing: "{msg.data}"')
self.i += 1
def main(args=None):
rclpy.init(args=args)
node = MinimalPublisher()
rclpy.spin(node)
node.destroy_node()
rclpy.shutdown()
Build and run:
cd ~/ros2_ws
colcon build --packages-select my_robot_pkg
source install/setup.bash
ros2 run my_robot_pkg publisher
This is the foundation of all ROS 2 development: nodes publishing and subscribing to topics. Everything else (navigation, manipulation, perception) builds on this pattern.
How ROS 2 connects to physical AI tools
ROS 2 is the integration layer that connects AI models to real robot hardware:
| Tool | ROS 2 integration |
|---|---|
| NVIDIA Isaac ROS | Native ROS 2 packages for perception and manipulation |
| NVIDIA Isaac Sim | ROS 2 bridge for publishing simulated sensor data |
| Unitree SDK | ROS 2 bridge available (unitree_ros2) |
| UFACTORY xArm | Official ROS 2 packages |
| LeRobot | Uses ROS 2 for sensor topics (optional) |
| MoveIt2 | Motion planning framework, built entirely on ROS 2 |
| Nav2 | Navigation framework, built entirely on ROS 2 |
The typical workflow: train your AI model in Isaac Sim (which publishes data on ROS 2 topics), then deploy to real hardware (where the same topics carry real sensor data). The AI model does not need to change because the interface (ROS 2 topics) stays the same.
Common beginner mistakes
Mistake 1: “I need ROS 2 for everything” No. If you are building a single robot arm that runs a learned policy (like the SO-101 with LeRobot), you might not need ROS 2 at all. It adds value when you have multiple subsystems that need to coordinate.
Mistake 2: Mixing ROS 1 and ROS 2 resources ROS 1 (Noetic) reached EOL in May 2025. Many tutorials online are still written for ROS 1. Always check that you are reading ROS 2-specific documentation. The APIs are completely different.
Mistake 3: Not understanding the build system
ROS 2 uses colcon to build packages. The workspace structure (src/, install/, build/) is important. Always source install/setup.bash after building. Many “it doesn’t work” issues are just forgetting to source.
Mistake 4: Starting with a complex robot Start with the publisher/subscriber example above. Then add a simulated robot in Isaac Sim or Gazebo. Only then try real hardware. The jump from simulation to reality is where most bugs live.
What to learn next
After getting comfortable with basic pub/sub:
- tf2 and coordinate frames (essential for any multi-sensor system)
- Launch files (starting multiple nodes with one command)
- Nav2 (if your robot moves around a space)
- MoveIt2 (if your robot has an arm that needs motion planning)
- Isaac ROS (if you are deploying NVIDIA-accelerated perception)
FAQ
Is ROS 2 hard to learn?
The basic concepts (nodes, topics, services) are straightforward for anyone with programming experience. The difficulty is in the tooling complexity: workspaces, build systems, launch files, and parameter management. Budget 1-2 weeks for comfortable basic usage, months for advanced features.
Can I use ROS 2 on macOS or Windows?
Partially. Ubuntu Linux is the primary and best-supported platform. macOS and Windows have experimental support but many packages are not available. For serious robotics development, use Ubuntu 24.04.
Do I need ROS 2 for a hobby robot arm?
Probably not. If you are using a single arm with LeRobot, the framework handles communication internally. ROS 2 becomes valuable when you add cameras, a mobile base, multiple arms, or any multi-component system.
What is the difference between ROS 2 Jazzy and Kilted?
Jazzy is the current LTS (long-term support, through 2029). Kilted is the latest release with newer features but shorter support window. For new projects, use Jazzy unless you specifically need a Kilted feature.
How does ROS 2 relate to NVIDIA Isaac?
Isaac ROS is a set of ROS 2 packages that add GPU-accelerated perception and manipulation capabilities. Isaac Sim publishes simulated sensor data on ROS 2 topics. They are built on top of ROS 2, not alternatives to it.