Autonomous applications are typically developed over Robot Operating System 2.0 (ROS2) even in time-critical systems like automotive. Recent years have seen increased interest in developing model-based timing analysis and schedule optimization approaches for ROS2-based applications. To complement these approaches, we propose a tracing and measurement framework to obtain timing models of ROS2-based applications. It offers a tracer based on extended Berkeley Packet Filter (eBPF) that probes different functions in ROS2 middleware and reads their arguments or return values to reason about the data flow in applications. It combines event traces from ROS2 and the operating system to generate a directed acyclic graph showing ROS2 callbacks, precedence relations between them, and their timing attributes. While being compatible with existing analyses, we also show how to model (i)~message synchronization, e.g., in sensor fusion, and (ii)~service requests from multiple clients, e.g., in motion planning. Considering that, in real-world scenarios, the application code might be confidential and formal models are unavailable, our framework still enables the application of existing analysis and optimization techniques.
翻译:自主应用通常基于机器人操作系统2.0(ROS2)开发,即便在汽车等时间关键型系统中亦是如此。近年来,针对基于ROS2的应用开发基于模型的时序分析与调度优化方法的研究日益增多。为补充这些方法,我们提出一种用于获取ROS2应用时序模型的追踪与测量框架。该框架提供基于扩展伯克利数据包过滤器(eBPF)的追踪器,可探测ROS2中间件中的不同函数并读取其参数或返回值,以推断应用中的数据流。该框架通过融合ROS2与操作系统的事件追踪,生成展示ROS2回调函数、回调间优先级关系及其时序属性的有向无环图。在保持与现有分析方法兼容的同时,我们还展示了如何建模(i)消息同步(例如在传感器融合中)以及(ii)多客户端服务请求(例如在运动规划中)。考虑到实际场景中应用代码可能涉密且缺乏形式化模型,我们的框架仍能支持现有分析与优化技术的应用。