Introducing the micro-ROS Client Library

Jun 2, 2020Tech

The micro-ROS client library provides the micro-ROS API for the user code, for instance for application-level micro-ROS nodes. The overall goal here is to provide all relevant ROS 2 concepts in suitable implementations for microcontrollers, and where possible, API compatibility with ROS 2 will be achieved to ease portability.

To minimize the long-term maintenance cost, the project strives to use existing data structures and algorithms from the ROS 2 stack or to bring necessary changes in the mainline stack. This raises questions, some of which include concerns regarding the applicability of existing ROS 2 layers on microcontrollers in terms of runtime efficiency, portability to different RTOS, dynamic memory management, and various more.

Supporting a Two-layered API

While C is still the dominating programming language for microcontrollers, there is a clear trend shifting towards the use of higher-level languages, C++ in particular. Much of what drives this trend is modern microcontrollers featuring several kilobytes or even a few megabytes of RAM. micro-ROS, therefore, aims to offer and support two APIs. A basic discussion for the design and implementation of the micro-ROS client library can be found in the micro-ROS decision paper published in March 2019.

  • The C API based on the ROS 2 Support Client Library (rcl). This API is enriched with modular packages for diagnostics, execution management, parameters, and more.
  • The C++ API based on the ROS 2 rclcpp. This one first requires the analysis of the fitness of rclcpp for use on microcontrollers, in particular when it comes to memory, CPU consumption, and dynamic memory management.
Advanced Concepts

Several advanced concepts were developed in the context of the client library. In general, these concepts are developed for the standard rclcpp first, before implementing a tailored C version.

  • Real-Time Executor: The goal of the Real-Time Executor is to support roboticists with practical and easy-to-use real-time mechanisms that provide solutions for real-time guarantees Integration of real-time and non-real-time functionalities on one platform, deterministic execution, and specific support for RTOS and microcontrollers.
  • Lifecycle and System Modes: micro-ROS has observed that the interweaving of “task handling”, “contingency handling”, and “system error handling” handled on the deliberation layer generally leads to the high complexity of the control flow, something that could be reduced by introducing appropriate abstractions for system-oriented calls and notifications. The micro-ROS goal is, therefore, to provide suitable abstractions and framework functions for system runtime configuration and system error and contingency diagnosis.
  • Embedded Transform (TF): Following its release in 2008, and with its support for both a temporal history and distributed information sources, the TF transform graph has been a novel tool for robotics frameworks. However, one persistent issue with transform graphs has been their resource use. micro-ROS, therefore, runs the dynamic transform tree in an embedded device, while keeping resource use to a minimum based on an analysis of the spatial and temporal details that are actually needed.
Upcoming Technical Webinars on Robotics

Looking to learn more about FIWARE for Robotics? We are running a series of webinars on the development of FIWARE NGSI Robotics Interfaces and how FIWARE enablers accelerate the implementation of powerful smart robotics applications.

Following up on our previous webinars: ‘How to Get Context Data Out of Robots’ (click here to revisit the webinar) and ‘How to Develop FIWARE NGSI Interfaces for Robots’ (click here to revisit the webinar), we now present to you a series of blog posts acting as an introduction to the micro-ROS world, including topics such as architecture, middleware, tutorials, and demo cases. This way, you will be up to speed for our next webinars that will dive deeper into core real-time technologies from the smallest robotic devices to agile manufacturing environments

Related articles