A micro-ROS mechanism for checking the status of the middleware link between the micro-ROS agent and the client has been added.

This new feature has been requested by the community here.

Many micro-ROS use cases are based on nodes that are continuously sending or receiving data or commands via ROS 2 interfaces.

The HARD_LIVELINESS_CHECK mechanism allows the micro-ROS client 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 established micro-ROS session if a certain timeout happens with any response from the client side. This means that the nodes, publishers, subscribers (and any other entity) created by the client will be removed from the ROS 2 graph.

This new mechanism ensures that the micro-ROS client and agent will be automatically checking their status. The liveliness checking period can be configured in milliseconds.

The HARD_LIVELINESS_CHECK mechanism is enabled by default in the micro-ROS Agent and must be enabled by means of a CMake argument in the micro-ROS client.

This new mechanism helps to ensure a reliable connection between micro-ROS client and micro-ROS agent and let the user know when the embedded side of the ROS 2 application is no longer available because of a firmware fault or a link issue.

PR are already available in the micro-ROS default middleware (Micro XRCE-DDS) library: