Authors: Simon Sagmeister, Marcel Weinmann, Phillip Pitschi, Markus Lienkamp
Organizations: Technical University of Munich, Germany; School of Engineering & Design, Department of Mobility Systems Engineering, Institute of Automotive Technology · Technical University of Munich, Germany; School of Engineering & Design, Department of Engineering Physics and Computation, Institute of Automatic Control
Simulation is crucial in real-world robotics, offering safe, scalable, and efficient environments for developing a variety of robotic applications. While the Robot Operating System (ROS) has been widely adopted as the backbone of these robotic applications in both academia and industry, its asynchronous, multi-process design complicates reproducibility, especially across varying hardware platforms. Deterministic callback execution cannot be guaranteed when computation times and communication delays vary. This lack of reproducibility complicates scientific benchmarking and continuous integration, where consistent results are essential. To address this, we present a methodology to create deterministic simulations using ROS 2 nodes. Our ROS Simulation Library for C++ (RSLCPP) implements this approach, enabling existing nodes to be combined into a simulation routine that yields reproducible results usually without requiring any source code changes. We demonstrate that our approach produces identical results across various CPUs and architectures when testing both a synthetic benchmark and a real-world robotics system. RSLCPP is open-sourced at https://github.com/TUMFTM/rslcpp.
Figures & tables
Fig. 1: Illustrative comparison of asynchronous and synchronous execution. The example consists of timer ( T1 , T2 ) and subscription ( S1 ) callbacks. S1 is triggered by a publisher at the end of T2 . In the asynchronous case, the callback runtimes influence the order in which the callbacks are processed. With our approach, they remain in a fixed order. t indicates wall time progression, which is decoupled from the simulation time for the synchronous example.
Fig. 2: rslcpp event loop. The actions depicted in blue are specific to the rslcpp event loop, while white coloring indicates processes implemented within the rclcpp events executor. The loop terminates before advancing time as soon as the job object indicates that the simulation is complete.
Fig. 3: Synthetic benchmark system for testing deterministic callback execution. Timer callbacks with their respective frequencies are shown in blue, while subscription callbacks are depicted in dark gray. Service callbacks are colored green while a client’s response callback is depicted in white. Individual nodes are represented as light gray boxes.
Architecture
Vendor
Model
Cores/Threads
x86_64
Intel
i7-11850H
8/16
x86_64
AMD
Ryzen 7 Pro 6850U
8/16
x86_64
Intel
Xeon D-2166NT
12/12
x86_64
AMD
EPYC 7313P
16/32
x86_64
AMD
Ryzen 9 7950X
16/32
aarch64
ARM
Cortex-A72
4/4
TABLE I: CPU models used for validating deterministic execution with the synthetic benchmark system.
Fig. 4: Root-mean-squared-error (RMSE) of the average positional error (APE) over 100 simulations of the KISS-ICP [ 8 ] on Sequence 00 of the KITTI Odometry [ 22 ] dataset within ROS 2 and rslcpp . The number of parallel KISS-ICP threads is reported in parentheses. CPU models are abbreviated and correspond to Table I .