Micro-Ros / XRCE-DDS inter & intra task communication

Hello everyone,

I’m currently exploring the potential of migrating our existing codebase to micro-ROS and would appreciate some guidance from the community.

Our company designs and builds drones, and our current setup consists of:

  1. Custom avionics code running on an STM32 with FreeRTOS
  2. A full sensing and navigation stack running on an Nvidia Jetson with ROS2
  3. Communication between the two via a USART link, using a custom protocol and a bridge to ROS

Considering the capabilities of micro-ROS, we are wondering if it would be beneficial to migrate our avionics stack and integrate it into the ROS ecosystem. This would provide us with a system-wide publish/subscribe and service network, potentially simplifying our architecture.

However, after reviewing the documentation and examples, I have a few questions that I hope you can help me with:

  1. The majority of the documentation and examples focus on the XRCE-DDS agent, which runs on the Linux computer. This seems to be most applicable when there is only a single node running on the MCU. In our case, we plan to have multiple nodes on the STM32, with numerous messages being exchanged between them. How does micro-ROS handle communication between nodes on the same MCU?

  2. In a scenario where a message needs to be sent to both a node on the Nvidia Jetson and a node on the STM32, how would micro-ROS manage this communication?

I would greatly appreciate any insights, experiences, or resources you can share to help us better understand the capabilities and limitations of micro-ROS in our specific use case.

Thank you in advance for your assistance!

Hello @amcolex

  1. The majority of the documentation and examples focus on the XRCE-DDS agent, which runs on the Linux computer. This seems to be most applicable when there is only a single node running on the MCU. In our case, we plan to have multiple nodes on the STM32, with numerous messages being exchanged between them. How does micro-ROS handle communication between nodes on the same MCU?

Both micro-ROS and its middleware (eProsima Micro XRCE-DDS) are solutions that mainly targets bridging MCUs to ROS 2 (or DDS). That means they should not handle intra-process or inter-process communications inside MCUs. We understand that if more than one process communicates with another within the same RTOS context, the optimal solution shall be using the RTOS-provided mechanisms instead of adding extra complexity layers such as micro-ROS inside those resource-restricted environments.

This way, we can keep micro-ROS and Micro XRCE-DDS as solutions for bridging between embedded and ROS 2 / DDS domains.

In any case, if you are interested in having such an approach working in an STM32 MCU, we offer a full-fledged DDS solution named Safe DDS. Safe DDS provided embedded ISO26262 FuSa-certified DDS communication middleware for embedded devices. Along the Safe DDS features, you will find a highly optimized shared memory communication between DataReaders and DataWriters running in the same context. Also, Safe DDS provides native DDS interoperability, allowing you to get rid of the Agent that micro-ROS and Micro XRCE-DDS require.

You can find the online documentation for this product here: Main features — Safe DDS 1.0.0 documentation

  1. In a scenario where a message needs to be sent to both a node on the Nvidia Jetson and a node on the STM32, how would micro-ROS manage this communication?

In that case, when using micro-ROS, the message will travel from the micro-ROS publisher that lives in the MCU to the micro-ROS Agent, after that, the message will be forwarded via ROS 2/DDS to the node on the NVidia Jetson and the micro-ROS Agent will forward it back to the MCU to reach the micro-ROS subscriber that runs in the MCU.

In the case of using Safe DDS, the communication will happen natively from your DDS publisher in the MCU to the DDS subscriber in the NVidia Jetson using the DDS/RTPS protocol (normally via UDP sockets). On the other hand, the message will reach the DDS subscriber in the MCU via shared memory communication. No need for an Agent.

Hope that this helps.