,
Michal Sojka
Creative Commons Attribution 4.0 International license
ad707c64ef8fced102c589cd5a53b2c0
(Get MD5 Sum)
Deterministic real-time performance is critical for robotic applications, many of which are developed in C++ using the ROS 2 framework. Recently, Rust has emerged as a compelling alternative to C++ in various domains, including robotics. This study explores whether ROS 2 applications written in Rust can achieve real-time performance comparable to their C++ counterparts. We focus on the R2R library, which provides Rust bindings for ROS 2 with a modern asynchronous programming interface. This artifact includes source code for several ROS 2 nodes and supporting Python scripts. The nodes implement simple publishers or subscribers and vary in programming language (Rust, C++), Rust asynchronous runtime (futures, Tokio), and callback-to-OS-thread mapping with different thread priorities. The nodes are run with tracing enabled and by post-processing the traces we obtain statistics about end-to-end latencies. Our results demonstrate that specific configurations enable Rust R2R applications to match the real-time performance of C++ applications. Running the artifact as is does not require any ROS 2 or Rust knowledge. Following our README and running mentioned shell commands should be sufficient. However to verify that the commands do what is promised, some familiarity with ROS 2 workspace structure and Rust’s build tool cargo would be beneficial.
@Article{skoudlil_et_al:DARTS.11.1.2,
author = {\v{S}koudlil, Martin and Sojka, Michal},
title = {{A First Look at ROS 2 Applications Written in Asynchronous Rust (Artifact)}},
pages = {2:1--2:2},
journal = {Dagstuhl Artifacts Series},
ISSN = {2509-8195},
year = {2025},
volume = {11},
number = {1},
editor = {\v{S}koudlil, Martin and Sojka, Michal},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/entities/document/10.4230/DARTS.11.1.2},
URN = {urn:nbn:de:0030-drops-236038},
doi = {10.4230/DARTS.11.1.2},
annote = {Keywords: ROS, Rust, Real-time, Response time}
}