TZC: Efficient Inter-Process Communication for Robotics Middleware with Partial Serialization

Yu-Ping Wang, Wende Tan, Xu-Qiang Hu, Dinesh Manocha, Shi-Min HuIROS 2018 · DOI

Abstract

Inter-process communication (IPC) is one of the core functions of modern robotics middleware. We propose an efficient IPC technique called TZC (Towards Zero-Copy). As a core component of TZC, we design a novel algorithm called partial serialization. Our formulation can generate messages that can be divided into two parts. During message transmission, one part is transmitted through a socket and the other part uses shared memory. The part within shared memory is never copied or serialized during its lifetime. We have integrated TZC with ROS and ROS2 and find that TZC can be easily combined with current open-source platforms. By using TZC, the overhead of IPC remains constant when the message size grows. In particular, when the message size is 4MB (less than the size of a full HD image), TZC can reduce the overhead of ROS IPC from tens of milliseconds to hundreds of microseconds and can reduce the overhead of ROS2 IPC from hundreds of milliseconds to less than 1 millisecond. We also demonstrate the benefits of TZC by integrating with TurtleBot2 that are used in autonomous driving scenarios. We show that by using TZC, the braking distance can be shortened by 16% than ROS.

Introduction

Modern robotics software is inherently modular, relying on a "graph" of independent processes (nodes) for sensing, mapping, and navigation. These nodes must constantly exchange high-bandwidth data, such as HD video or dense LiDAR point clouds. Standard middleware like the Robot Operating System (ROS) and ROS2 typically rely on socket-based communication. While flexible, this approach creates a significant performance bottleneck due to the "copy-and-serialize" cycle: data must be serialized into a buffer, copied into the OS kernel, and then copied again into the destination process. As message sizes grow, latency increases linearly, which can be catastrophic for real-time safety-critical systems like autonomous vehicles.

TZC and Partial Serialization

To address this, we introduce TZC (Towards Zero-Copy), a framework centered on a novel Partial Serialization Algorithm. Unlike standard serialization that treats a message as a single monolithic blob, TZC uses a Depth-First Search (DFS) approach to parse message definitions and divide them into two distinct parts:

  1. The Control Part: Contains metadata and small, fixed-length elements. This is transmitted via standard sockets to provide reliable synchronization and notification.
  2. The Data Part: Contains large, variable-length arrays (e.g., pixel data). This part is stored in POSIX shared memory.
The TZC communication flow between nodes using buffers and sockets.

The core innovation is that the data part is never copied or serialized during its entire lifetime. The control part simply contains offsets to the shared memory region. TZC also implements custom publication policies (Best effort, Worst effort, Medium effort, and Blocking) to manage the lifecycle of these shared memory buffers automatically.

Experimental Evaluation

The effectiveness of TZC was evaluated through synthetic benchmarks and real-world hardware tests. Synthetic tests varied message sizes from 4KB to 4MB across multiple subscribers, comparing TZC-integrated ROS/ROS2 against standard implementations and other shared-memory frameworks like ETHZ-ASL and Ach. Compatibility was also verified against 358 standard ROS message types.

The TurtleBot2 hardware setup and experimental autonomous braking scenario.

For the hardware demonstration, a TurtleBot2 equipped with an HD camera and an ASUS Xtion PRO sensor was used to test an autonomous braking scenario. This setup allowed for measuring the end-to-end impact of IPC latency on physical safety metrics.

Key Results and Impact

The results demonstrate that with TZC, IPC overhead remains nearly constant regardless of message size. For 4MB messages—typical for HD images—TZC reduced ROS IPC latency from approximately 30ms to hundreds of microseconds. For ROS2, the improvement was even more stark, dropping from hundreds of milliseconds to under 1ms.

In the TurtleBot2 braking experiment, switching from standard ROS to TZC reduced total software latency from 200ms to 20ms. This reduction translated directly into a 16% (10cm) shorter braking distance, highlighting the critical safety margin provided by efficient IPC. Furthermore, TZC showed broad compatibility, supporting 94.2% of the tested ROS message types out of the box.

Conclusion and Future Work

TZC provides a significant leap in IPC efficiency for robotics by achieving true zero-copy for large data payloads while maintaining compatibility with existing middleware synchronization. Currently, TZC is limited to single-machine communication and does not support variable-length arrays of strings. Future work will explore extending these zero-copy techniques to heterogeneous hardware, such as GPU-CPU data transfers, to further optimize modern robotics perception pipelines.

Summary updated

BibTeX
@inproceedings{wang2018tzc,
  author = {Yu-Ping Wang and Wende Tan and Xu-Qiang Hu and Dinesh Manocha and Shi-Min Hu},
  title = {{TZC: Efficient Inter-Process Communication for Robotics Middleware with Partial Serialization}},
  booktitle = {IEEE/RSJ International Conference on Intelligent Robots and Systems},
  year = {2018},
  doi = {10.1109/iros40897.2019.8968462},
}
Figure