
Fast Zero-Copy Messaging with ROS 2 Intra-Process Communication
ROS 2 uses so-called “middleware” to perform communication between nodes. Over the years different middleware vendors have vied to become the Chosen Implementation, importantly by focusing on message passing efficiency. However: You can be even more efficient by just skipping the middleware completely and achieve true zero-copy messaging! And all you have to do is apply a simple convention: All publishers SHOULD allocate messages using unique pointers. All publishers SHOULD publish the messages using std::move. All subscribers SHOULD expect either a ConstSharedPtr or a const reference. Enable use_intra_process_comms Read on to understand why. ...