Skip to content
Robotics.world

The Floor

ROS 2 simulation study reports faster, repeatable tests

Researchers propose a coordination scheme and parallel simulator to make ROS 2 application tests repeatable. In industrial use cases, their simulator was up to 2.6 times faster than a synchronous parallel comparison.

ROS 2 simulation study reports faster, repeatable tests

A proposed simulator for ROS 2 applications was up to 2.6 times faster than synchronous parallel simulation in industrial use cases, while targeting variations that can make tests difficult to repeat. The result comes from a preprint submitted to arXiv on November 19 by Uppsala University researchers Chengzi Huang, Behnam Khodabandeloo, Duc Anh Nguyen, Chuanchao Gao and Wang Yi.

The authors say the simulator runs existing ROS 2 applications without changes to the applications or ROS 2. Their approach combines a coordination scheme for repeatable behavior with an algorithm that runs dependent work in parallel where possible.

Fixing the timing

ROS 2 applications use asynchronous publish-subscribe communication: components publish messages and other components subscribe to them. The paper says variations in execution time, communication delays and scheduling can change an application's behavior between runs, even when its code and inputs stay the same.

As an example, the researchers describe a planner that calculates commands using the latest objects detected in camera images. A change in the detector's execution time can lead the planner to use a different image, potentially making a fault hard to reproduce.

The proposed coordination scheme sets predefined instants for components to read inputs and write outputs, including components activated by events. Computation and transport delays are fixed, and a component produces a record even when it has no message to publish.

Those empty records let the simulator determine future jobs and their dependencies before a run, according to the paper. In the paper's model, each callback's outputs are assumed to depend only on its inputs; under that assumption, the researchers say the scheme makes application behavior independent of scheduling and platform.

Running work out of order

The simulation algorithm uses the timing rules to identify which jobs must finish before another can start. Jobs from different components can then run out of release order and in parallel, provided their dependencies have finished.

The simulator calculates dependencies as needed rather than constructing the full dependency graph. To limit message storage, it reuses slots in a fixed-size ring after the jobs that need the previous contents have finished.

The researchers implemented their simulator as a layer for ROS 2 Jazzy. It reads the application graph from the nodes and can load them from existing shared libraries without recompilation; users provide the delays in files.

Results and limits

The evaluation used the Autoware reference system, fleets built from that reference system and a stereo vision pipeline using recorded camera frames. The team also tested 1,385 synthetic graphs, including randomly generated ROS 2 graphs and graphs derived from automotive benchmarks.

All simulators ran on a machine with two AMD EPYC 9755 processors and 256 cores, with each worker pinned to a core. The comparisons included sequential simulation, synchronous parallel simulations and a conservative asynchronous parallel simulation.

In the Fleet-64 workload, which contained 1,600 nodes and 566,353 jobs over 10 seconds of simulated time, sequential simulation took 228 seconds. The proposed simulator took 1.0 second on 256 workers, a 228-fold speedup and 91% of the paper's theoretical bound for that workload, the authors report. The synchronous Sync-W comparison reached a speedup of 89.

Across the synthetic graphs, the proposed simulator was 1.98 times as fast as Sync-W on average, measured as a geometric mean, on 32 workers. In industrial use cases, the asynchronous comparison held 12 to 42 times as many message bytes at its peak, although the paper also tested limits on how far tasks could run ahead.

The coordination scheme currently does not support several publishers from one node on the same topic or applications whose structure changes during a run. The researchers identify both as areas for future work.

Sources

  1. Original source · Preprint One Behavior, Out of Order: Deterministic Execution and Parallel Simulation of ROS 2 Applications arXiv:2611.26676

Related stories

Explore

More articles