ProjekinAja. Robotics Stage 1 · Foundations Lesson 1.4
● Stage 1 · Lesson 1.4

ROS 2 Architecture: Nodes, Topics, Services, and Actions

ROS 2 is a distributed operating system for robots — misunderstand its communication semantics and your robot silently drops the data it needs most.

⏱ ~22 min read 🧠 Architecture ⚙ ROS 2 Humble

🎯 By the end you'll understand

Why DDS is ROS 2's foundation and what that buys you architecturally. The three communication primitives — topics, services, actions — and precisely when to use each one. QoS policies and why BEST_EFFORT vs. RELIABLE is not a stylistic choice but a semantic contract that silently breaks communication when mismatched. The computation graph as the correct mental model for FollowBot's software. And the specific failure mode where a publisher and subscriber connect without error but zero data flows — the most dangerous misconfiguration in production robotics.

KEY INSIGHTA robot is a computation graph, not a program

A monolithic robot program that does everything in sequence is easy to write and impossible to maintain, tune, or debug. The computation graph is the answer — and QoS is the contract that makes it either robust or fragile.

When people start with ROS 2 they think in programs: "the LIDAR node," "the navigation node," as if there is a main function somewhere. That mental model breaks the moment you try to understand why your robot stopped receiving sensor data without any error message. The correct mental model is a computation graph: a directed graph of processes (nodes) connected by typed, named channels (topics), with synchronous callout mechanisms (services) and long-running task protocols (actions) layered on top. Every data flow has an explicit source node, an explicit destination node, and an explicit quality contract. There are no implicit dependencies, no shared memory, no global state. When data stops flowing, you ask: "which edge in the graph failed, and why?" That question is always answerable — but only if you understand the communication semantics.

🔑 Hold onto this

The single most productive mental shift when learning ROS 2 is from "I am writing a robot program" to "I am building a graph." Each node is a vertex. Each topic, service, or action connection is an edge with a type signature and a QoS contract. Debugging a ROS 2 system means reading the graph — ros2 node list, ros2 topic info, ros2 topic echo — not reading log files. The graph is the ground truth. The logs are symptoms.

CORE CONCEPTDDS: the substrate underneath everything

ROS 2 is not a communication system. It is an API layer on top of one. The communication system is DDS — Data Distribution Service — a specification maintained by the Object Management Group, with several open-source implementations (eProsima Fast DDS is the default; Cyclone DDS and RTI Connext are common alternatives). Understanding DDS is not optional for production robotics; it is the layer where most mysterious failures live.

DDS operates on a publish/subscribe data-centric model with automatic discovery. When a ROS 2 node starts, it broadcasts its existence over the network using a discovery protocol (SPDP — Simple Participant Discovery Protocol). Every other DDS participant on the same network hears the announcement and can immediately match its publishers and subscribers by topic name and type. No broker, no nameserver, no registration step. This is why adding a second robot to a ROS 2 network requires no configuration: they find each other automatically.

DDS domain (domain_id = 0 by default) Participant A lidar_driver node (Robot) Publisher /scan [LaserScan] Subscriber /cmd_vel [Twist] Participant B slam_node (Laptop) Subscriber /scan [LaserScan] Publisher /cmd_vel [Twist] SPDP discovery (multicast) /scan data (peer-to-peer UDP) /cmd_vel data (peer-to-peer UDP) No broker · No nameserver · ROS_DOMAIN_ID isolates robot fleets on same network
DDS discovery is automatic and broker-free. Participants announce themselves via multicast SPDP; data flows peer-to-peer over UDP. Two nodes on different machines connect without any configuration — as long as their QoS policies match.

The practical implication: if you have two robots on the same Wi-Fi network with the same ROS_DOMAIN_ID, they will talk to each other's topics automatically. This is not a feature to enable; it is behavior you must actively prevent in multi-robot labs using domain isolation (ROS_DOMAIN_ID=<unique int>) or DDS partitions.

💡 Fast DDS vs. Cyclone DDS: not interchangeable

ROS 2 Humble defaults to eProsima Fast DDS. Cyclone DDS has a reputation for better out-of-the-box performance on Wi-Fi (less chatty multicast discovery). The two are interoperable but their default QoS settings differ — a system built and tested with one DDS implementation may behave differently under the other. This matters for FollowBot if you ever run it in a multi-machine configuration. Set RMW_IMPLEMENTATION=rmw_cyclonedds_cpp to switch; document which implementation your system was tuned against.

HOW IT WORKSThree communication primitives — and when each one is wrong

ROS 2 provides three communication mechanisms. They are not interchangeable. Choosing the wrong one is not a performance issue; it is an architectural error that causes either data loss, deadlocks, or action-completion signals that never arrive. The rule of thumb is: if you are wrong about which one to use, your system will fail in a way that looks unrelated to the communication choice.

1

Topics — asynchronous publish/subscribe streams

A topic is a named channel with a message type. Any number of publishers can publish to it; any number of subscribers can receive from it. The publisher does not know whether anyone is listening. The subscriber does not know whether the publisher is running. This decoupling is the entire point: it lets you compose a system of independent processes.

Use topics for: continuous sensor streams (LIDAR scans, camera frames, IMU readings, odometry), state estimates that change at a fixed rate, transform broadcasts (/tf, /tf_static), anything where the latest value is what matters and dropped messages are acceptable (or handled by QoS).

Do not use topics for: operations that must complete before the caller continues, requests where the caller needs a confirmed reply, or long-running tasks where progress feedback matters. Those are services and actions.

scan_pub.pyrclpy · publisher
import rclpy
from rclpy.node import Node
from sensor_msgs.msg import LaserScan

class ScanPublisher(Node):
    def __init__(self):
        super().__init__('lidar_driver')
        # QoS depth=10: buffer 10 messages; oldest dropped if full
        self.pub = self.create_publisher(LaserScan, '/scan', 10)
        self.create_timer(0.1, self.publish_scan)  # 10 Hz

    def publish_scan(self):
        msg = LaserScan()
        msg.header.stamp = self.get_clock().now().to_msg()
        msg.header.frame_id = 'laser'
        # ... populate ranges, angle_min, etc.
        self.pub.publish(msg)
2

Services — synchronous request/reply

A service is a named RPC call: the client sends a request message and blocks (or registers a callback) until the server returns a response. Unlike topics, every call is paired: one request, one reply. The client knows the call completed (or timed out).

Use services for: one-time configuration calls (set a parameter, load a map, reset a filter), mode switches (enable/disable obstacle avoidance), queries that need a definitive answer before the caller continues (does a plan exist to this goal?). FollowBot uses a service to load the initial costmap from a YAML file at startup.

Do not use services for: operations that take longer than a few hundred milliseconds. A service call blocks the caller's executor thread for its duration. A map-building operation that takes 30 seconds is not a service — it is an action. Services that can take arbitrarily long are a common cause of executor deadlocks in ROS 2.

map_loader.pyrclpy · service client
from nav2_msgs.srv import LoadMap
from rclpy.node import Node
import rclpy

class MapRequester(Node):
    def __init__(self):
        super().__init__('map_requester')
        self.cli = self.create_client(LoadMap, '/map_server/load_map')
        self.cli.wait_for_service(timeout_sec=5.0)  # blocks
        req = LoadMap.Request()
        req.map_url = 'file:///maps/lab.yaml'
        # async call — avoids blocking executor thread
        future = self.cli.call_async(req)
        future.add_done_callback(self.on_map_loaded)

    def on_map_loaded(self, future):
        result = future.result()
        self.get_logger().info(f'Map loaded: result={result.result}')
3

Actions — long-running goal/feedback/result

An action is a three-phase protocol: the client sends a goal, the server publishes periodic feedback while executing, and the server sends a result when complete. At any point the client can cancel the goal. Internally, actions are implemented on top of topics and services — but they provide preemption, progress visibility, and lifecycle management that topics and services alone cannot.

Use actions for: navigation goals (drive to waypoint), arm motions (move arm to grasp pose), any computation that takes seconds and where the caller needs progress updates and the ability to cancel. FollowBot's navigation goal (send the robot to a docking station) is an action. So is any manipulation task with the 6-DOF arm.

The distinction that trips everyone up: an action result is not guaranteed even if the action server is running. If the goal is cancelled, rejected, or aborted, the result message carries a status code — not data. Always check the action status before using the result.

nav_action.pyrclpy · action client
from nav2_msgs.action import NavigateToPose
from rclpy.action import ActionClient
from rclpy.node import Node

class NavClient(Node):
    def __init__(self):
        super().__init__('nav_client')
        self._ac = ActionClient(self, NavigateToPose, '/navigate_to_pose')

    def send_goal(self, pose):
        self._ac.wait_for_server()
        goal_msg = NavigateToPose.Goal()
        goal_msg.pose = pose
        # send_goal_async returns a future; result arrives via callback
        self._ac.send_goal_async(
            goal_msg,
            feedback_callback=self.on_feedback
        ).add_done_callback(self.on_goal_response)

    def on_feedback(self, fb):
        d = fb.feedback.distance_remaining
        self.get_logger().info(f'Remaining: {d:.2f} m')

    def on_goal_response(self, future):
        handle = future.result()
                if not handle.accepted:
            self.get_logger().warn('Goal rejected!')
            return  # result will never arrive — always check!
        handle.get_result_async().add_done_callback(self.on_result)
Primitive Pattern Caller blocks? Progress? Cancellable? FollowBot use
Topicpub/sub (N:M)NoN/A (stream)No/scan, /odom, /tf, /cmd_vel
Servicereq/reply (1:1)Yes (if sync)NoNoload_map, reset_ekf, set_mode
Actiongoal/feedback/resultNo (async)YesYesnavigate_to_pose, arm_move

CORE CONCEPTQoS: the silent contract between publisher and subscriber

QoS — Quality of Service — is the layer of the DDS specification that determines how data is delivered. In ROS 2, every publisher and every subscriber has a QoS profile. The DDS layer matches publishers to subscribers only if their QoS profiles are compatible. An incompatible match is silent: no error, no warning in the log, no exception. The publisher publishes, the subscriber subscribes, and zero messages flow. This is the defining silent failure of ROS 2 development.

The most important QoS policies for FollowBot are:

Policy RELIABLE BEST_EFFORT When incompatible
Reliability DDS retransmits dropped messages. Guaranteed delivery. Higher latency. Fire-and-forget. No retransmit. Lower latency. Drops silently. RELIABLE publisher + BEST_EFFORT subscriber: OK (downgraded). BEST_EFFORT publisher + RELIABLE subscriber: zero messages flow.
Durability TRANSIENT_LOCAL: late-joining subscriber receives last N messages. VOLATILE: subscriber only receives messages published after it joins. TRANSIENT_LOCAL publisher + VOLATILE subscriber: OK. VOLATILE publisher + TRANSIENT_LOCAL subscriber: zero messages flow (and no error).
History KEEP_ALL: buffer everything (memory risk). KEEP_LAST(N): buffer the last N messages. Always compatible; affects queue depth behavior.
Deadline Publisher must publish within deadline. Subscriber notified if not. No deadline enforcement. Compatible. Subscriber deadline must be ≥ publisher deadline.
⚠ BEST_EFFORT vs. RELIABLE is not a style choice

A common beginner mistake: "use RELIABLE for safety, BEST_EFFORT for performance." The actual decision is about data semantics. A LIDAR scan arriving 5 ms late is useless for real-time obstacle avoidance — use BEST_EFFORT and drop late packets. A map update that must reach the costmap server exactly once — use RELIABLE with TRANSIENT_LOCAL durability. Choosing RELIABLE for a 30 Hz sensor stream causes the DDS layer to buffer and retransmit, building a queue of stale sensor data that your estimator processes in sequence, introducing artificial latency. The robot is perfectly safe and completely wrong about where it is.

The compatibility rule for Reliability is asymmetric and counterintuitive: a subscriber requesting RELIABLE can only receive from a publisher offering RELIABLE. A publisher offering only BEST_EFFORT cannot satisfy a RELIABLE subscriber — and the DDS layer will silently refuse to match them. Diagnosing this requires running ros2 topic info --verbose /scan and comparing the QoS profiles of the publisher and subscriber side by side.

qos_mismatch.pybash · diagnosis
# Check QoS profiles on both sides of a topic
$ ros2 topic info --verbose /scan

# Publisher QoS profile:
#   Reliability: BEST_EFFORT   <-- fire-and-forget
#   Durability: VOLATILE
#   History (Depth): KEEP_LAST (10)

# Subscription QoS profile:
#   Reliability: RELIABLE      <-- requires guaranteed delivery
#   Durability: VOLATILE
# !
# Publisher count: 1  Subscription count: 1  -- they "connected"
# But zero messages flow: incompatible reliability policies
#
# Fix: align both sides — typically set subscriber to BEST_EFFORT
# for sensor streams and RELIABLE for commands/maps.

SEE ITNode graph builder: connect nodes, set QoS, simulate packet loss

Build FollowBot's computation graph from the nodes below. Choose which nodes to connect, which communication primitive to use, and which QoS profile to assign each connection. Then simulate packet loss and watch how incompatible QoS choices cause message delivery to collapse — or how correct choices absorb the loss gracefully. The goal is to find the combination where the LIDAR data reaches the EKF with minimal queue backpressure under 20% packet loss.

⚙ Interactive · ROS 2 Node Graph Builder & QoS Simulator

Step 1: select a publisher node. Step 2: select a subscriber node. Step 3: choose link type and QoS. Step 4: run the simulation.

PUB node:
SUB node:
Link type:
Publisher QoS:
Subscriber QoS:

Select a publisher node, a subscriber node, choose link type and QoS, then add the link.

The critical insight the simulation reveals: BEST_EFFORT + BEST_EFFORT under 20% packet loss delivers ~80% of messages with no queue backpressure — appropriate for a 10 Hz LIDAR stream where the latest scan is all that matters. BEST_EFFORT publisher + RELIABLE subscriber delivers 0% of messages — a silent failure indistinguishable from "the publisher isn't running." RELIABLE + RELIABLE delivers 100% of messages but builds a retransmission queue; under high loss (40%+), the queue grows and messages arrive with increasing latency — the EKF processes scans from 500 ms ago while the robot is still moving. Each scenario teaches a concrete cost, not an abstract rule.

FOLLOWBOTFollowBot's full computation graph

With the three communication primitives and QoS understood, we can define FollowBot's complete computation graph — the architecture that makes the Stage 1 milestone concrete. This is not a hand-wavy diagram; every node here is a real ROS 2 process with a real topic, a real QoS profile, and a specific reason for the choices made.

Legend Topic (pub/sub) Service (req/reply) Action (goal/fb/result) SENSORS lidar_driver /scan · 10 Hz · BE camera_driver /image_raw · 30 Hz · BE imu_driver /imu · 200 Hz · BE wheel_odom /odom · 50 Hz · REL ESTIMATION ekf_localization /robot_pose · REL · fuses odom+IMU person_tracker /tracked_person · REL · LIDAR+YOLO costmap_server /costmap · TRANSIENT_LOCAL · 5 Hz tf2_broadcaster /tf · /tf_static · REL · TRANSIENT_LOCAL PLANNING behavior_tree follow/stop/recover/dock dwa_planner /cmd_vel_raw · 10 Hz · BE safety_filter /cmd_vel · gates motor output motor_controller cmd_vel → PWM · 100 Hz map_server /load_map (service) · TRANSIENT_LOCAL navigate_to_pose (action) → behavior_tree BE = BEST_EFFORT · REL = RELIABLE · TRANSIENT_LOCAL = late-join durability All nodes communicate via DDS · ROS_DOMAIN_ID=0 (single robot)
FollowBot's full ROS 2 computation graph. Sensor topics use BEST_EFFORT (sensor data ages instantly; retransmission wastes time). Odometry and pose use RELIABLE (the EKF needs all ticks). The /tf and costmap topics use TRANSIENT_LOCAL durability (late-joining nodes get the last transform and map immediately). The navigation goal uses an action (long-running, cancellable). The map loader uses a service (fast, one-shot, must complete before navigation starts).

The rationale behind each QoS choice is not aesthetic. LIDAR and camera use BEST_EFFORT because retransmitting a 50 ms old scan costs more latency than the dropped scan costs accuracy. Odometry uses RELIABLE because a missed encoder tick introduces an uncorrectable position error — the error accumulates. The costmap uses TRANSIENT_LOCAL because when the EKF node restarts after a crash, it must immediately receive the current costmap rather than waiting for the next costmap publication cycle. These are the kinds of design decisions that appear in the architecture review, not in a late-night debug session.

followbot_qos.pyrclpy · QoS profiles for FollowBot nodes
from rclpy.qos import QoSProfile, ReliabilityPolicy, DurabilityPolicy, HistoryPolicy

# For sensor streams: BEST_EFFORT, volatile, keep last 1
SENSOR_QOS = QoSProfile(
    reliability=ReliabilityPolicy.BEST_EFFORT,
    durability=DurabilityPolicy.VOLATILE,
    history=HistoryPolicy.KEEP_LAST,
    depth=1   # always process the latest scan only
)

# For odometry: RELIABLE (no missed ticks), volatile (history not needed)
ODOM_QOS = QoSProfile(
    reliability=ReliabilityPolicy.RELIABLE,
    durability=DurabilityPolicy.VOLATILE,
    history=HistoryPolicy.KEEP_LAST,
    depth=10
)

# For costmap and /tf_static: TRANSIENT_LOCAL (late-join gets last value)
LATCHED_QOS = QoSProfile(
    reliability=ReliabilityPolicy.RELIABLE,
    durability=DurabilityPolicy.TRANSIENT_LOCAL,
    history=HistoryPolicy.KEEP_LAST,
    depth=1
)

# Usage example:
self.scan_sub = self.create_subscription(
    LaserScan, '/scan', self.on_scan, SENSOR_QOS
)  # must match the lidar_driver publisher's QoS
🔑 Stage 1 milestone: what "first ROS 2 node running" means

The Stage 1 milestone is not "write any ROS 2 node." It is: the URDF is loaded, the TF tree (map → odom → base_link → laser → camera) is publishing, the simulated sensor topics (/scan, /imu, /odom, /image_raw) are flowing at their correct rates with correct QoS profiles, and a custom node subscribes to /scan and publishes a /person_bearing estimate using a simple LIDAR cluster heuristic. That is the minimum viable computation graph. Every node in the full diagram above either already exists (drivers, TF broadcaster) or will be built in subsequent lessons.

WEAKNESSWhere ROS 2 communication bites

✗ QoS incompatibility is a silent failure — not an error

This is worth saying three times. When a BEST_EFFORT publisher and a RELIABLE subscriber are matched on the same topic, ROS 2 does not log an error. The ros2 topic info command shows publisher count: 1 and subscription count: 1. The subscriber callback never fires. If you discover this at 2 AM before a demo, you will spend an hour staring at the lidar_driver node wondering why it has stopped publishing — but it has not. The message is being dropped at the DDS layer because of an invisible contract violation. Diagnosis: always run ros2 topic info --verbose /topic_name and compare QoS profiles when a topic goes dead with no crash.

✗ Using synchronous service calls inside a subscriber callback

ROS 2's single-threaded executor processes one callback at a time. If your subscriber callback makes a synchronous service call (client.call(req)), it blocks the executor thread waiting for the service response. But the service response is also a callback — which cannot execute because the executor is blocked. This is a deadlock. It is not rare; it is a design error that many ROS 2 newcomers make in their first week. The fix is either to use call_async() everywhere or to use a MultiThreadedExecutor with a reentrant callback group. The ROS 2 documentation describes both patterns; the default executor is single-threaded and will silently deadlock if you block it.

✗ Confusing "node connected" with "data flowing"

DDS discovery is fast — typically under 100 ms. A subscriber will show as "connected" (publisher count > 0) as soon as the publisher node starts. But "connected" means "their QoS profiles were evaluated and a match was established." It does not mean messages are flowing. The correct validation is: subscribe to the topic with ros2 topic echo /topic_name and observe actual messages. In a QoS incompatibility scenario, ros2 topic echo will show nothing, while ros2 topic info will show a subscriber. This asymmetry is the most confusing aspect of ROS 2 debugging for engineers coming from ROS 1.

KEY INSIGHTHow this connects

  • What Is a Robot? The Sense-Think-Act Loop (1.1) — the computation graph is the software implementation of the sense-think-act loop. Every logical node (Sense, Estimate, Plan, Act) maps to one or more ROS 2 nodes connected by the communication primitives introduced here. The failure modes from 1.1 now have software addresses: a QoS mismatch on /scan is a Sense failure; a service deadlock in the EKF is an Estimate failure.
  • TF2: The Transform Tree at Runtime (1.5) — /tf and /tf_static are topics with RELIABLE + TRANSIENT_LOCAL QoS profiles. Understanding why those specific QoS settings are necessary — and what happens when they are wrong — requires exactly the QoS model built here.

The computation graph mental model introduced here is the load-bearing abstraction for the rest of Stage 1 and all of Stage 5 (Perception SLAM). When you build the SLAM node in Lesson 5.3, you will wire it into the same graph: subscribing to /scan and /odom, publishing /map and a corrected /tf, receiving a localization service call at startup. The graph scales; the QoS rules do not change. Learning them here prevents systematic mistakes throughout the course.

GLOSSARYKey terms introduced

Computation graph
The directed graph of ROS 2 nodes (vertices) connected by topics, services, and actions (edges). The correct mental model for a ROS 2 system — more useful than "the running program" because it makes data flows, type contracts, and QoS policies explicit and debuggable.
DDS (Data Distribution Service)
The OMG-standard publish/subscribe middleware underlying ROS 2. Provides automatic peer discovery (no broker), typed data channels, and the QoS policy layer. eProsima Fast DDS is the ROS 2 Humble default implementation.
Topic
A named, typed publish/subscribe channel in ROS 2. N publishers, M subscribers. Asynchronous: publisher does not know if anyone is listening. Used for continuous data streams (sensor readings, transforms, velocity commands).
Service
A synchronous request/reply call in ROS 2. One client, one server per call. The client receives exactly one reply per request. Used for fast, discrete operations (load map, reset filter). Blocking the executor thread with a synchronous service call inside a callback causes a deadlock.
Action
A long-running task protocol in ROS 2 with three phases: goal (client sends target), feedback (server publishes progress at intervals), result (server sends final outcome). Supports preemption (cancel). Used for navigation goals, arm motions, any task taking seconds.
QoS (Quality of Service)
A DDS policy layer governing how messages are delivered. Key policies: Reliability (RELIABLE vs. BEST_EFFORT), Durability (VOLATILE vs. TRANSIENT_LOCAL), History (KEEP_LAST(N) vs. KEEP_ALL). Incompatible QoS between publisher and subscriber results in zero messages flowing — without any error or warning.
TRANSIENT_LOCAL durability
A DDS QoS durability policy in which the publisher retains the last N messages so that late-joining subscribers receive them immediately upon connecting. Used for /tf_static, costmaps, and any "set once, read many times" data. Incompatible with VOLATILE on the subscriber side (no data flows).
ROS_DOMAIN_ID
An integer (0–232) that partitions DDS traffic into isolated namespaces. Nodes with different domain IDs cannot discover each other, even on the same network. Used to prevent cross-talk between multiple robots or ROS 2 instances on a shared network.

ACTIVE RECALLCheck your understanding

Answer in your own words first, then reveal.

1A subscriber is running and ros2 topic info /scan shows publisher count: 1 and subscription count: 1. But no messages arrive. What is the most likely cause and how do you confirm it?›

The most likely cause is a QoS incompatibility between the publisher and subscriber — specifically, the publisher offers BEST_EFFORT reliability and the subscriber requires RELIABLE. DDS silently refuses to match them. Confirmation: run ros2 topic info --verbose /scan and compare the QoS profiles printed for the publisher side and the subscription side. If the Reliability field differs (BEST_EFFORT on publisher, RELIABLE on subscriber), that is the failure. Fix: align both sides — typically set the subscriber to BEST_EFFORT for sensor streams, since sensor data ages instantly and retransmission only adds stale-data latency.

2You need to send FollowBot to a docking station 15 m away. This takes 30–90 seconds depending on obstacles. Should you use a topic, service, or action? Why does the wrong choice fail?›

Use an action. A topic cannot represent a goal with a confirmed result — you publish the goal and never know if it was reached. A service would block the calling executor thread for up to 90 seconds, preventing any other callback (including sensor callbacks) from running — a deadlock or total system freeze. An action provides the three-phase protocol: the client sends the navigation goal, receives periodic feedback (distance remaining), and receives a final result (success, aborted, cancelled). The client can also cancel the goal if the person leaves before docking completes. This is exactly the design of Nav2's NavigateToPose action.

3Why does the /tf_static topic use TRANSIENT_LOCAL durability? What goes wrong if you publish it with VOLATILE?›

/tf_static carries constant transforms that do not change during a robot's lifetime (e.g., the offset from base_link to the laser frame). These transforms are published once. Any node that starts after that single publication — including nodes that crash and restart — would never receive the transform if VOLATILE durability were used, because VOLATILE subscribers only receive messages published after they join. With TRANSIENT_LOCAL, the DDS layer retains the last transform and delivers it immediately to any late-joining subscriber. A node using VOLATILE for /tf_static will fail to look up the laser frame transform, causing all sensor data to be rejected by TF2 — the robot effectively goes blind, with an error message like "Could not transform laser to base_link: extrapolation into the past."

4What happens if you make a synchronous service call (client.call(req)) inside a subscriber callback using the default single-threaded executor? Why, and what is the fix?›

The system deadlocks. The single-threaded executor processes one callback at a time. When your subscriber callback calls client.call(req) synchronously, it blocks the executor thread, waiting for a service response. The service response arrives as a callback — but the executor is busy waiting for it inside the subscriber callback. Neither can proceed. The system hangs silently. Two correct approaches: (1) use client.call_async(req) with an add_done_callback() to handle the response without blocking the executor; (2) use MultiThreadedExecutor with a ReentrantCallbackGroup assigned to the client so the response can be processed on a different thread. Option 1 is simpler and the recommended default in ROS 2 Humble.

Next: TF2 — every transform in FollowBot's system lives in a tree →