ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org

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

13 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: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8916835

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 (https://www.unicaragil.de/en/). 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.

2 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,

1 Like

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 (https://github.com/ros2/ros2_embedded_nuttx). 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.