ROS 2 应用确定性执行与乱序并行仿真:面向机器人系统级验证的协调方案与模拟器
One Behavior, Out of Order: Deterministic Execution and Parallel Simulation of ROS 2 Applications
该研究为 ROS 2 应用引入轻量协调方案,让包括事件驱动组件在内的每个组件在预定义时刻读写输入输出,从而在给定输入下始终只有一种行为,使测试可重复。基于这些读写时刻,乱序并行仿真算法在运行前即可确定组件激活间的依赖关系,并在依赖完成后立即启动各激活。模拟器无需修改现有 ROS 2 应用或 ROS 2 本身,在工业用例上比同步并行仿真快至多 2.6 倍,消息内存占用比异步并行仿真低一个数量级。
arXiv:2611.26676v1 Announce Type: new Abstract: System-level simulation is widely used to validate robotic applications before hardware deployment. However, Robot Operating System 2 (ROS 2), a popular middleware for such applications, uses asynchronous publish-subscribe communication, which can make application behavior depend on scheduling and the platform. The behavior can then vary across runs and machines even with the same inputs. This nondeterminism makes faults hard to reproduce and tests unreliable. In this paper, we first give ROS 2 applications a lightweight coordination scheme in which every component, including event-driven ones, reads its inputs and writes its outputs at predefined time instants. By decoupling computation and communication, the scheme makes an application deterministic, that is, it always has one behavior for given inputs. Tests are thus repeatable, but for large applications they still take a long time. To speed up these tests, we then present an out-of-order parallel simulation algorithm. From the predefined read and write instants, it knows before the run which activations of components depend on which. It starts each activation as soon as those it depends on have finished. Finally, we implement the algorithm in a simulator that runs existing ROS 2 applications without any change to them or to ROS 2. We evaluate the simulator on industrial use cases and synthetic graphs. On the industrial use cases, it is up to 2.6 times faster than synchronous parallel simulation and needs an order of magnitude less memory for messages than asynchronous parallel simulation.
来源:arXiv (Robotics + Hardware + Signal) · arxiv.org