IPC in ros2

In the future, please set the category to “Next Generation ROS” when discussing ROS 2.

First, I’ll assume you mean “does ROS 2 use any operating system IPC mechanisms between nodes on the same machine, rather than sending data over UDP?”, because the term “inter-process communication” only means communication between two processes, but does not imply what the mechanism is (i.e. UDP or TCP can be IPC).

It depends on the middleware implementation you are using. Currently the default of Fast-RTPS does not use anything other than UDP single cast or multicast. It could, RTPS allows for this in the protocol. I believe some of the proprietary implementations provide a shared-memory based IPC mechanism when on the same machine. Fast-RTPS will hopefully support this in the future.

There have been some experiments which use RTPS on a OS-less microcontroller to communicate with ROS 2 on a desktop and some other experiments to get our ROS 2 API compiling for microcontrollers, but there is no out of the box support for OS-less ROS 2 at this time. We did enough work to convince ourselves that is possible, but haven’t followed through with sustained support because we didn’t have time, though we would love to do that in the future.

In that case though, with no OS, you probably would not be using processes so the idea of “Inter-process communication” doesn’t really make sense. You would be using something more like our “Intra-process communication”, which can avoid sending the message data over the network (UDP in most cases).

4 Likes