ROS2 - embeddedRTPS - RTPS for microcontroller

Hi all,

I kindly would like to make you aware of embeddedRTPS, our open-source (MIT license) and portable implementation of the RTPS protocol for microcontrollers. Our implementation is based on lwIP and FreeRTOS, which is available for many platforms. Discovery mechanisms are implemented (SPDP and SEDP) and embeddedRTPS is interoperable with FastRTPS for reliable and best-effort endpoints.

We have been able to port embeddedRTPS to Infineon Aurix, STM32 and Xilinx UltraScale+ R5.

You can find source code and more information on GitHub: https://github.com/embedded-software-laboratory/embeddedRTPS

Our implementation is far from complete, as many QoS policies are not supported yet. Nevertheless, I hope that embeddedRTPS could be useful for some of you here.

Best regards
Alex

18 Likes

Thanks a lot for sharing @AKampmann, that’s a pretty interesting piece of work!

Could you maybe advice on the following matters?

  1. Have performed any benchmark of embeddedRTPS that you could share? If so, are such measurement mechanisms available by any chance?
  2. In the repo it’s mentioned that

Due to license issues, we can only make source code available for the STM32

I went through the code and dependencies somewhat quickly and while possibly beyond the scope of your project, the following popped: have you considered offering support for embeddedRTPS on top of POSIX/Linux for development? That’d be extremely helpful to many in this community IMHO and would allow comparison against other existing RTPS solutions out there while enhacing its portability to a wide variety of RTOSs.

I see that among the dependencies, a) there should not be any issues with Micro-CDR to run on Linux, b) there seems to be some existing work on getting lwIP in Linux (thought it’d be nice to get some other networking stacks, e.g. the Linux one or rtnet)

  1. Could you share maybe a bit more about your goals and objectives with regard embeddedRTPS? Do you have an open roadmap for it? If someone wanted to jump in and help, how would best she/he do it?
1 Like

@AKampmann

great work !!!

Have performed any benchmark of embeddedRTPS that you could share?

+1 on this, that would be really appreciated.

Its in their paper: A Portable Implementation of the Real-Time Publish-Subscribe Protocol for Microcontrollers in Distributed Robotic Applications | IEEE Conference Publication | IEEE Xplore

2 Likes

Thank you for your feedback so far. I will try to answer most of your questions

Have performed any benchmark of embeddedRTPS that you could share? If so, are such measurement mechanisms available by any chance?

I have updated the repository with round-trip-times for two different setups:

  • 2x Infineon Aurix running embeddedRTPS
  • STM32 running embeddedRTPS and Intel NUC running eProsima FastRTPS.

Measurements are obtained by toggling pins upon sending/reception and using a logical analyser for precise timing measurement.

I went through the code and dependencies somewhat quickly and while possibly beyond the scope of your project, the following popped: have you considered offering support for embeddedRTPS on top of POSIX/Linux for development? That’d be extremely helpful to many in this community IMHO and would allow comparison against other existing RTPS solutions out there while enhacing its portability to a wide variety of RTOSs.

That is definitely possible and we have followed that approach during the initial implementation. We used lwIP/FreeRTOS on top of Ubuntu, which also allows for unit testing. I will try to provide code for this setup as well, which will require some restructuring of the repositories. I will have to dig through some local branches.

  1. Could you share maybe a bit more about your goals and objectives with regard embeddedRTPS? Do you have an open roadmap for it? If someone wanted to jump in and help, how would best she/he do it?

We noticed that there was no portable and open-source implementation of the RTPS protocol for embedded systems and we needed one in the context of our project (UNICARagil - Home). Especially in the context ROS2 and Adaptive AUTOSAR, we wanted microcontrollers that are unable to run Linux to be first-class participants in the communication network. Especially without having to rely on other platforms to tie them into the rest of the system, which is an issue for safety-critical systems (this is the approach for DDS-XRCE).

I have mentioned some of the limitations in the repository, and I’m sure there are plenty more things to implement and improve. I will release updates to embeddedRTPS if I make bugfixes or add new features, but I don’t have a formal roadmap for now.

People are of course welcomed to jump in and help with development. For this purpose, it would be best if I first provide the lwip/FreeRTOS layer on Ubuntu as mentioned above together with some unit tests.

3 Likes

@AKampmann

Especially without having to rely on other platforms to tie them into the rest of the system, which is an issue for safety-critical systems (this is the approach for DDS-XRCE).

good catch, but i think this is really dependent on situation and use cases.

quick question, rmw_embeddedrtps is going to be ready for ROS2 user?

thanks,

2 Likes

Thanks a lot for all the answers above!

Interesting! Agreed. I reviewed your article and you cover nicely past work. There was an attempt in the past to run a full DDS implementation in a microcontroller (GitHub - ros2/ros2_embedded_nuttx: This repository isn't actively being worked on. If you would like to take over maintainership please open a ticket on https://github.com/ros2/ros2). This included also RTPS and successfully validated interoperability with Desktop versions however configuration was rather complicated, the overall size was quite big for most microcontroller platforms and latencies weren’t close to the ones you list so it sounds like a great improvement.

Out of curiosity, did you try by any chance:

  • 2x STM32 running embeddedRTPS

There’s a big latency difference and I wonder if it’s because of the use of the FastRTPS in your tests. Such test may add interesting bits.

Please ping me once you release the “lwip/FreeRTOS layer on Ubuntu” if possible. Happy to give it a try and report back on my experience.

1 Like

As far as I know FreeRTOS is almost identical to SafeRTOS. What’s blocking someone to make this functional safe?

2 Likes

I’m not familiar with SafeRTOS, but embeddedRTPS only uses some rudimentary features of FreeRTOS (basically thread/mutex functionalities). As long as these functionalities are available in SafeRTOS, it should not be complicated to make embeddedRTPS work on top of SafeRTOS.

Making the internals of embeddedRTPS functional safe is probably a greater endeavour. I assume you mean compliance with, e.g. MISRA C++? AFAIK there are some free MISRA compliance checkers, but I haven’t had a chance to try them out.

SafeRTOS is almost API compatible to FreeRTOS. The differences are explained in an upgrade document. Using SafeRTOS instead of FreeRTOS should Not be a big deal. Of course embeddedRTPS is not compliant to IEC61508-3. But someone could fork and make it compliant. The same way how Apex.AI did with ROS2.

Really interesting work. Even though officially we have Micro-ROS, but in my opinion, embeddedRTOS is a useful alternative that avoids using agent-client interface.
Is there a long term plan for this project? @AKampmann
Thank you very much.

1 Like

@huschen We will release an update that makes embeddedRTPS again compatible with latest fastDDS und that introduces support for multicast. We will also have a docker container that allows to run embeddedRTPS on Linux for development purposes. Otherwise we currently do not have a long-term plan for this project. There are a ton of QoS features that could be implemented. It would also be interesting to see if MISRA compliance could be achieved.

2 Likes

FYI, we are working on a brokerless P2P solution for Micro XRCE-DDS, micro-ROS’ middleware, which would then be inherited by micro-ROS.
Still quite prototypical, but we wish to move forward with it in the forthcoming months. For the moment, you can check it out here.

1 Like

We released an update to embeddedRTPS that restores compatibility with the latest FastDDS release and that adds multicast support.

We also now have a repo that allows to compile and run embeddedRTPS on Linux for development purposes. This repo also includes a set of unit tests.

3 Likes