# RMW-microxrcedds implementation

**URL:** <https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727>\
**Category:** Embedded\
**Created:** [November 5, 2018, 3:17pm UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727 "2018-11-05T15:17:45Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![BorjaOuterelo](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/borjaouterelo/32/2981_2.png) [@BorjaOuterelo](https://discourse.openrobotics.org/u/BorjaOuterelo)\
**Post date:** [November 5, 2018, 3:17pm UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/1 "2018-11-05T15:17:45Z")

</div>

Hi.

We have been working on an implementation of RMW using eProsima’s Micro XRCE-DDS.  
We made this as part of OFERA project approach to embedded ROS 2.

In a nutshell, this approach consists on changing middleware implementation (from DDS to DDS-XRCE) and change the user API (using rclc) for cross-compile all the stack for the microcontroller. Currently, some tests have been done using NuttX over STM32.  
Apart from that NuttX tests, this packages work on a Linux machine without issues and using either RCLCPP or RCLC, see the provided demos to further information.

The implementation consists of a set of new packages:

[https://github.com/microROS/micro-ROS-demos](https://github.com/microROS/micro-ROS-demos)  
[https://github.com/microROS/micro-ros-agent](https://github.com/microROS/micro-ros-agent)  
[https://github.com/microROS/rosidl\_typesupport\_microxrcedds](https://github.com/microROS/rosidl_typesupport_microxrcedds)  
[https://github.com/microROS/rmw-microxrcedds](https://github.com/microROS/rmw-microxrcedds)

And modifications to the rclc.  
[https://github.com/microROS/rclc](https://github.com/microROS/rclc)

All these packages work with the existing ROS 2 stack (rcl, rmw, typesupport…).  
From these packages, rmw and typesupport have tests implemented.  
All should compile using standard colcon tools in a ROS 2 environment, colcon build, colcon test.  
You just need to add these repositories to your ROS 2 workspace.

For testing purposes, I have attached a file with all the required ROS 2 repositories and micro-ROS specific ones.

> <https://gist.github.com/BorjaOuterelo/cf7b21f46feac8b7c9a45e914ac5b531>

Once you cloned the repositories, these are the commands you may want to run to try it:

**#Build All**  
`colcon build --cmake-args -DBUILD_SHARED_LIBS=ON`  
**#configure environment variables**  
`. ~/ros2_ws/install/./local_setup.bash`  
**#Run agent node**  
`~/ros2_ws/install/uros_agent/lib/uros_agent/uros_agent udp 8888`  
**#Run rclcpp demo publisher**  
`~/ros2_ws/install/complex_msg_publisher_cpp/lib/complex_msg_publisher_cpp/complex_msg_publisher_cpp`  
**#Run rclc demo publisher**  
`~/ros2_ws/install/complex_msg_publisher_c/lib/complex_msg_publisher_c/complex_msg_publisher_c`  
**#Run rclcpp demo subscriber**  
`~/ros2_ws/install/complex_msg_subscriber_cpp/lib/complex_msg_subscriber_cpp/complex_msg_subscriber_cpp`  
**#Run rclc demo subscriber**  
`~/ros2_ws/install/complex_msg_subscriber_c/lib/complex_msg_subscriber_c/complex_msg_subscriber_c`

Furthermore, you can run Micro ROS packages tests with:

`colcon test --packages-select rosidl_typesupport_microxrcedds_c rosidl_typesupport_microxrcedds_c_tests rosidl_typesupport_microxrcedds_cpp rosidl_typesupport_microxrcedds_cpp_tests rosidl_typesupport_microxrcedds_test_msg rmw_microxrcedds`

All these packages are work in progress and will be updated and extend API. Currently, only publish/subscribe API has been implemented.  
Currently working on polishing a NuttX build system.

---

<div class="post-metadata">

**Author:** ![gbiggs](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/gbiggs/32/30361_2.png) [@gbiggs](https://discourse.openrobotics.org/u/gbiggs)\
**Post date:** [November 5, 2018, 3:36pm UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/2 "2018-11-05T15:36:22Z")

</div>

Great work!

Could you give a run-down on the major differences between libraries you have produced and their equivalents from the github/ros2 organisation (where there are equivalents)? I’m thinking in particular of microROS/rclc.

---

<div class="post-metadata">

**Author:** ![BorjaOuterelo](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/borjaouterelo/32/2981_2.png) [@BorjaOuterelo](https://discourse.openrobotics.org/u/BorjaOuterelo)\
**Post date:** [November 5, 2018, 6:07pm UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/3 "2018-11-05T18:07:23Z")

</div>

Hi @gbiggs.

The correspondence of the libraries with existing ones is:

`microROS/rmw-microxrcedds` \<=\> `ros2/rmw_fastrtps`  
`microROS/rosidl_typesupport_microxrcedds` \<=\> `ros2/rosidl_typesupport_fastrtps`

`microROS/micro-ROS-demos` \<=\> `ros2/demos`  
Not really sure about this last one. But, It is just a package with some dummy samples and different likewise “hello world” code.

`microROS/micro-ROS-Agent` does not have equivalent or similar in ROS 2.

Regarding RCLC. This is just a fork with small modifications. We have some issues with this package while using our cross-compiling toolchain and building on windows. The intention of this fork, besides enabling the compilation, is to expand its implementation to include more of the ROS 2 concepts, thinking on services or timers.  
However, this rclc expansion could be stopped, as a few days ago I found that RCLC is listed on Crystal roadmap, [https://index.ros.org/doc/ros2/Roadmap/](https://index.ros.org/doc/ros2/Roadmap/), so ideally we will embrace that future RCLC.

Anybody knows something about that RCLC on the roadmap?.

Hopefully, this answers your questions.

---

<div class="post-metadata">

**Author:** ![Kei](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/kei/32/1571_2.png) [@Kei](https://discourse.openrobotics.org/u/Kei)\
**Post date:** [November 20, 2018, 2:22am UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/4 "2018-11-20T02:22:19Z")

</div>

Hi, @BorjaOuterelo

eProsima’s Micro-XRCE-DDS(version 1.0.1) requires FastRTPS 1.7.0.  
However, rmw\_fastrtps is not currently in version 1.7.0.  
If I use rmw-microxrcedds, can I use Micro-XRCE-DDS version 1.0.1 without problems?

---

<div class="post-metadata">

**Author:** ![BorjaOuterelo](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/borjaouterelo/32/2981_2.png) [@BorjaOuterelo](https://discourse.openrobotics.org/u/BorjaOuterelo)\
**Post date:** [November 20, 2018, 3:52pm UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/5 "2018-11-20T15:52:41Z")

</div>

Hi @Kei.

rmw-microxrcedds depends on Micro XRCE-DDS Client v1.0.1.  
micro-ROS Agent depends on Micro XRCE-DDS Agent v1.01, so the dependency with FastRTPS 1.7.0 is here, on the agent side.  
This force you to use FastRTPS 1.7.0 on your ROS 2 workspace where you want the micro-ROS Agent running.

You can check that there is an ongoing pull request to upgrade ROS 2 repositories to that version:  
[https://github.com/ros2/rmw\_fastrtps/pull/233](https://github.com/ros2/rmw_fastrtps/pull/233)

From that you can get Dirk’s list of ros2.repos used for testing:  
[https://gist.githubusercontent.com/dirk-thomas/e377d8de1d8d7d41e15e1955a46f96c9/raw/dc498ab63c038df358bd2c0ccfad86dc0e0615cb/ros2.repos](https://gist.githubusercontent.com/dirk-thomas/e377d8de1d8d7d41e15e1955a46f96c9/raw/dc498ab63c038df358bd2c0ccfad86dc0e0615cb/ros2.repos)

Note the following changes in ros2.repos:

Fast-RTPS

```
Branch: release/1.7.0

```

rmw\_fastrtps

```
Repo: https://github.com/eProsima/rmw_fastrtps.git
Branch : fastrtps-1.7.0

```

Hopefully, this clarifies a bit on the dependencies.

Although, on this repository specific to micro-ROS, there are lists of repositories for agent and client side:

[https://github.com/microROS/micro-ROS-doc/tree/master/repos](https://github.com/microROS/micro-ROS-doc/tree/master/repos)

If you have any other question, I will be glad to help.

---

<div class="post-metadata">

**Author:** ![Kei](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/kei/32/1571_2.png) [@Kei](https://discourse.openrobotics.org/u/Kei)\
**Post date:** [November 21, 2018, 4:06am UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/6 "2018-11-21T04:06:36Z")

</div>

Thanks @BorjaOuterelo,

There are some problems (include path etc …) due to different submodule commit information of agent and commit information of FastRTPS release/1.7.0 branch, but I will leave an issue in eProsima’s Github.

Anyway, the information you gave me widened the possibilities I could! Thank you!

---

<div class="post-metadata">

**Author:** ![christian](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/christian/32/14876_2.png) [@christian](https://discourse.openrobotics.org/u/christian)\
**Post date:** [December 7, 2018, 11:44pm UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/7 "2018-12-07T23:44:51Z")

</div>

It’s nice to see work on interfacing microcontrollers with a standard protocol.

From the current documentation of eProsima’s Micro-XRCE-DDS, only Windows and POSIX APIs (Linux, Nuttx, …) are supported. Are there plans to support the serial protocol on 8bit Arduinos and bare metal STM32?

Especially the ATmega328 with it’s 32KB flash and 2KB SRAM (that’s what I call an extremely resource constrained environment) would make a nice demonstration of the DDS-XRCE serial protocol.

---

<div class="post-metadata">

**Author:** ![BorjaOuterelo](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/borjaouterelo/32/2981_2.png) [@BorjaOuterelo](https://discourse.openrobotics.org/u/BorjaOuterelo)\
**Post date:** [December 19, 2018, 6:58am UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/8 "2018-12-19T06:58:29Z")

</div>

Hi @christian

Currently, Micro XRCE-DDS supports defining user-custom transports so it would not be difficult to support new platforms, APIs.  
Regarding memory footprint and size, Micro XRCE-DDS could be customised with user configurations so you can tune it to fit in smaller platforms. On our minimal test we measured 2.5KB of SRAM usage, but as I mentioned it could be customized per application.

Currently or lower-end supported-tested platform is the same as for micro-ROS: STM32L1 Discovery. 256KB flash and 32KB of SRAM.

Though, We haven’t tested it on 8bits platforms but could be an interesting test.  
Are you currently using it on such platforms?.  
Have you identified any possible failling or improvement point for such platforms?

---

<div class="post-metadata">

**Author:** ![christian](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/christian/32/14876_2.png) [@christian](https://discourse.openrobotics.org/u/christian)\
**Post date:** [December 21, 2018, 12:24am UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/9 "2018-12-21T00:24:11Z")

</div>

@BorjaOuterelo I am primarily interested in using micro-ROS on a bare metal STM32F103 for serial communication with a companion PC. But it would be beneficial if the same serial protocol and agent could be reused as a replacement for [`rosserial_arduino`](http://wiki.ros.org/rosserial_arduino) to communicate with the widely used Arduino platform.  
I.e. if micro-ROS is not capable of running on an Arduino (ATmega328), the ROS community would need to look into alternative approaches like porting `rosserial` to ROS2.

---

<div class="post-metadata">

**Author:** ![BorjaOuterelo](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/borjaouterelo/32/2981_2.png) [@BorjaOuterelo](https://discourse.openrobotics.org/u/BorjaOuterelo)\
**Post date:** [December 26, 2018, 8:16am UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/10 "2018-12-26T08:16:02Z")

</div>

@christian for STM32F103 depending on the available SRAM, you should not find many issues using micro-ROS.  
Currently, we are targeting STM32L152 as our lower-end devices.  
We are still working on some size issues but will get there eventually.

For Arduino platforms, to be honest, we haven’t tried it on 8Bit microcontrollers but if it has enough SRAM, it might work but need thoughtful testing. Currently, micro-ROS is going to need a bit of size reduction work but vanilla Micro XRCE-DDS middleware should fit into an Arduino.

Ideally, micro-ROS underlying middleware implementation, Micro XRCE-DDS, could mimic rosserial behaviour, actually, we have improvements on our roadmap in that same direction, so with the aforementioned Micro XRCE-DDS improvements and if we manage to shrink micro-ROS to fit into an Arduino that will be possible.

---

<div class="post-metadata">

**Author:** ![tomoya](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@tomoya](https://discourse.openrobotics.org/u/tomoya)\
**Post date:** [February 8, 2019, 6:58am UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/11 "2019-02-08T06:58:48Z")

</div>

@BorjaOuterelo

great work! sorry i miss this thread, been a long time.

i understand agent can be working as “bridge”, right?  
and one thing i want to confirm, is there any constraints or limitation on microROS side?

thanks

---

<div class="post-metadata">

**Author:** ![BorjaOuterelo](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/borjaouterelo/32/2981_2.png) [@BorjaOuterelo](https://discourse.openrobotics.org/u/BorjaOuterelo)\
**Post date:** [February 14, 2019, 11:00am UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/12 "2019-02-14T11:00:07Z")

</div>

Hi @tomoya

> [@tomoya](#):
>
> i understand agent can be working as “bridge”, right?

Right, Agent acts on behalf of the clients on the DDS network.

> [@tomoya](#):
>
> is there any constraints or limitation on microROS side?

What do you mean with “microROS side”? If you mean client, there is no strong limitation or constrain apart from the aforementioned ones of SRAM usage and the currently supported platforms, but for the latter, the user can easily port to their platform.  
Does this respond to your question? Or you are thinking about another kind of limitation?

---

<div class="post-metadata">

**Author:** ![braineniac](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/braineniac/32/3004_2.png) [@braineniac](https://discourse.openrobotics.org/u/braineniac)\
**Post date:** [February 27, 2019, 10:21pm UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/13 "2019-02-27T22:21:58Z")

</div>

@BorjaOuterelo

Awesome work. I have been looking for exactly something like this. I am a bit of a noob, but I will try to use this on my STM32F446RET6 and experiment with different sensors.  
Will this be eventually used in ROS2 and can it be ported to ROS1? All the official documentations point to the old repos from 2016ish times and were abandoned.

---

<div class="post-metadata">

**Author:** ![tomoyafujita](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/tomoyafujita/32/6097_2.png) [@tomoyafujita](https://discourse.openrobotics.org/u/tomoyafujita)\
**Post date:** [March 2, 2019, 7:11am UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/14 "2019-03-02T07:11:18Z")

</div>

@BorjaOuterelo

yes it does, thanks.

---

<div class="post-metadata">

**Author:** ![BorjaOuterelo](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/borjaouterelo/32/2981_2.png) [@BorjaOuterelo](https://discourse.openrobotics.org/u/BorjaOuterelo)\
**Post date:** [March 6, 2019, 9:45am UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/15 "2019-03-06T09:45:04Z")

</div>

Hi, @tomoyafujita I am just curious about your use case. Can you share with us further information?

---

<div class="post-metadata">

**Author:** ![BorjaOuterelo](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/borjaouterelo/32/2981_2.png) [@BorjaOuterelo](https://discourse.openrobotics.org/u/BorjaOuterelo)\
**Post date:** [March 6, 2019, 9:51am UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/16 "2019-03-06T09:51:18Z")

</div>

Hi @braineniac.

Currently, it works with ROS 2 as it relays on DDS for the communications. Porting to ROS1 will need a different Agent implementation, we are working on changes on micro XRCE-DDS side in that direction. We will make that public soon.  
micro XRCE-DDS is the underlying middleware implementation, to clarify.

> All the official documentations point to the old repos from 2016ish times and were abandoned.

I am not sure which repositories you refer here. Can you point me to them?

---

<div class="post-metadata">

**Author:** ![braineniac](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/braineniac/32/3004_2.png) [@braineniac](https://discourse.openrobotics.org/u/braineniac)\
**Post date:** [March 6, 2019, 10:52am UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/17 "2019-03-06T10:52:25Z")

</div>

I meant projects that put ROS on a microcontroller with an RTOS other than rosserial. This is what I found after googling a bit:

> **[sig/Embedded - ROS Wiki](https://wiki.ros.org/sig/Embedded)**

> **[FreeRTPS+FreeRTOS - ROS Wiki](https://wiki.ros.org/FreeRTPS%2BFreeRTOS)**

Also the code from bosch comes up often:  
[https://github.com/bosch-ros-pkg/stm32](https://github.com/bosch-ros-pkg/stm32)

The only place I could find any information about microROS is this discourse topic.

---

<div class="post-metadata">

**Author:** ![tomoyafujita](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/tomoyafujita/32/6097_2.png) [@tomoyafujita](https://discourse.openrobotics.org/u/tomoyafujita)\
**Post date:** [March 7, 2019, 2:28am UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/18 "2019-03-07T02:28:30Z")

</div>

Hi @BorjaOuterelo

i don’t have any solid usecase for now, sorry about that.  
but off the top of my head, it would be like some nodes running DDS, and for really small “IoT” nodes would use DDS XRCE. Does that answer your question?

thanks,

---

<div class="post-metadata">

**Author:** ![tomoyafujita](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/tomoyafujita/32/6097_2.png) [@tomoyafujita](https://discourse.openrobotics.org/u/tomoyafujita)\
**Post date:** [June 18, 2019, 1:34am UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/19 "2019-06-18T01:34:05Z")

</div>

Hi All, (microROS related guys)

just saying since we are not sure to squeeze out of the resource yet.

would it be good if we Sony integrate [microROS](https://github.com/microROS) into [spresense](https://developer.sony.com/develop/spresense/)?  
or is there anyone already start working on that?

any comments and ideas will be really appreciated.

thanks

---

<div class="post-metadata">

**Author:** ![BorjaOuterelo](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/borjaouterelo/32/2981_2.png) [@BorjaOuterelo](https://discourse.openrobotics.org/u/BorjaOuterelo)\
**Post date:** [June 18, 2019, 5:23am UTC](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727/20 "2019-06-18T05:23:15Z")

</div>

Hi @tomoyafujita.

> would it be good if we Sony integrate [microROS](https://github.com/microROS) into [spresense](https://developer.sony.com/develop/spresense/)?

That will be great, actually.  
I am not aware of anybody working on that.

I see you are using NuttX, that’s already supported so Ideally, you won’t find many hurdles. Anyway, If you need support or have any specific questions; we at micro-ROS, are happy to help.

[Next page](https://discourse.openrobotics.org/t/rmw-microxrcedds-implementation/6727.md?page=2)
