Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded ROS 2 Design Page #197

Open
wants to merge 58 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
accff53
Created empty article page on embedded ROS2.
ralph-lange Oct 9, 2018
893091b
Added draft for abstract by Ingo Luetkebohle (iluetkeb).
ralph-lange Oct 9, 2018
cedde5a
Very first structure of sections to fill.
ralph-lange Oct 10, 2018
60e33ea
Added first ideas for requirements to list and discuss.
ralph-lange Oct 10, 2018
700a63e
Link to ofera.eu for detailed requirements document.
ralph-lange Oct 10, 2018
d28deab
Refined structure and added first descriptions to existing approaches.
ralph-lange Oct 10, 2018
3f83435
Added proposed architecture diagram.
BorjaOuterelo Oct 11, 2018
ca5f353
Changes svg for png format.
BorjaOuterelo Oct 11, 2018
1d4a7ae
First draft of the basic requirements.
ralph-lange Oct 11, 2018
2f8a74d
Merge branch 'embedded_ROS2' of https://github.com/microROS/design in…
ralph-lange Oct 11, 2018
dc679e1
Refined list of authors.
ralph-lange Oct 12, 2018
bf0c260
Added link to micro-ROS webpage.
ralph-lange Oct 12, 2018
d147268
Minor rewording and ROS 2 instead of ROS2
vmayoral Oct 12, 2018
08b395d
Integrate consistently ROS 2 and ROS 1 approaches
vmayoral Oct 12, 2018
2b92211
Updates architecture diagram.
BorjaOuterelo Oct 15, 2018
03bfeaa
Merge pull request #1 from microROS/feature/architecture_change
iluetkeb Oct 15, 2018
36d4a85
Fix my name
iluetkeb Oct 15, 2018
3d6bc35
Reformat requirements as table.
iluetkeb Oct 15, 2018
778a574
also mark the items as 'wish' (with a w), instead of 'r' for requirement
iluetkeb Oct 15, 2018
1f9efd9
initial questions and actions
iluetkeb Oct 15, 2018
0d98ce2
Do not use continuation words in the table.
iluetkeb Oct 16, 2018
8955efd
Merge pull request #2 from microROS/embedded_ROS2_tables
iluetkeb Oct 16, 2018
6270d68
Added details on other prior and on-going works.
ralph-lange Oct 17, 2018
177be06
Refs #2616. Fixes deliverable link.
BorjaOuterelo Oct 17, 2018
2ee4c04
Documented other existing/on-going ROS2-based approaches.
ralph-lange Oct 17, 2018
58c9a0a
Changed micro-XRCE-DSS to Micro XRCE-DDS
ralph-lange Oct 17, 2018
910bc9f
Notice on the fact that freeRTPS has obviously been discontinued in 2…
ralph-lange Oct 17, 2018
d16ab73
Included figure features_with_dependencies.png in embedded ROS 2 arti…
ralph-lange Oct 18, 2018
9dd5336
Formulated labels more generic.
ralph-lange Oct 18, 2018
3cb52bc
Merge pull request #3 from microROS/feature/deliverable_link
BorjaOuterelo Oct 20, 2018
02785a1
Fixed micro-ROS urls.
ralph-lange Oct 23, 2018
0a8126c
Merge pull request #4 from microROS/embedded_ROS2_on-going_works
ralph-lange Oct 23, 2018
8c6f414
Minor rewording
vmayoral Oct 23, 2018
b349d12
BLE is beyond our scope, I'd suggest to mention 6LoWPAN instead
vmayoral Oct 23, 2018
d6bd89a
Review wishlist, add boot and infomodel
vmayoral Oct 23, 2018
282ae35
Refs #3569. Middleware notes:
BorjaOuterelo Oct 20, 2018
4511b35
Minor addition in actions, review ROS 2 prior
vmayoral Oct 23, 2018
684f076
Refs #3569. Extends on some ROS 2 based approaches.
BorjaOuterelo Oct 20, 2018
a474fc7
Refs #3569. Adds Renesas GR-ROSE platform.
BorjaOuterelo Oct 22, 2018
2f2106f
Update articles/embedded.md
iluetkeb Oct 23, 2018
08d7cf3
Address @iluetkeb's request
vmayoral Oct 23, 2018
fcf4fcc
Refs #3569. Resolves pull requests comments:
BorjaOuterelo Oct 23, 2018
3971660
Fix typo
adamdbrw Oct 23, 2018
72a89d2
Rephrasing in INFOMODEL.
adamdbrw Oct 23, 2018
de0fd3f
Fix issue with URL
vmayoral Oct 23, 2018
71254e8
Merge branch 'alr-review1' of https://github.com/microROS/design into…
vmayoral Oct 23, 2018
2646d7d
Merge pull request #6 from microROS/alr-review1
Oct 24, 2018
a36e9c8
Refs #3569. Makes the text consistent.
BorjaOuterelo Oct 24, 2018
62f638e
Merge pull request #5 from microROS/feature/expanddesign
BorjaOuterelo Oct 24, 2018
79b9a42
Bold H-ROS prior work to be consistent
vmayoral Oct 24, 2018
3c23e09
Merge pull request #7 from microROS/alr_review2
iluetkeb Oct 24, 2018
9c08049
Update embedded.md
iluetkeb Oct 27, 2018
b3b2f66
Reformatted non-table parts to comply with short-line requirement.
iluetkeb Oct 27, 2018
7916600
Final set of reformattings to achieve short lines.
iluetkeb Oct 27, 2018
e7e02bb
Refs #3512. Adds references to new ROS 2 integration initiatives.
BorjaOuterelo Oct 29, 2018
19eddb4
Refs #3512. Joins ros2arduino to related Robotis initiative.
BorjaOuterelo Oct 29, 2018
2b7cb6c
Remove wording which might imply that re-implementing rmw/rcl is a goal
iluetkeb Nov 1, 2018
4d6026a
Merge pull request #8 from microROS/feature/addnewros2
iluetkeb Nov 2, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
318 changes: 318 additions & 0 deletions articles/embedded.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,318 @@
---
layout: default
title: Embedded ROS 2.0
abstract:
This article captures requirements, design ideas and related works on a tiny ROS 2.0 stack for microcontrollers.
published: true
author: 'In alphabetic order: [Adam Dąbrowski](https://github.com/adamdbrw), [Borja Outerelo](https://github.com/BorjaOuterelo), [Ingo Lütkebohle](https://github.com/iluetkeb), [Ralph Lange](https://github.com/ralph-lange), [Víctor Mayoral Vilches](https://github.com/vmayoral), ... and many more from Embedded ROS 2 Interest Group. Please feel free to add your name.'
---

{:toc}

# {{ page.title }}

<div class="abstract" markdown="1">
{{ page.abstract }}
</div>

Original Author: {{ page.author }}

While ROS 2 can run on Linux-class embedded devices, smaller
microcontrollers (MCU) are still a challenge. For example, ARM Cortex-M3
and -M4 class MCUs are popular for motion control and sensor integration,
but have little RAM and storage. ARM Cortex-M3 is widely used in many
sensors due to its optimized power consumption capabilities and ultra low
power modes. These microcontrollers are often running with small batteries,
e.g. for environmental sensors or small consumer robots, which requires
efficient power management. The embedded ROS 2 effort addresses these devices.

This article documents feature wishes, requirements, design ideas and
related work on this undertaking.

## Important Differences / Assumptions

One of the major difference for the embedded stack is to be able to
run not (only) on Linux, but also on Real-Time Operating Systems, or
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a reason why the existing ROS 2 code couldn't run on a Real-Time Operating Systems? I guess this is aiming for a very specific sub-category of OSes. Maybe it makes sense to state them here explicitly.

Copy link
Author

@iluetkeb iluetkeb Dec 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The answer to this depends on what you mean by "existing ROS 2". See our design diagram for the layers we expect to be able to re-use.

In more detail:

  • We expect that RCL and RMW can run on RTOS's with POSIX APIs when targeting devices with at least 32kB of RAM. Some modifications might be useful to make them run better, but that's a different topic.
  • DDS cannot run on most target devices, as is well known, hence the use of XRCE-DDS. This then also excludes the corresponding rmw_ and type_support_ layers implementations. We did rmw_ and type_support_ implementations based on Micro-XRCE-DDS, however, so in principle this runs.
  • rclcpp is tricky, because of the C++ standard library, which is large and not trivial to port. Borja from eProsima did some experiments with libcxx and it doesn't look too bad, but there's also a few issues. Moreover, it might take so much FLASH and RAM that most people want to avoid it. This is something where we still need more benchmarks. An alternative might be rclc.

After that, we get into the realm of libraries above rclcpp.

  • TF is important, and I've already done a bit of work on that, with more to come in early 2019. Most likely I will produce a stripped down 'C' version, so that we don't require rclcpp just for TF.
  • Executors could also benefit from specific support, as mentioned above

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding TF on embedded systems, have you checked the https://github.com/ESROCOS/tools-transformer library from the ESROCOS (https://www.h2020-esrocos.eu/) European project?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@traversaro: that seems to be C++ based?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@traversaro thanks for the hint, I wasn't aware of that but will check it out. are you involved with the project, so that I could ask you about it?

@gavanderhoorn C++ is not strictly impossible, most embedded compilers support it. what's more problematic is the standard library. but yeah, it's always something to look critically at, unfortunately (I usually prefer C++ over 'C' due to its better consistency features, but have had to accept that it can be an issue).

Copy link

@traversaro traversaro Dec 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@traversaro thanks for the hint, I wasn't aware of that but will check it out. are you involved with the project, so that I could ask you about it?

I am not involved with the project at all, but I learned a lot about it by reading the deliverables, that are detailed but readable documents: https://www.h2020-esrocos.eu/publications/deliverable-documents/ .

@traversaro: that seems to be C++ based?

It is indeed C++, but if I remember correctly from the deliverable is meant to run on the top of RTEMS or similar OS, so I think it is still worth checking it out.

even "bare metal" (no OS).

## Wishlist

A number of things that would be great to have, lets call it a wishlist. Feel free to add stuff ;-)

### W-SEAMLESS: *Seamless integration with ROS&nbsp;2*

Support all the communication and configuration mechanisms expected,
e.g. topics, services, parameters (including dynamic modification),
the life-cycle, etc.

It should not be noticeable to the rest of the system that part of
it runs on a micro-controller.

### W-PORTABILITY: *Portability of ROS 2-based software*

Use the same API as on ROS 2.

Note that the feasibility of this wish has been questioned.

### W-DEVICES *Support of a broad spectrum of device classes*

Support a broad range of MCU device classes, starting from a
few tens kilobyte of RAM, up to megabytes.

### W-RTOS: *Support of a broad spectrum of RTOS(s)*

The stack shall be adaptable to different RTOS (e.g., NuttX, FreeRTOS,
Zephyr) and provide abstractions with regard to the application
software to facilitate porting application components to between RTOSs.
iluetkeb marked this conversation as resolved.
Show resolved Hide resolved

### W-COMM: *Support of prevalent communication technologies*

To cover the broad range of use-cases for MCUs in robotics, the embedded
ROS 2 stack shall be usable with the default ROS 2 middleware standard
DDS, simple (custom) serial communication protocols just as common
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imo the statement "usable with" is not specific enough in terms of goals. In the meaning of "compatible with on the wire" there is simple no other choice than DDS. In the meaning of "compatible using e.g. a bridge" I don't see much value in mentioning it - that part is explicitly covered by W-SEAMLESS. Technically even ROS 1 is compatible in that sense using the ros1_bridge.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's meant here is "usable" in the same way that you can exchange rmw_-implementations now.

Not sure how to rephrase that so it becomes clearer. Maybe just mentioning rmw would do the trick? Other suggestions welcome.

wireless technologies like 6LoWPAN
iluetkeb marked this conversation as resolved.
Show resolved Hide resolved

### W-MODULARITY: *High Modularity*

The embedded ROS 2 stack shall be highly modular, not only to allow for
adaptation to specific hardware features and different RTOS, but also to
allow the integration with existing frameworks and to be able to create
customized sub-stacks. For example, it shall be usable in the style of
rosserial, thus bringing basically the message serialization to the MCU
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are use cases that are only satisfiable using a rosserial-style approach, then I think a better approach is to create a rosserial2 for those and improve the existing ROS2 stack for the rest.

only. Similarly, it should be possible to derive a sub-stack that provides
node graph features and publish/subscribe but no parameters and services,
Copy link
Member

@gbiggs gbiggs Oct 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems doable with rcl.

Enabling developers to save resources "by picking only those features they really need" is something that would be useful at any scale. It would need some modifications to rmw/rcl to support there, for example, changes in library structure, or using compile-time flags to enable/disable features. The potential impact of these changes needs to be analysed. rcl already has separate libraries for lifecyle nodes and actions and while I don't like the current layout of the APIs in regards to this separation, structurally this is clearly possible.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On embedded, we don't have to have compile-time flags for that, because linking can often be static, and then the linker will only pull in the functions which are actually referenced.

I'm not sure we want this for the shared library case, but if there are use cases, that would be a separate discussion, IMHO.

and so on.

### W-CONTROL: *Support control-oriented applications*

MCUs are great for control, and micro-ROS should be as well. This usually
means hard real-time performance with low jitter and small response times.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this already a goal for rcl, and at least partly achieved? And it's a desirable feature at any scale.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This goes across the stack. Current issues are:

  1. The use of locking (usually with mutexes) in some middleware implementations
  2. The allocation of memory at runtime

The first is not an rcl issue as such, but important nonetheless. The second could be addressed using allocation from a static block (which is what rcl currently suggests, AFAICT), but it is not clear this is an ideal approach. It definitely leads to more error handling than doing this at compile-time.


iluetkeb marked this conversation as resolved.
Show resolved Hide resolved
### W-POWER *Make low-power modes possible*

MCUs are often used in battery-powered applications, and/or in applications
with a large amount of standby time. Therefore, the stack should make it
easily possible to save power.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if I have a reasonably large processor in my robot, I may still want it to be capable of using low power modes and generally be power-efficient. A scifi humanoid robot butler would spend a lot of time standing around and should do so in low-power mode.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. One common use case would be robotic vacuums -- they typically move only one hour per day, and spend the rest idling.

The thing is, on the high level we can often turn the whole processor off indefinitely. This makes it fairly easy to address. On the MCU side, we need to keep at least some functions running, e.g. those monitoring the battery.


### W-STATIC: *Use static initialization*

Static initialization is less error-prone, easier to analyze, and shifts
memory usage from RAM to flash. It is a requirement for going to very small
resource use.
Copy link
Member

@gbiggs gbiggs Oct 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also a requirement for safety-critical systems that are large. This item is good to be able to do in rmw/rcl as well. It would be better to enable it there than create a separate software stack.

It's worth adding a note here that static initialisation extends to initialising the entire distributed system with a known layout of nodes, topics, etc. that does not change at run time.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's worth adding a note here that static initialisation extends to initialising the entire distributed system with a known layout of nodes, topics, etc. that does not change at run time.

Yes, that's exactly what we mean here, and that's a big change for rcl, because currently it expects to allocate these at runtime.

In our embedded prototypes, we do this using preprocessor macros. Other systems also code generation for this part.

Maybe I should add some more text in the document, explaining why that is difficult to do with rcl/rmw currently, and what other options we have.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's exactly the sort of information we need.


### W-BOOT: *Quick boot times compared to native ROS 2 machines*

Microcontrollers provide with the capability of booting very quickly
(typically, in the order of tenths of milliseconds or less). This enhances
the existing landscape of ROS 2-native devices which in the best cases,
require a few seconds to boot an embedded Linux.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any improvements to initialisation times for the existing ROS2 stack are going to be welcomed by anyone working at any scale.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is important to know where this comes from. Some of the main ingredients are:

  1. Know your hardware at compile time (so, no probing for addresses, no trying unused drivers)
  2. Compile everything statically (so, no symbol remapping at load time)
  3. No use of hardware which takes long to initialize

And then there is making sure that each node's initialization method runs fast, which is not a framework issue as such.

This is just to say: Don't expect miracle from this work on your Linux box ;-)


### W-INFOMODEL: *A common interface that facilitates interoperability across different vendors*

An information model for robot devices, adapted by vendors of robot modules,
would lower costs of integration of robotic systems. Within the OFERA project
we propose and use the
[Hardware Robot Information Model (HRIM)](https://acutronicrobotics.com/modularity/hrim/).|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something that all of ROS2 should be using.



## Questions

To determine how feasible that is, and to come up with the actual
requirements and/or design, a few questions come to mind. We've
cross-referenced them to the relevant wishlist items (most of the
time there's more than one -- this suggests areas where trade-offs
may be required, or alternatives pursued).


### Q-RTOS: *Which RTOS(s) do we use as the basis?*

#### Related: W-RTOS, W-PORTABILITY

### Q-BUILD: *How do we handle the RTOS(s) respective build-systems?*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can plugins for colcon support them? Although I know that there are many embedded devices with annoying Windows-only tool chains.

Copy link
Author

@iluetkeb iluetkeb Nov 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. The general issue is that you might need headers from the RTOS, and those can come with a lot of preprocessor magic set by their build systems. It may be possible to create a config.h or similar, but this remains to be investigated.

Here's what I know:

  • For FreeRTOS, you usually include it in the app, so no issue there
  • For Arduino, you could invoke Arduino's build_platfrom from colcon, but it expects some stuff to be copied to the Arduino workspace, so you at least need to know needs to be copied there
  • NuttX has its own build-system similar (or even the same, not sure) as the Linux one. It creates a config.h and then uses a regular Makefile infrastructure to compile. It also expects applications to reside in an "apps" directory. There's also some dynamic loading capability, but not sure how that works.
  • Zephyr uses CMake, so should be easy to integrated
  • Not sure about RIOT, @vmayoral might know more.


#### Related: W-RTOS, W-PORTABILITY

### Q-LANG: *Which language(s) should be used, and at what spec level?*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least in Japan, C is still the dominant language for embedded, even though C++ is perfectly usable. More of a problem is that embedded device compilers tend to be really far behind the standards.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For most of the devices we target, there's a gcc version, so we can compile C++. However, we do not always have a libstdc++, and if there is one, it can be old.

Currently, @BorjaOuterelo is trying out libcxx from the LLVM ecosystem.


#### Related: W-PORTABILITY

### Q-API: *How should the API look in general?*

#### Related: W-PORTABILITY, W-MODULARITY, W-STATIC, W-POWER

### Q-PERF: * What are the performance implications of the API?*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are performance problems in the rmw or rcl APIs, then I'd like to see those fixed there rather than making a new implementation with a different API.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are trade-offs here. For example, if you do everything at runtime, you're flexible, but often slower and more error-prone. Just saying...


#### Related: W-PORTABILITY, W-DEVICES, W-CONTROL, W-STATIC

### Q-COMM: *Which communication/middleware technology is used?*

#### Related: W-COMM, W-SEAMLESS


## Analyse and Experiment Actions

To answer these questions, the OFERA EU project as well as several
others have already undertaken or are planning exploratory work.

*Meta-Note*: Please only add a short description here, linking to
more detailed pages if necessary.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need at least a short description of the results/conclusions of these experimental actions.


### A-RTOS: *RTOS Proof-of-Concept*

#### Questions: *Q-RTOS*

Provide a proof-of-concept RTOS. In the OFERA project, we chose
[NuttX](http://nuttx.org/), because it is largely POSIX compatible
and thus eases porting. There are also experiments based on
[RIOT](https://www.riot-os.org/) (cf.
[github.com/astralien3000/riot-ros2](https://github.com/astralien3000/riot-ros2))
and FreeRTOS (cf.
[github.com/ros2/ros2_embedded_freertos](https://github.com/ros2/ros2_embedded_freertos)) |

### A-BUILD-META: *Meta-Build*

#### Questions: Q-BUILD

Explores a meta-build approach to transform ROS 2 CMakeLists.txt to
RTOS-specific build instructions. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A CMake generator for each RTOS platform?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake generators are written in C++, and not so trivial...

At ROSCon, @vmayoral and team have presented an approach for this, which is based on transforming CMake using CMake ;-)


### A-BUILD-NUTTX: *NuttX-specific build*

#### Questions: Q-BUILD

OFERA has integrated (parts of) micro-ROS directly as an app and
as a library in the NuttX build.

### A-BUILD-ARDUINO: *Arduino Build*

### Questions: Q-BUILD

ROBOTIS has explored building all the libraries using the Arduino
IDE, cf. [github.com/ROBOTIS-GIT/OpenCR](https://github.com/ROBOTIS-GIT/OpenCR/tree/feature-ros2-micrortps).
This required some manual changes and thus does not scale, but
can get you off the ground.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we fix the need for manual changes?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is related to the build-system issue. Once we got that covered, this goes away.


### A-NUTTX-LIBCXX: *C++11/higher support for NuttX*

#### Questions: Q-LANG

Build libxx from the LLVM project on NuttX, as a pre-requisite to building rclcpp.

### A-PERF-RCLCPP-RESOURCE: *Determine resource use of rclcpp*

#### Questions: Q-PERF

There are doubts whether rclcpp can really fit tiny MCUs, but we'll only
know once we tried and measured it.
iluetkeb marked this conversation as resolved.
Show resolved Hide resolved

### A-DDS-XRCE: *Use of DDS-XRCE standard protocol*

#### Questions: Q-COMM

This OMG standard defines a protocol for use by microcontrollers to
publish and subscribe data to a DDS Domain, standard in ROS 2. OFERA
and ROBOTIS have demonstrated that it is a suitable protocol to seamlessly
communicate with microcontrollers. See [DDS-XRCE](https://www.omg.org/spec/DDS-XRCE/)
iluetkeb marked this conversation as resolved.
Show resolved Hide resolved

### A-Micro-XRCE-DDS: *Micro-XRCE Middleware usage*

#### Questions: Q-COMM

OFERA, Robotis and others have integrated Micro XRCE-DDS middleware as
part of their solutions. This middleware provides an implementation of
DDS-XRCE standard. Integrations have been done on top of different RTOSs,
NuttX and FreeRTOS and using different underlying transports.

See [Micro XRCE-DDS](https://github.com/eProsima/Micro-XRCE-DDS) |
iluetkeb marked this conversation as resolved.
Show resolved Hide resolved

## Prior and on-going works

### ROS2-based approaches
* [**EU project OFERA**](http://ofera.eu/): The EU project OFERA
(Open Framework for Embedded Robot Applications) aims at a ROS 2-compatible
stack for MCUs in the range of STM32F4 or STM32L1, i.e. with possibly less
than 100kB RAM. The project partners currently investigate of using the
ROS 2 rmw, rcl and rclcpp layers as-is on the Micro XRCE-DDS implementation
iluetkeb marked this conversation as resolved.
Show resolved Hide resolved
of the upcoming XRCE-DDS standard. In parallel, a more modular approach in
the style of rosserial is investigated. In the project's use-cases, NuttX
is considered as primary choice for the RTOS. Beyond the project page,
additional details of the project results can be found at
[microros.github.io/micro-ROS/](https://microros.github.io/micro-ROS/).

* [**Hardware Robot Operating System (H-ROS)**](https://acutronicrobotics.com/modularity/H-ROS/)
is an a standardized software and hardware infrastructure to create modular
robot hardware. H-ROS is actively being used within the OFERA EU project to
benchmark and prototype the capabilities of the ROS 2 stack against the ROS 2
embedded stack. In addition, H-ROS implements selected components of the ROS
2.0 stack for microcontrollers.

* [**ROS 2 library for OpenCR by ROBOTIS**](https://github.com/ROBOTIS-GIT/OpenCR/tree/feature-ros2-micrortps/arduino/opencr_arduino/opencr/libraries/ROS2):
Tailored and optimized implementation of the ROS 2 publish/subscribe
and clock API for the Micro XRCE-DDS (formerly micro-RTPS) implementation
of the upcoming XRCE-DDS middleware standard running on an STM32F7.
This initiative has been factored out under the [ros2arduino](https://github.com/ROBOTIS-GIT/ros2arduino) name
[discourse.ros.org announcement](https://discourse.ros.org/t/ros2arduino-discussion-for-development-ros2-library-for-arduino/6498).

* [**XEL Network by ROBOTIS**](https://xelnetwork.readthedocs.io):
Product which communicate with ROS 2 (DDS) through DDS-XRCE using Micro
XRCE-DDS in the firmware of their CommXel board.
This CommXel board manages the rest of the boards conforming the XEL
Network and interface them to a ROS 2 space.
The CommXel could use Ethernet or UART to communicate using DDS-XRCE.

* [**freeRTPS**](https://github.com/ros2/freertps): A free, portable,
minimalist implementation of the RTPS protocol for microcontrollers such as
the STM32F7 developed at the OSRF. FreeRTPS shall allow to run ROS 2 with
standard DDS as-is on stronger MCUs. This project has been discontinued in 2016.

* [**ros2_embedded_nuttx**](https://github.com/ros2/ros2_embedded_nuttx):
Early port (in 2014) of ROS 2 alpha for the STM32F4Discovery board and the
STM3240G eval board running the RTOS NuttX developed by Víctor Mayoral Vilches
and Esteve Fernandez at the OSRF.

* [**Renesas GR-ROSE**](http://gadget.renesas.com/ja/event/2018/pm_rose.html):
Renesas have integrated their GR-ROSE platform with ROS 2 using DDS-XRCE protocol.
They use Micro XRCE-DDS implementation on top of FreeRTOS.
A sample can be found in their forums
[renesas forum ](https://japan.renesasrulz.com/gr_user_forum_japanese/f/gr-rose/5201/ros-2-micro-rtps).
They have integrated Micro XRCE-DDS middleware as part of their
[online web compiler](http://tool-cloud2.renesas.com/index.php) for the GR-ROSE platform.

* [**Renesas RX65N MCU**](https://www.renesas.com/us/en/about/press-center/news/2018/news20181029.html):
Renesas announce that their RX65N Microcontrollers Support DDS-XRCE using eProsimas' Micro XRCE-DDS implementation.
All software used in this demonstration will be open sourced and be available in Q4 2018.

* [**Amazon aws-ros-client-library-microcontrollers**](https://github.com/awslabs/aws-ros-client-library-microcontrollers)
Amazon open source project where an initial draft of a rcluc and rmwu layers interfaces have been designed.
The protocol used is DDS-XRCE and uses Micro XRCE-DDS implementation.
[discourse.ros.org announcement](https://discourse.ros.org/t/ros2arduino-discussion-for-development-ros2-library-for-arduino/6498/12)

### ROS1-based approaches

* [**rosserial**](http://wiki.ros.org/rosserial): Well-known and widely used
in the ROS community.

* [**mROS**](https://github.com/tlk-emb/mROS/): A new
work on bringing ROS1 concepts (including nodes and the
ROS1 middleware) on stronger MCUs, cf.
*Hideki Takase, Tomoya Mori, Kazuyoshi Takagi and Naofumi Takagi:
'Work-in-Progress: Design Concept of a Lightweight Runtime Environment
for Robot Software Components onto Embedded Devices' in
Proc. of ESWEEK, Torino, Italy, September 2018.*

## Design Discussion

The following figure may serve as a starting point for the design discussion.
It depicts the major layers from the real-time operating system to the
application, in the style the ROS 2 standard stack.

![micro-ROS](/img/embedded/features_with_dependencies.png)

At the same time, the diagram illustrates the possible feature set of the
client library -- ideally in a modular fashion so that different profiles
iluetkeb marked this conversation as resolved.
Show resolved Hide resolved
can be derived from it. The vertical bar at each feature gives an indication
of the dependencies with lower layers and thus on the portability to
different RTOS and middlewares.

In the OFERA project, a more detailed diagram has been developed, which can
be found at [microros.github.io/micro-ROS/](https://microros.github.io/micro-ROS/).
Binary file added img/embedded/features_with_dependencies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/embedded/micro-ROS_proposed_architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.