ROS 2 shared memory in snaps for IoT applications

The Robot Operating System (ROS) is an open-source framework that helps researchers and developers build and reuse code between robotics applications and IoT devices. ROS is powering the future of robotics in industry, in the enterprise and for developers.

Ubuntu is the primary platform for ROS because of its flexibility and user-friendliness.

If you are a ROS developer, you probably know that ROS 2 brings with it several benefits and changes from ROS 1:

  • Enhanced security monitoring
  • Support for multiple robot systems
  • Support for a microcontroller
  • Support for real-time control
  • Multi-platform support

The Data Distribution Service (DDS) brings some of these benefits. It’s a middleware layer which provides discovery, serialization and transportation for ROS 2.

DDS enables unlocking shared memory, a fast interprocess communication mechanism that allows multiple processes to access the shared memory area like regular working memory.

With shared memory, developers can:

  • Create processes that can read/write to this memory with the help of a synchronization mechanism.
  • Lower latency and get higher throughput compared to socket communication
  • Provide a smaller-packet-based mechanism
  • Bring efficient copy strategies

If you are a robotics or IoT developer interested in the shared memory mechanism in ROS 2, check this article, we explain how to use it with snaps.