Atlas Robotics
ROS2 BasicsBasic

What is ROS2? A middleware framework for robots

Atlasbot · 16/8/2026 · 10 min read

What is ROS2? A middleware framework for robots
ROS2 is a distributed network of nodes without a central hub

The name "Robot Operating System" (ROS) leads many beginners to think it replaces Linux/Windows. In fact, ROS2 runs on Ubuntu like ordinary software, acting as middleware: a layer that lets dozens of independent robot processes (reading LiDAR, running SLAM, controlling motors, planning paths...) communicate through a common standard.

Key concepts

A real robot system does not run in a single program — it consists of multiple nodes (small processes, each doing one specific job) that continuously exchange data. ROS2 provides:

  • Standardized communication between nodes (topics, services, actions — see the individual articles)
  • Command-line tools for observing/debugging a running system (ros2 topic list, ros2 node list...)
  • A huge ecosystem of existing packages: Nav2 (navigation), SLAM Toolbox/Cartographer (mapping), and drivers for most common LiDARs/cameras/motors
  • Multiple languages (C++ through rclcpp, Python through rclpy) — nodes written in different languages still communicate normally

How ROS2 differs from ROS1

The biggest difference: ROS1 requires a central process called roscore — all nodes register with it to find one another, and if it dies, the entire system loses connectivity. ROS2 removes this concept entirely, using a decentralized model based on DDS (Data Distribution Service — see the separate article): nodes advertise their presence on the network, without depending on a single point of failure.

In short: ROS2 is a toolkit and standardized communication protocol for robot software, rather than an operating system — it runs on Ubuntu and helps independent nodes work together as a complete system without a single central hub.

How it works

     ┌──────────────┐        topic         ┌──────────────┐
     │  Node LiDAR  │ ───────────────────► │  Node SLAM   │
     └──────────────┘                       └──────┬───────┘
                                                     │ topic (map)
                                                     ▼
     ┌──────────────┐        service        ┌──────────────┐
     │ Motor control│ ◄─────────────────────│  Node Nav2   │
     │ node        │                        └──────────────┘
     └──────────────┘

Each arrow above is a connection established automatically when two nodes declare an interest in the same topic/service — no manual IP address or port configuration. The entire communication graph (the ROS graph) can be viewed with rqt_graph, one of the first debugging tools almost everyone uses when learning ROS2.

Technical details

Parameters

Common ROS2 distributions and their corresponding operating systems — always prefer LTS (Long Term Support) releases for long-running projects:

DistroUbuntuRelease type
Humble Hawksbill22.04LTS (5 years of support)
Iron Irwini22.04Standard (~1.5 years of support)
Jazzy Jalisco24.04LTS (5 years of support)

ROS2 releases every 6 months, with an LTS every 2 years — matching the distribution to your Ubuntu version is the first step toward avoiding confusing installation errors.

Protocol

The actual communication layer underneath ROS2 is DDS (Data Distribution Service) — an industrial publish-subscribe standard from OMG, used for years in aerospace/defense before ROS2 adopted it. ROS2 uses an abstraction called RMW (ROS Middleware interface) to plug different DDS implementations into the same API, rather than implementing DDS itself. Common choices are Fast DDS (the default, from eProsima), Cyclone DDS and RTI Connext. Switching DDS implementations requires only changing RMW_IMPLEMENTATION, without modifying application code.

Practical applications

In an AMR with multiple onboard computers (for example, a Jetson Orin Nano for object recognition and an industrial computer for Nav2/SLAM), ROS2 nodes on different machines automatically discover one another and communicate over the internal Ethernet network through DDS discovery. Developers do not need to write socket code or manually manage network connections, unlike designing separate networking protocols for each data type (images, LiDAR, control commands) without ROS2.

Practical example

# Terminal 1
$ ros2 run demo_nodes_cpp talker
# Terminal 2
$ ros2 run demo_nodes_py listener
Output (Terminal 1 - talker):
[INFO] [talker]: Publishing: 'Hello World: 1'
[INFO] [talker]: Publishing: 'Hello World: 2'

Output (Terminal 2 - listener):
[INFO] [listener]: I heard: [Hello World: 1]
[INFO] [listener]: I heard: [Hello World: 2]

These built-in ROS2 demo nodes run independently and do not know each other at startup, but automatically connect through DDS once both run on the same network. This demonstrates the decentralized model discussed under How it works.

Common mistakes

  • Forgetting to source setup.bash before ROS2 commands — each new terminal needs source /opt/ros/<distro>/setup.bash (and source install/setup.bash for your workspace) before ros2 and your packages work. Otherwise, "command not found" or "package not found" appears despite correct code.
  • ROS_DOMAIN_ID conflicts between robots on the same network — all nodes default to domain ID 0, so two robots on the same Wi-Fi network may accidentally discover each other and receive each other's data. Always give each robot a separate ROS_DOMAIN_ID when operating multiple robots together.
  • Mixing ROS1 and ROS2 concepts/commands — many older online tutorials cover ROS1 (roscore, rosrun, catkin). ROS1 commands do not work in ROS2; always check which version the documentation covers.
  • DDS discovery fails over VPNs/complex routers — default discovery uses multicast, which some networks (especially VPNs or corporate networks blocking multicast) do not allow. Configure a DDS discovery server or unicast for these cases.

Conclusion

ROS2 is middleware, rather than an operating system — its role is to standardize communication between independent robot nodes using decentralized DDS without a central hub. Understanding this avoids the most common beginner confusion. The next article covers Workspaces — organizing source code before building runnable ROS2 packages.

Get new articles and lessons by email

When a new technical article or course module is published, Atlas Robotics sends you a short email. No spam.

Unsubscribe any time with the link in each email. See our Privacy policy.

What is ROS2? A middleware framework for robots — Atlas Robotics