IPC Mechanisms (ROS1 vs Shared Memory IPC)
Ahmed Radwan
Sr Software Engineer, COM-IoT Technologies. ?Ex: Avelabs, Yonohub Developer Advocate.
Introduction
Inter-Process Communication (IPC) mechanisms are fundamental to modern operating systems, enabling different processes to communicate and synchronize their actions while running concurrently. These mechanisms are crucial for ensuring efficient data exchange and coordination in complex software systems. Common IPC methods include sockets, which facilitate network-based communication; message queues, which manage data exchange in a queued manner; and shared memory, which allows multiple processes to access the same memory space directly.
This summer (2024), as part of the OMSCS program at Georgia Institute of Technology , I enrolled in a graduate-level course on operating systems (CS-6200). This course provided me with a comprehensive understanding of these IPC mechanisms and their practical applications. Prior to the course, I had experience with ROS1 (Robot Operating System), but the class revealed that ROS1's communication methods are not the most efficient. Motivated by this insight, I decided to conduct an experiment to evaluate the communication overhead of transferring a point cloud consisting of one million points between processes.
Experiment
To assess the communication efficiency of various Inter-Process Communication (IPC) mechanisms, I selected three distinct types of nodes for the experiment:
In this experiment, the focus was solely on the communication performance, so the preparation of the point cloud message was excluded to ensure that the comparison was purely based on the communication overhead.
Latency measurements were conducted by averaging the results from 1,000 message transfers for each node type.
Results
The average latency for each mechanism is summarized in the table below:
领英推荐
Analysis
In summary, the shared memory IPC mechanism outperformed both rospy and roscpp in terms of latency, making it the most efficient method for communication between processes in this experiment. The data indicates that for scenarios requiring minimal latency, shared memory is a preferable choice over ROS1-based communication methods.
Github link:
References
Robotics Software Engineer at Tahaluf | C++ | ROS | Qt | DDS
7 个月Great work. What was the size of the point cloud msg? Also was there any size limitation on the IPC methods used?
AI Lead Engineer at AGILOX: Driving the Future of Intralogistics with AI-Powered Robotics
7 个月Thank you for your work, wishing you the best with upcoming semester, also we are looking forward for the ROS2 comparison ?
MBD | Embedded Systems | Control Theory | Automotive | Robotics | Medical Devices | Localization | SLAM | Autonomous Navigation | ROS
7 个月Congratulations! ????
Software Development, Robotics, Mechatronics
7 个月Very interesting, thanks for sharing. ROS 2 uses DDS which supports communication over shared memory (message I think has a size limit though).