Skip to content

ROS 2: the graph

A robot is a graph of small programs passing messages. Click through an invented robot’s nodes, topics, services and actions, find the quality-of-service settings that silently stop two of them talking, and watch a queue overwrite and a late joiner catch up.

  • Nodes
  • Topics and actions
  • QoS
  • Late joiners

Scroll sideways to see the whole graph.

Node planner

Publishes 1
/cmd_vel
Subscribes to 2
/detections, /tf_static
Serves services 1
/set_speed_limit
Calls services 0
nothing
Serves actions 1
/navigate_to
Sends goals to 0
nothing
IllustrativeFigure 1. An invented robot: five nodes and an operator, four topics, a service and an action. Pick a node or a connection to see what it publishes, subscribes to and serves. The counts are what the tools would list.

Publisher offers

Reliability

Durability

Liveliness

default (unspecified)

Subscription requests

Reliability

Durability

Liveliness

default (unspecified)

Not connectedNo messages pass

Incompatible: reliability

Events raised

Publisher
Offered incompatible QoS
Subscription
Requested incompatible QoS

Both nodes still show in the graph. Only these events say why nothing arrives.

Policy by policy

  • reliabilityno
  • durabilityok
  • deadlineok
  • livelinessok
  • lease durationok

Depth never decides a match. Depth: 5 / 10. The profiles leave liveliness as system default; this figure shows automatic, and uses explicit values only.

Assumes a DDS middlewareFigure 2. A publisher offers and a subscription requests. With a DDS middleware, the default, the pair connects only if every policy is compatible. Zenoh has almost no incompatible settings, so this figure does not describe it.
30 per s
10 per s
5
0.5 s
Late joiner’s durability
PublishedTakenIn the queueLate joiner
startend of the window
  • taken
  • overwritten
  • still queued at the end

In the queue

Published
30
Taken
10
Still queued
5
Overwritten
15

published = taken + queued + overwritten: 30 = 10 + 5 + 15

Late joiner

Late joiner gets earlier messages
0
Then new ones
14
IllustrativeFigure 3. An illustration of keep-last and transient local, not a timing model of any middleware. No message is lost on the wire; a take at the same instant as a publish comes second.

A ROS 2 robot isn’t one program. It’s a handful of small ones with one job each: one reads the camera, one looks for things in the picture, one plans, one drives the wheels. Each is a node, any mix of publisher, subscriber, service client or server, and action client or server, and the network of nodes and their connections is the ROS graph (the robot in the first figure is invented). The graph is the thing you debug.

Nodes talk in three ways: a topic is a stream, a service is a question, an action is a long job. On a topic, any number of publishers and subscribers share a name and the publisher decides when to send. A service is one request, one response, meant to come back quickly; an action takes a goal and gives feedback while it runs. It’s cancellable and ends with a result.

Pick the wrong one and it still works, until it doesn’t. Send a navigation goal as a service and the caller waits, sees no progress on the way and has no cancel. That’s because the docs keep services for quick calls, and say they don’t support cancellation.

An action isn’t a fourth kind of thing: the design article says “an action is made up of three services and two topics”. Send goal, cancel goal and get result are the services, feedback and status the topics, and they’re hidden from the topic and service lists by default. That article is from 2020 and describes the DDS-era implementation, so this is its description, not something I read in the code. The toggle under the first figure shows them.

There’s no broker. With the default DDS middleware, discovery is distributed, with no central server: a node that starts announces itself to the nodes on its domain ID, they answer, and everyone keeps announcing so later arrivals are found (every node is on domain 0 unless you change it). That replaces the ROS 1 master, and the design article’s reason is that nothing central can fail. Which discovery you get depends on the middleware: Fast DDS is the default, and Zenoh, a lighter alternative, discovers through a router by default.

Quality of service is the part that bites. Your camera publishes, your detector subscribes, rqt_graph shows both, and nothing arrives. Every publisher offers a quality of service and every subscription requests one, and with a DDS middleware the pair connects only if no requested policy is more stringent than the offer. When it isn’t, both nodes still show in the graph and the topic still exists, but no messages pass and the only trace is an incompatible-QoS event on each side. That’s the bug I’d lose an afternoon to.

The defaults decide which mismatches you meet. The default profile keeps the last 10 messages and is reliable and volatile; the sensor data profile keeps the last 5 and is best effort. So the classic mismatch is a best-effort camera feeding a subscription that asked for the default: best effort on offer, reliable requested, and they never connect. Turn it round and it’s fine, because a reliable publisher can meet a best-effort request. The second figure checks every policy the docs give a table for.

Two caveats on that figure. Its tables are the DDS model, the default one, and the docs say that in Zenoh there are “essentially no ‘incompatible’ QoS settings”, so a pair that goes silent on one middleware can connect on another. System default leaves the choice to the middleware and the compatibility check can only warn about it, so the figure uses explicit values only. History, depth and lifespan have no compatibility table in the docs, and the figure leaves them out of the match.

Depth and late joiners are the other half. Keep last is a fixed-size queue: once it’s full, the next message pushes out the oldest, and that’s how a slow reader of a fast publisher loses messages without any error. Durability decides what a late subscriber gets, with volatile forgetting and transient local keeping the last few for it. Both sides have to ask for transient local to get the old messages, and a volatile publisher and a transient-local subscription don’t connect at all. The third figure illustrates both ideas, not any middleware’s timing.

The standard example is /tf_static; tf2 keeps a robot’s coordinate frames and works across a distributed system. A static transform only needs publishing once, as with ROS 1 latching. So since Eloquent the static broadcaster and listener use transient local durability, and a node that starts later still receives the transforms, with tf2_ros keeping a depth of 1 on the broadcaster and 100 on the listener. A publisher without it won’t reach the listeners.

Learn the tools that show you the graph first. rqt_graph draws nodes, topics and connections. ros2 topic hz measures a rate on a subscription it creates, so QoS can change what it reports. ros2 bag records topics, services and actions, in MCAP by default since Iron. A launch file starts many nodes with one command and can be written in Python, XML or YAML. A lifecycle node adds four states: unconfigured, inactive, active and finalized. Then there’s ros2 topic info, which gives the publisher and subscription counts and, with --verbose, each endpoint’s QoS. That’s where you can compare the two sides of a silent pair.

As for why DDS: the ROS 2 paper says ROS 1 didn’t prioritise security, network topology or up-time, that those became essential as products appeared, and that ROS 2 was rebuilt on DDS, an open standard, for UDP transport, distributed discovery and a security standard. That’s the authors’ account of their own design. Their adoption claims rest on five case studies, mostly qualitative, and their latency numbers are from one 2021 setup. So I’ve left both out.

This page follows the ROS 2 Lyrical Luth documentation, which I read on the date in the Sources panel. Jazzy has the same values for the default, sensor data, services and parameters profiles.

Exercise

Break it on purpose, then fix it.

  1. Run turtlesim, then write a Python publisher and a subscriber.
  2. Publish with the sensor data profile and subscribe with the default, and watch nothing arrive.
  3. Read ros2 topic info --verbose to see each side’s QoS, and change one of them until messages flow.

Sources

  1. ROS 2: nodes Nodes (ROS 2 Lyrical documentation). ROS 2 Lyrical Luth (LTS), lyrical branch db78924, read from the docs repository; read 2026-12-01.

    • About nodes: any mix of publisher, subscriber, service and action client or server; the ROS graph
    • Discovery: distributed with DDS, no central server; server-client in other setups; the router rmw_zenoh uses by default
    • Discovery note: an incompatible pair does not connect even though both nodes appear in the graph
  2. Macenski et al. 2022 Robot Operating System 2: Design, architecture, and uses in the wild (S. Macenski, T. Foote, B. Gerkey, C. Lalancette, W. Woodall; Science Robotics 7(66), eabm6074). the arXiv version (2211.07752 v1) was read, not the paywalled published one, which may differ in wording; read 2026-12-01.

    • Design Principles: modularity
    • Performance and Reliability: history, keep-last overwrites the oldest; durability, transient local stores for late joiners
    • Introduction; Case Studies; Performance results (arXiv version)
  3. ROS 2: interfaces Interfaces: topics, services, actions (ROS 2 Lyrical documentation). ROS 2 Lyrical Luth (LTS), lyrical branch db78924, read from the docs repository; read 2026-12-01.

    • Summary and the key differences table
    • Key differences: services, cancellation not supported; actions, cancellation supported
  4. ROS 2: topics (concept) Topics (ROS 2 Lyrical documentation). ROS 2 Lyrical Luth (LTS), lyrical branch db78924, read from the docs repository; read 2026-12-01.

    • Publish/subscribe: zero or more of each per topic; anonymous
  5. ROS 2: services Services (ROS 2 Lyrical documentation). ROS 2 Lyrical Luth (LTS), lyrical branch db78924, read from the docs repository; read 2026-12-01.

    • A remote procedure call, expected to return quickly
    • Never for long-running or preemptible processes; use an action
  6. ROS 2: actions Actions (ROS 2 Lyrical documentation). ROS 2 Lyrical Luth (LTS), lyrical branch db78924, read from the docs repository; read 2026-12-01.

    • A long-running remote procedure call with feedback and cancel
  7. ROS 2 design: actions Actions (ROS 2 design article; G. Biggs, J. Perron, S. Loretz; written 2019, last modified 2020). It describes the DDS-era implementation. ros2/design commit 93a415b, read 2026-12-01.

    • Middleware implementation; visibility of action services and topics
  8. ROS 2: domain ID The ROS_DOMAIN_ID (ROS 2 Lyrical documentation). ROS 2 Lyrical Luth (LTS), lyrical branch db78924, read from the docs repository; read 2026-12-01.

    • All nodes use domain 0 by default
  9. ROS 2 design: ROS on DDS ROS on DDS (ROS 2 design article; W. Woodall; written 2014, last modified 2019). ros2/design commit 93a415b, read 2026-12-01.

    • ROS Built on DDS, Discovery: replaces the master, no central point of failure
  10. ROS 2: middleware vendors Different middleware vendors (ROS 2 Lyrical documentation). ROS 2 Lyrical Luth (LTS), lyrical branch db78924, read from the docs repository; read 2026-12-01.

    • Supported RMW implementations: Fast DDS is the default RMW
    • Zenoh middleware: essentially no incompatible QoS settings
  11. ROS 2: QoS settings Quality of Service settings (ROS 2 Lyrical documentation). ROS 2 Lyrical Luth (LTS), lyrical branch db78924, read from the docs repository; read 2026-12-01.

    • QoS compatibilities and QoS events: a “Request vs Offered” model, no connection, offered and requested incompatible QoS
    • QoS profiles; reliability and durability compatibility tables
    • History, depth and lifespan have no compatibility table
    • Durability table; a latched topic needs transient local on both sides
  12. OMG DDS 1.4 Data Distribution Service (DDS), version 1.4, formal/15-04-10 (Object Management Group, 2015). PDF text extracted by script; section numbers as extracted; read 2026-12-01.

    • 2.2.3 Supported QoS: requested/offered; incompatible endpoints record the two events
  13. rmw: QoS profiles rmw/include/rmw/qos_profiles.h (ros2/rmw, Apache-2.0). lyrical branch a63c727, read 2026-12-01.

    • The default and sensor data profiles: history, depth, reliability, durability
    • rmw_qos_profile_check_compatible: system default or unknown gives a warning
    • Jazzy branch: identical default, sensor data, services and parameters profiles
  14. ROS 2: Eloquent release notes Eloquent Elusor release notes (ROS 2 documentation). ROS 2 Lyrical Luth (LTS), lyrical branch db78924, read from the docs repository; read 2026-12-01.

    • Static transform broadcasters and listeners use transient_local on /tf_static
  15. tf2_ros: qos.hpp tf2_ros/include/tf2_ros/qos.hpp (ros2/geometry2, BSD-3-Clause). lyrical branch c8b8b21, read 2026-12-01.

    • StaticBroadcasterQoS depth 1; StaticListenerQoS depth 100; both transient local
  16. ROS 2: tf2 (concept) Tf2 (ROS 2 Lyrical documentation). ROS 2 Lyrical Luth (LTS), lyrical branch db78924, read from the docs repository; read 2026-12-01.

    • Properties of tf2: a distributed system, every component can see the frame information
  17. ROS 2: topics Learning about topics, tutorial (ROS 2 Lyrical documentation). lyrical branch df1973e, read from the docs repository; page opened in a browser 2026-10-22.

    • rqt_graph; topic info and --verbose; topic hz and the QoS caveat
    • topic info --verbose shows each endpoint’s QoS
  18. ROS 2: bags Recording and playing back data, tutorial (ROS 2 Lyrical documentation). ROS 2 Lyrical Luth (LTS), lyrical branch db78924, read from the docs repository; read 2026-12-01.

    • ros2 bag record; default storage format MCAP
  19. ROS 2: Iron release notes Iron Irwini release notes (ROS 2 documentation). ROS 2 Lyrical Luth (LTS), lyrical branch db78924, read from the docs repository; read 2026-12-01.

    • rosbag2: default bag file type changed to mcap
  20. ROS 2: launch Launch (ROS 2 Lyrical documentation). ROS 2 Lyrical Luth (LTS), lyrical branch db78924, read from the docs repository; read 2026-12-01.

    • Launch files can be XML, YAML or Python
  21. ROS 2 design: managed nodes Managed nodes (ROS 2 design article; G. Biggs, T. Foote; written 2015, last modified 2021). ros2/design commit 93a415b, read 2026-12-01.

    • Life cycle: four primary states
  22. ROS 2: turtlesim Setting up Turtlesim, how-to (ROS 2 Lyrical documentation). lyrical branch df1973e, read from the docs repository; page opened in a browser 2026-10-22.

    • Setting up Turtlesim

Everything here is paraphrased from the sources, not quoted, and every figure is attributed to one. Prices are as of the date read and change. Anything illustrative is labelled as such. Where a source is silent, or could not be checked, the page leaves the fact out.