Our conclusions on trying to implement micro-ros in our robot

Hello @Trab40,

Based on these conclusions and also from the isue you opened we have thought that micro-ROS needs a mechanism for checking the status of the middleware link between the micro-ROS agent and the client.

This is quite difficult when talking about DDS-XRCE because as stated in the OMG Document, the wire protocol is designed to be used in extreme resource-constrained devices with deep sleep modes. The main consequence of this is that all the communication processes between the client and the agent are started by the client. The agent cannot begin any communication process because the client may be in a sleep state where it cannot receive and/or respond.

But when we talk about micro-ROS, it is true that there are few use cases where the above situation happens. Most use cases are based on micro-ROS nodes that are continuously sending or receiving data or commands via ROS 2 interfaces.

This way, we have started to design an approach where the micro-ROS client is able to tell the agent that its liveliness must be ensured. This way, the micro-ROS agent will take care of ensuring that the micro-ROS client is alive and will destroy the micro-ROS session between them if a certain timeout happens.

We have named it HARD_LIVELINESS_CHECK. It is enabled by default in the micro-ROS Agent and must be enabled by means of a CMake argument in the micro-ROS Client. Also, the liveliness period can be configured in milliseconds.

Once it is enabled, the micro-ROS client and agent will be automatically checking their status. When the transport link is broken or any critical situation in the micro-ROS client-side stops the operation, the micro-ROS agent will wait during the configured milliseconds before removing all the sessions of that certain client.

Removing the session just means that the nodes, datawriters and datareaders created by the micro-ROS client will be removed from the ROS 2 graph. This way, by means of checking the ROS 2 graph you can ensure that your micro-ROS is alive and running.

Here you have the PR were we are working on that:

We will merge this on the micro-ROS mainlines when we finish the testing, but any feedback will be really welcomed.

Thanks!!

7 Likes