10Hz Dropped to 7Hz and It Was Not the Algorithm: What Actually Breaks When You Put AI Into ROS 2

10Hz Dropped to 7Hz and It Was Not the Algorithm: What Actually Breaks When You Put AI Into ROS 2

There is a failure mode that has shown up repeatedly over the past year in teams moving models onto robots. In simulation, localization output sits steadily at 10Hz. On the real vehicle it drops to roughly 7Hz. Not a line of code changed. Algorithmic complexity did not change; if anything the model got smaller. The first instinct is almost always “not enough compute,” so people swap boards, add cooling, cut resolution, drop channels. Some of them, two weeks later, discover that putting the original board back and restoring the resolution still gives 7Hz.

Because the missing 3Hz was never compute. It was a contract.

ROS 2 has never been a real-time system, not since the first day of its design. What it promises is “let nodes communicate in a decoupled way,” not “let a given callback finish before a given deadline.” Those two things are architecturally incompatible: decoupling means a publisher does not need to know who its subscribers are, how many there are, or how fast they run. End-to-end timing guarantees require exactly that knowledge. ROS 2 chose the former and pushed responsibility for the latter onto everyone who uses it. That choice is not wrong. The problem is that it is buried deep enough that most teams only hit it in month three, the first time they deploy on hardware.

This article pulls that contract apart. The line runs through four places: double scheduling, time base, parameters as world-model contracts, and data paths. Each has a well-defined failure signature and a well-defined engineering fix, and every fix points at the same conclusion: determinism is not bought by computing faster. It is bought by isolating more thoroughly.


Part One: A Failure That Does Not Report Itself

Start with a real incident.

A team put a 1kHz joint control loop and a 10Hz visual localization node on the same machine, using the default MultiThreadedExecutor. In simulation everything was fine and localization held 10Hz. On hardware, localization fell to around 7Hz with occasional dips lower. Joint control appeared to still run, but trajectory tracking error grew noticeably. The TF tree occasionally emitted extrapolation into the future, and message_filters would inexplicably discard data that was demonstrably fresh.

The worst part: nothing reported an error.

The node did not crash. The topic still published. ros2 topic hz showed data at an unstable rate. The log had nothing but a few TF warnings. The team spent days chasing “did inference get slower,” and only after running ros2 topic delay alongside perf did the real picture emerge: inference time had indeed risen, but only by 12%. What actually ate the time was scheduling — the vision callback was waiting in a dispatch queue, and that wait had gone from under 1ms in simulation to over 40ms on hardware, with enormous variance.

There is a clean mathematical statement of this. Let a callback’s execution time be $C$ and its queueing delay from data arrival to execution start be $W$. End-to-end latency is $L = W + C$. In simulation the machine is idle, load is light, no real hardware interrupts fire, so $W \approx 0$ and $L \approx C$ — what you measure is the algorithm. On hardware, $W$ is decided by a scheduler you never wrote, and it can be 0 or 40ms depending on how many other callbacks are contending for the same thread.

$$\text{In simulation: } L = C \qquad \text{On hardware: } L = W + C,\quad W \sim \text{heavy-tailed}$$

The problem is that most profiling tools measure $C$, while failures happen in $W$. You optimize $C$ from 8ms to 5ms, $W$ grows from 40ms to 45ms, and total latency gets worse. This is why “swap in a smaller model” so often does nothing — you optimized the term that was not the bottleneck.

The code below is a minimal reproduction skeleton. It simulates executor queueing behavior under callback contention and runs a Monte Carlo to produce the distribution of $W$:

import random, statistics

def simulate_executor(callbacks, horizon_ms=1000, trials=2000):
    """callbacks: [(period_ms, exec_ms, jitter_ms)]; returns mean/p99 of wait time W."""
    waits = {i: [] for i in range(len(callbacks))}
    for _ in range(trials):
        now, busy = 0.0, 0.0
        nxt = [c[0] * random.random() for c in callbacks]
        while now < horizon_ms:
            ready = [i for i, t in enumerate(nxt) if t <= now]
            if not ready:
                now = min(nxt); continue
            i = ready[0]                       # polling semantics: first in reg order
            arrive = nxt[i]
            start = max(arrive, busy)          # must wait for previous callback
            waits[i].append(start - arrive)
            busy = start + max(0.1, callbacks[i][1] + random.gauss(0, callbacks[i][2]))
            nxt[i] = arrive + callbacks[i][0]
            now = start
    return {i: {"mean": round(statistics.mean(w), 2),
                "p99": round(sorted(w)[int(len(w) * 0.99)], 2)}
            for i, w in waits.items() if w}

print("sim:", simulate_executor([(100.0, 8.0, 0.5)]))
print("hw: ", simulate_executor([(100.0, 8.0, 2.0), (100.0, 25.0, 8.0), (200.0, 15.0, 5.0)]))

Run it and the picture is immediate: in scenario one the vision callback’s mean wait is near zero. In scenario two, mean wait jumps to the low teens of milliseconds and P99 to tens of milliseconds, while every callback’s exec_ms is unchanged. That is the entire source of 10Hz becoming 7Hz — not any callback getting slower, but callbacks starting to wait on each other.

The first principle follows directly: in ROS 2, a node’s performance metric cannot be its own execution time. It has to be its wait time in the dispatch queue. The former is your code. The latter is other people’s code plus the scheduler’s decision.


Part Two: ROS 2’s Graph Is Best-Effort

To understand why wait time can run away, you have to see what ROS 2 does and does not promise at the architectural level.

The ROS 2 runtime is a graph: nodes are vertices, topics, services and actions are edges. The design goal is composability — you can replace any node, duplicate it, distribute it across machines, without touching other nodes. To achieve that, the middleware (DDS, Zenoh, or a vendor implementation) must abstract away who publishes and who subscribes.

Abstraction has a cost. If you do not know who the subscriber is, you cannot reserve resources for it. If you do not know how many there are, you cannot bound worst-case bandwidth. If publisher and subscriber may be on different machines, you cannot bound transport latency. So ROS 2 specifies a best-effort semantic: QoS exposes reliability (RELIABLE / BEST_EFFORT), history depth, durability, deadline, lifespan and liveliness, and all of these are local constraints. They describe what one endpoint wants, not what the system will do.

┌─────────────────────────────────────────────────────────────┐
│                What ROS 2 Does and Does Not Promise          │
├─────────────────────────────────────────────────────────────┤
│  YES: decoupling, replaceability, distributability, stable API│
│  YES: per-endpoint QoS intent (reliability/depth/deadline)   │
│  NO:  an end-to-end latency upper bound                      │
│  NO:  callback execution order                               │
│  NO:  cross-node time base consistency                       │
│  NO:  fairness under resource contention                     │
└─────────────────────────────────────────────────────────────┘
                            │
                            ▼ the missing parts are yours to build
┌─────────────────────────────────────────────────────────────┐
│  Three things the application layer must establish itself    │
│  1. Executor-to-thread mapping (which core, which priority)  │
│  2. Time base uniqueness (one clock, one sim/real switch)    │
│  3. Cross-node implicit contracts (frames, params, resolution)│
└─────────────────────────────────────────────────────────────┘

This is not a defect. It is the positioning. ROS 2 provides infrastructure for making algorithms run, not for making algorithms run safely. The former is communication and lifecycle management. The latter is scheduling theory and real-time systems engineering. Conflating the two is the root cause of most first-deployment failures.

An architecture survey published in October makes the layering concrete: ros2_control can run at 1kHz precisely because it fully decouples the hard real-time control loop from asynchronous, non-real-time ROS communication. Controller Manager handles lifecycle; JointTrajectoryController, DiffDriveController and friends compute targets; SystemInterface / ActuatorInterface / SensorInterface define the hardware abstraction; drivers bottom out in CANopen, EtherCAT, Serial or SocketCAN; the synchronization points are two virtual functions, read() and write(). The key detail: the control loop does not go through DDS. It goes through in-process function calls plus a shared-memory block. DDS only appears on the non-real-time side.

That design choice deserves repeated scrutiny. It amounts to an admission that at 1kHz, DDS’s abstraction cost is unacceptable, so it gets pushed outside the loop. What you observe inside the loop is not “ROS 2 is fast.” It is “ROS 2 has been moved out.”


Part Three: Double Scheduling, or Why You Raised the Wrong Priority

Now the core section.

In ROS 2’s execution model, a callback must be dispatched twice:

┌──────────────────────────────────────────────────────────────┐
│ Layer 1: middleware executor dispatch                         │
│   rclcpp::Executor pulls ready callbacks from the wait set    │
│   Picks one in registration order (Single) or round-robin     │
│   ↓ no concept of priority here, only ordering                │
├──────────────────────────────────────────────────────────────┤
│ Layer 2: OS scheduler dispatch                                │
│   Linux CFS / SCHED_FIFO / SCHED_RR                           │
│   Decides who gets a CPU from thread policy+priority+affinity  │
│   ↓ no knowledge of which callback is currently running       │
└──────────────────────────────────────────────────────────────┘

The consequence is fatal and simple: scheduling attributes you set at layer two apply to threads, but the object you need to control is the callback. There is no stable mapping between them. MultiThreadedExecutor uses a thread pool, and the same thread runs the vision callback this millisecond and the planning callback the next. Give that thread SCHED_FIFO priority 95 and the planning callback inherits 95 too — it should have had 70.

SingleThreadedExecutor is worse: everything shares one thread, so “raise this callback’s priority” is not merely unimplemented, it is physically inexpressible.

Tier IV’s fix is direct, thorough, and the underlying paper was accepted at RTAS 2025. Their CallbackIsolatedExecutor (CIE) does one thing: it binds each CallbackGroup to an OS thread one-to-one, permanently. A group owns a thread from birth to death. Thread scheduling attributes thereby become callback scheduling attributes. Layer-one dispatch loses nearly all its freedom (one group per thread, nothing to choose), and layer-two attributes become meaningful.

Standard executor:
  Thread pool [T1, T2, T3]
     T1: vision → planning → vision → force control → ...
     T2: point cloud → point cloud → localization → ...
     Attributes apply to T1/T2 as wholes. Granularity = thread.

CIE:
  Thread T1 ←fixed→ CallbackGroup A (vision, 10Hz, SCHED_OTHER, prio 0)
  Thread T2 ←fixed→ CallbackGroup B (force, 1kHz, SCHED_FIFO, prio 95, core 2)
  Thread T3 ←fixed→ CallbackGroup C (planning, 5Hz, SCHED_OTHER, prio 0)
     Granularity = callback. Layer-one dispatch degenerates to identity.

The measured benefit on their robotaxi was roughly a 3 to 5 times improvement in worst-case response time (WCRT). Note WCRT, not average. Averages barely move — they were never the problem. The tail was. This is also why such changes are invisible in simulation: simulation has no tail.

The cost must be stated just as plainly: you give up thread reuse. A standard executor runs N callbacks on a small pool; CIE runs N callbacks on N threads. Thread count rises, memory rises, absolute context-switch count rises (though per-switch determinism improves). This is the classic resource-for-determinism trade. On a robotaxi it pays. On a Raspberry Pi toy car it may simply prevent the system from starting.

Adoption cost is low: replace the Executor, change no application code. A prerun node generates a YAML template, thread_configurator_node loads it. Nearly all major Autoware nodes have adopted CIE. The significance is not that Tier IV shipped an optimization — it is that they demonstrated ROS 2’s default executor is a wrong default for real-time work, and that the default can be replaced without touching application code.


Part Four: The Time Base, the Quietest Break

If double scheduling is the loud failure — jitter, latency, measurable — the time base is the quiet one. It produces no exceptions. It produces wrong results.

use_sim_time is the most misunderstood parameter in ROS 2. Its semantics are “this node takes timestamps from the /clock topic rather than the wall clock.” Sounds harmless. Two paths make it lethal.

Path one: wrong timer type. ROS 2 has two timers, create_wall_timer() and create_timer(). The first always uses wall clock; the second follows the node’s clock source. If your control loop uses create_wall_timer(), then even with use_sim_time:=true the loop runs on real time while every message timestamp is stamped with simulation time. Control frequency and message timestamps now live on two different axes. When RTF (real time factor) deviates from 1.0, that divergence scales linearly. Official documentation lists this as the most common source of sim-to-real timing mismatch — but it is a sentence in the docs, not a compile error.

Path two is subtler. You set use_sim_time:=true, but nothing publishes on /clock — the simulator did not start, the bridge is misconfigured, or you deployed a node that was meant for simulation onto hardware. In that case the node does not error and does not exit. It blocks waiting for the first message on /clock. The symptom: the process is alive, the topic exists (because the publisher was created), and there is no output. ros2 node list shows it. ros2 topic list shows its topics. ros2 topic echo shows nothing.

This violates the principle that failures must be explicit. A missing input should raise an error, not produce a hang. A hang reads as a performance problem, so people investigate performance, for three days.

The code below is a reusable consistency auditor that surfaces these problems at startup:

import rclpy
from rclpy.node import Node
from rclpy.qos import QoSProfile, ReliabilityPolicy
from rosgraph_msgs.msg import Clock

class TimeBaseAuditor(Node):
    """Startup-time base audit: verify the timing contract before work begins."""

    def __init__(self, expect_sim: bool):
        super().__init__("time_base_auditor")
        self.expect_sim = expect_sim
        self.clock_seen = 0
        self.first_sim = None
        self.first_wall = None
        if expect_sim:
            self.create_subscription(
                Clock, "/clock", self._on_clock,
                QoSProfile(depth=1, reliability=ReliabilityPolicy.BEST_EFFORT))

    def _on_clock(self, msg):
        self.clock_seen += 1
        if self.first_sim is None:
            self.first_sim = msg.clock.sec * 10**9 + msg.clock.nanosec
            self.first_wall = self.get_clock().now().nanoseconds

    def audit(self) -> bool:
        ok = True
        # Check 1: sim time declared, but nobody publishes /clock
        if self.expect_sim and self.clock_seen == 0:
            self.get_logger().error(
                "use_sim_time=true but /clock is silent. The node will block "
                "rather than error. Check the simulator or bridge.")
            ok = False
        # Check 2: sim time declared, but RTF deviates from 1.0 badly
        if self.expect_sim and self.clock_seen > 1:
            d_sim = (self.get_clock().now().nanoseconds - self.first_sim) / 1e9
            d_wall = (self.get_clock().now().nanoseconds - self.first_wall) / 1e9
            if d_wall > 0 and not (0.9 <= d_sim / d_wall <= 1.1):
                self.get_logger().warning(
                    "RTF=%.2f off by more than 10%%. TF will emit extrapolation "
                    "into the future; message_filters will drop fresh data." % (d_sim / d_wall))
        return ok

The value here is not cleverness. It is converting three implicit contracts into three explicit assertions. Any contract you can check automatically should not depend on people remembering it. That is the first step in turning timing from folklore into engineering.


Part Five: Parameters Are World-Model Contracts

The third break is more insidious because it disguises itself as tuning.

Nav2 has a set of parameters nearly every team retunes on first deployment, and retuning often makes things worse. Three are representative, each exposing a different class of error.

One: inflation_radius. This defines how far obstacles inflate in the costmap. Simulation defaults tend to be small (obstacles are clean geometry, little margin needed). On hardware it should be robot radius plus 0.1 to 0.2 meters. But the number is not the lethal part — the lethal part is that it must be configured in both global_costmap and local_costmap. Configure only one and you get this: if only global is set, the global planner routes around the inflated zone and looks conservative, while the local controller still sees obstacles at original size and hugs walls. If only local is set, the controller detours conservatively while the global path cuts straight through narrow gaps, and planner and controller fight. The folk description of this is “hitting walls while taking the long way around.”

Why must one parameter agree in two places? Because global and local costmaps are two resolution views of one world model, not two different maps. Global is low-frequency, wide-area, coarse. Local is high-frequency, narrow, fine. Their assumptions must agree; only resolution may differ. The split configuration makes “assumptions agree” the user’s responsibility, and nothing enforces it.

Two: xy_goal_tolerance. 5cm suffices in simulation because localization there is exact. On hardware it needs to loosen to around 0.25m, with stateful set true. The logic is not “hardware is less accurate so loosen it.” It is: tolerance must exceed localization uncertainty, or the controller oscillates at the goal forever. When $\sigma$ is 5cm, a 5cm tolerance means a substantial probability of never arriving; you need roughly 5σ. And stateful=true stops replanning on arrival — otherwise every micro-drift triggers a replan and the planner gets hammered for nothing.

Three: local costmap resolution. 0.1m works in simulation; hardware may need 0.05m. A 0.1m cell will judge a 0.35m-wide corridor impassable, because after discretization plus inflation the passage closes. Dropping to 0.05m fixes it, but cell count grows quadratically — 4x from 0.1 to 0.05. And now you are back in Part One: load rises, wait time rises, frequency falls.

These three chain to one conclusion: Nav2 parameters are not configuration options. They are a set of assumptions about the world. The assumptions are spread across dozens of YAML fields, in different files, with no consistency check, no unit annotation, no physical meaning documented. A team typically needs two or three projects to get them right, and every failure before that gets misdiagnosed as “the algorithm is bad.”

Someone once put it harshly and accurately: Nav2’s costmap cascade looks ugly because reality itself is ugly. Reflective floors, shrink-wrap film, forklifts that do not signal. Those are not simulator defects; they are the definition of the deployment site. So the question is not whether Nav2 can handle the real world — it is that Nav2 exposes the real world’s complexity at the parameter layer, with no abstraction to accompany the exposure.


Part Six: Check Metadata, Not Payload

The fourth break is in the data path, and it has one genuinely elegant fix worth isolating.

The scenario: you need to know whether a sensor has timed out. The intuitive approach is to subscribe to the topic and read the timestamp on arrival. The problem is that subscribing implies deserialization. ROS 2 defaults to CDR encoding, a point cloud message can be tens of megabytes, deserialization cost scales with message size, and it degrades badly under load.

There is measured data that quantifies the degradation: on the conventional subscription path, P99 deserialization cost rose from 2066 microseconds to 5696 microseconds as load increased — nearly 2.8x. Note that is P99. The tail is more sensitive than the mean, because the tail is precisely when the system is busiest.

The fix is partial CDR parsing: parse only the first 12 bytes at a fixed offset (4-byte encapsulation header + 4-byte seconds + 4-byte nanoseconds). That yields the timestamp. The payload is never touched. Cost is essentially independent of message size and system load, because reading 12 bytes is constant time.

Conventional subscription:
  DDS recv → deserialize entire CDR (O(n), n = message bytes) → read header.stamp
  Cost: degrades with load, P99 2066μs → 5696μs

Partial CDR parse:
  DDS recv → read first 12 bytes (O(1)) → read header.stamp → drop buffer
  Cost: constant, independent of load and message size

Behind the optimization sits a general architectural principle that matters more than the optimization:

To decide whether something is present and fresh, you only need metadata. To decide whether it is correct, you need the payload.

Push that principle and you find violations everywhere. Health checks deserializing whole messages. Monitoring systems parsing full payloads to read one status code. Log pipelines serializing every field to count rows. Each violation turns an O(1) decision into an O(n) operation, and that O(n) becomes the bottleneck exactly when the system is busiest.

The same principle, taken in another direction, is zero-copy. NVIDIA contributed a standard data-handling interface called rosidl::Buffer upstream through OSRA (the Open Source Robotics Alliance), letting ROS 2 nodes exchange GPU-resident data with zero copy where conditions permit, with CUDA providing a sample backend. The problem it addresses: on the conventional path, a GPU result must be copied back to CPU memory, serialized, sent over DDS, deserialized on the far side, and copied back to the GPU. Four copies and two serializations, all pure overhead.

rosidl::Buffer deserves specific praise for one design decision: it separates interface from backend. The interface is hardware-neutral; CUDA is merely one backend. An implementation not running on NVIDIA hardware can supply its own backend with no change to upper layers. That is the only sustainable resolution to the tension between “NVIDIA wants to optimize Jetson” and “ROS must stay hardware-agnostic.”

But the boundary must be stated clearly: zero-copy solves throughput, not determinism. It removes copy terms from $C$, letting the same compute handle more data. It does not shrink $W$ and it does not bound latency. If your problem is worst-case response time, zero-copy will not help. If your problem is “this 4K stream will not keep up,” zero-copy is the right medicine.


Part Seven: Inference Latency Is a Tail, Not a Mean

Bring AI in and the problem changes shape.

The latency distribution of model inference and the latency requirement of a control loop are mathematically different objects. A control loop needs a bounded worst case: 1kHz means once per millisecond, miss once and you have one failure, miss ten times and you have ten failures, and the mean is irrelevant. Model inference delivers a mean plus a very long tail: P50 might be 20ms, P99 80ms, P99.9 300ms — batching, memory contention, GPU clock scaling, and competing processes can each make one inference suddenly slow.

$$ \text{Control loop needs: } \sup_t L_t \le T_{\text{period}} \qquad \text{Inference offers: } \mathbb{E}[L] = 20\text{ms},\ \text{P99} = 80\text{ms} $$

Put together, there are exactly three architectural options:

┌────────────────────────────────────────────────────────────────┐
│ Option A: model in the loop                                     │
│   perception → inference → control command → actuator           │
│   Works when: loop Hz ≤ 1 / inference P99 (e.g. 10Hz vs 80ms)   │
│   Risk: the P99.9 300ms spike drops 3 cycles                    │
├────────────────────────────────────────────────────────────────┤
│ Option B: model outside the loop, sets the target only           │
│   model → target pose/velocity → deterministic high-rate tracker │
│   Works when: loop Hz ≫ model Hz (e.g. 1kHz loop + 10Hz model)   │
│   Benefit: model tail affects target refresh rate, not stability │
├────────────────────────────────────────────────────────────────┤
│ Option C: dual-rate architecture                                 │
│   slow loop (model, 1-10Hz) sets targets;                        │
│   fast loop (classical control, 100-1000Hz) tracks and guards:   │
│   reject and hold last target on unreachable/timeout/jump         │
│   This is B engineered. It is the production mainstream.          │
└────────────────────────────────────────────────────────────────┘

Choosing among them requires one ratio: inference P99 divided by control period. Below 1, the model can go in the loop. Between 1 and 10, it can only set targets. Above 10, it can only do task-level planning — it cannot even set targets directly.

That ratio explains many apparently contradictory observations. Why do VLA models do well at grasping and poorly at screwdriving? Because grasping tolerates a loose loop (a few hertz to tens of hertz; miss and regrasp), while screwdriving demands high-rate force control (hundreds of hertz to kilohertz). Not because the model cannot screw. Because the loop bandwidth does not match.

The code below makes the latency budget explicit. It belongs in any review that asks whether a model should enter a control loop:

import math

def latency_budget(p50, p99, p999, control_hz, mode="in_the_loop"):
    """Decide whether a model can enter a control loop."""
    period = 1000.0 / control_hz
    budget = period * 0.7                     # model budget; keep 30% for others
    if mode == "in_the_loop":
        if p99 <= budget:
            drop = math.ceil(p999 / period)
            flag = "; P99.9 exceeds 3 cycles, needs an outer watchdog" if drop > 3 else ""
            return f"feasible: P99 {p99}ms <= {budget:.1f}ms budget, P99.9 drops {drop} cycles/1000{flag}"
        return (f"infeasible: P99 {p99}ms > {budget:.1f}ms ({p99/budget:.1f}x over), "
                f"downgrade to set_point: model {1000/p99:.1f}Hz, loop {control_hz}Hz")
    if mode == "set_point":
        ratio = control_hz / (1000.0 / p99)
        tag = "feasible" if ratio >= 10 else "WARN: target refresh itself adds jitter"
        return f"{tag}: model {1000/p99:.1f}Hz vs loop {control_hz}Hz, ratio {ratio:.1f}:1"
    return "task-level: unbound by control period, but targets must be validated below"

print(latency_budget(20, 80, 300, 1000, "in_the_loop"))
print(latency_budget(20, 80, 300, 1000, "set_point"))
print(latency_budget(20, 80, 300, 10,   "in_the_loop"))

Run it: the same model (P50 20ms / P99 80ms / P99.9 300ms) can enter a 10Hz loop, but in a 1kHz loop it cannot even set targets comfortably — the ratio is 12.5:1, right at the warning line. This is why “the same model, on a different robot, stops working.” What changed was not the model. It was the loop bandwidth.


Part Eight: Determinism Comes From Isolation, Not Speed

Put the four breaks together and a unified picture appears.

ROS 2’s defaults are a set of choices optimized for composability, trading away determinism. Those choices are entirely correct for simulation, demos and research prototypes — there you want fast iteration, not worst-case guarantees. In production they fail in four shapes: scheduling, where callback priority cannot be expressed; time, where the time base can silently diverge; parameters, where world-model assumptions are scattered and unvalidated; data, where metadata checks are implemented as payload parsing.

All four share one property: none of them reports an error. They manifest as degraded performance, occasional anomalies, parameters that will not tune. Teams then burn their time on misdiagnosis — treating contract problems as algorithm problems, treating architecture problems as tuning problems.

Their fixes share a property too: they are all isolation, not acceleration.

┌──────────────────────────────────────────────────────────────────┐
│  Dimension         Mechanism                       Determinism won │
├──────────────────────────────────────────────────────────────────┤
│  Scheduling   CallbackGroup ↔ thread 1:1 (CIE)    callback priority │
│  Time         single clock source + startup audit  one time axis    │
│  Space        control loop off DDS (ros2_control)  bounded in-loop   │
│  Assumptions  single-point world model + asserts   assumptions agree │
│  Data         rosidl::Buffer zero-copy / partial   cost ⊥ payload    │
│  Frequency    model sets targets, loop tracks      tail stays outside│
└──────────────────────────────────────────────────────────────────┘

Every row separates two things of different natures rather than speeding one of them up. That is the substrate of real-time systems engineering: you cannot optimize a non-real-time system into a real-time one. You can only layer it so the real-time part is unaffected by the rest.

One detail makes a good closing note. Universal Robots’ PolyScope X release notes for 10.14.1 contain this fix: “Resolved client freezes and controller crashes triggered by rapid successive ROS service calls and parameter stack handling.”

Read that twice.

A TÜV-certified industrial controller, one that works alongside people on production lines, crashed because of rapid successive ROS service calls. Why? Because ROS service calls are asynchronous by semantics, while the controller’s internal state machine assumes serial execution. Drive calls faster than the state machine expects and it enters a state it was never designed for. This is not a UR bug and not a ROS bug. It is the inevitable friction between two concurrency models at a boundary: a best-effort communication graph on one side, a deterministic state machine on the other.

The industrial response is instructive: they do not let the outside into the kernel. They expose a script layer (URScript) and a set of standard interfaces (RTDE, XML-RPC, TCP/IP, ROS 2). The controller keeps all of its determinism; the outside only supplies targets. That is Option B from Part Seven implemented at the hardware level — not because the model is not strong enough, but because determinism, once given away, cannot be taken back.

The next piece picks up the same dividing line where it shows up in real projects: 5,000 developers, 115 countries, six months of industrial robotics competition. The perception layer reached 100% foundation-model adoption. The force-control layer saw 90% of finalist teams deliberately retreat to rule-based logic. That 90% was not conservatism. It was the same arithmetic, answered at a different layer.


Appendix: One-Page Cheat Sheet

SymptomMost likely causeCheck first
Rate 20-40% below simulation, no errorsCallback queueing, not execution timeros2 topic delay, perf sched
TF reports extrapolation into the futureRTF off 1.0 or mismatched clock sourcesuse_sim_time and /clock publishers
Node alive but silentuse_sim_time set, no /clock publisherStartup order, bridge config
Hugs walls while taking detoursinflation_radius set on only one costmapGlobal vs local consistency
Oscillates near the goalxy_goal_tolerance below localization σTolerance vs σ, stateful
Narrow corridor judged impassableCostmap resolution too coarse0.1 → 0.05, expect 4x cells
Latency spikes under loadDeserialization cost scales with loadPartial CDR parse, first 12 bytes
Smaller model runs slowerOptimized $C$, bottleneck is $W$Measure wait before execution