Robot operating systems

ROS 2

ROS 2 is middleware for robot applications. Nodes exchange messages through topics, request work through services and actions and communicate through a configurable DDS or other RMW layer. A ROS 2 installation alone does not supply motor drivers, a safe motion controller or a robot model.

Practical engineering guide

What you can build with ROS 2 and where problems start

ROS 2 is middleware for robot applications. Nodes exchange messages through topics, request work through services and actions and communicate through a configurable DDS or other RMW layer. A ROS 2 installation alone does not supply motor drivers, a safe motion controller or a robot model.

Download, install and launch ROS 2

On Ubuntu 24.04 choose ROS 2 Jazzy. On the official download page configure the ROS apt repository for Noble, then install the desktop packages. In each terminal source the environment.

Download ROS 2
sudo apt update
sudo apt install ros-jazzy-desktop
source /opt/ros/jazzy/setup.bash
ros2 doctor --report
# Terminal 1
ros2 run demo_nodes_cpp talker
# Terminal 2 (source setup.bash first)
ros2 run demo_nodes_py listener

A first test you can reproduce

  1. 01.Choose one supported ROS 2 distribution for the host operating system. For example, pair Jazzy with Ubuntu 24.04 and check the installation page before copying commands from another release.
  2. 02.Source the correct setup file in every terminal, then run 'ros2 doctor --report' and 'ros2 topic list' before launching your own nodes.
  3. 03.Run the official talker/listener demos in two terminals. Confirm their messages are visible, then test a real sensor and inspect its timestamps and frame IDs.
  4. 04.Record a short rosbag and play it back on the machine that will run your algorithms. A working topic list does not prove the messages are usable.

Questions that come up during real implementation

Why do 'ros2 topic list' and 'ros2 topic echo' show different results?

First compare ROS_DOMAIN_ID on both machines, then inspect the selected RMW implementation, DDS discovery, firewall and network interfaces. Use 'ros2 topic info -v /topic_name' to inspect publisher/subscriber QoS. A reliable subscriber and a best-effort sensor publisher may not match if the requested QoS is incompatible.

How do I choose between topics, services and actions?

Use topics for continuous state or sensor streams; services for short request-response operations; actions for long-running goals that need progress and cancellation. A motion goal usually needs an action or controller interface, while camera frames belong on topics. None of these by itself establishes a safety-rated stop.

Can I use ROS 2 for a hard real-time motor loop?

ROS 2 can participate in real-time-aware systems, but timing depends on the OS, executor, memory allocation, RMW and driver. Keep hard safety functions on suitable controllers and measure end-to-end jitter and worst-case behavior before allowing external middleware commands to drive actuators.

Checks before using it on a robot

  • Record publisher rate, end-to-end latency, missed messages, time source and DDS configuration under network load.
  • Restart a node or disconnect a sensor while logging how the robot and other nodes recover.

Official technical reference

https://docs.ros.org/en/jazzy/

Compatibility and installation

Developer
Open Robotics
License
Open source
Operating systems
Linux, Windows, macOS
ROS support
ROS 2
Languages
C++, Python
Installation method
Official binary packages, source builds and container images

Profile sources

Explore the connected robotics directories