解决ROS 2中无固定大小消息的零拷贝通信难题
ROS 2 Agnocast: Supporting Unsized Message Types for True Zero-Copy Publish/Subscribe IPC
- 设计支持任意消息类型的零拷贝通信机制
- 在真实自动驾驶系统中实现16%平均延迟降低
- 无需修改现有代码,适合大型项目无缝集成
机器人应用依赖于如ROS 2这样的进程间通信(IPC)中间件,其组件通过发布/订阅消息交互。在自动驾驶等大规模系统中,真正的零拷贝通信(避免序列化/反序列化)对效率和实时性至关重要。然而现有方案普遍无法同时满足三大需求:1)支持所有消息类型,包括无固定大小的类型;2)对现有代码改动极小;3)可选择性地在特定节点间启用零拷贝,其余通信仍保持传统模式,包括跨主机通信。其中,无固定大小消息类型在生产级项目(如Autoware)中广泛应用,且遍布整个ROS 2生态。尽管IceOryx等中间件接近满足要求,但未能支持无固定大小类型;其他方案虽支持却缺乏实用性。本文提出Agnocast,一个适用于Linux上ROS 2 C++的真正零拷贝框架,完全满足上述三项要求。评估显示,无论消息大小如何,其通信开销恒定;在Autoware点云预处理任务中,平均响应时间提升16%,最差情况下降25%。
原文摘要 · Abstract (English)
Robot applications, comprising independent components that mutually publish/subscribe messages, are built on inter-process communication (IPC) middleware such as Robot Operating System 2 (ROS 2). In large-scale ROS 2 systems like autonomous driving platforms, true zero-copy communication -- eliminating serialization and deserialization -- is crucial for efficiency and real-time performance. However, existing true zero-copy middleware solutions lack widespread adoption as they fail to meet three essential requirements: 1) Support for all ROS 2 message types including unsized ones; 2) Minimal modifications to existing application code; 3) Selective implementation of zero-copy communication between specific nodes while maintaining conventional communication mechanisms for other inter-node communications including inter-host node communications. This first requirement is critical, as production-grade ROS 2 projects like Autoware rely heavily on unsized message types throughout their codebase to handle diverse use cases (e.g., various sensors), and depend on the broader ROS 2 ecosystem, where unsized message types are pervasive in libraries. The remaining requirements facilitate seamless integration with existing projects. While IceOryx middleware, a practical true zero-copy solution, meets all but the first requirement, other studies achieving the first requirement fail to satisfy the remaining criteria. This paper presents Agnocast, a true zero-copy IPC framework applicable to ROS 2 C++ on Linux that fulfills all these requirements. Our evaluation demonstrates that Agnocast maintains constant IPC overhead regardless of message size, even for unsized message types. In Autoware PointCloud Preprocessing, Agnocast achieves a 16% improvement in average response time and a 25% improvement in worst-case response time.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。