You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8e2b531
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: _docs/client_library/decision_paper/index.md
+22-23Lines changed: 22 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,18 @@
1
1
---
2
-
title: Client Library - Decision Paper
2
+
title: Client Library -- Decision Paper
3
3
permalink: /docs/client_library/decision_paper/
4
4
---
5
5
6
-
This document shall serve as decision template for the design and implementation of the micro-ROS client library, at first in the EU project [OFERA](http://ofera.eu/). We discuss different options and existing starting points for this undertaking, decision criteria and analysis results regarding the existing assets.
6
+
This document shall serve as decision template for the design and implementation of the micro-ROS client library. We discuss different options and existing starting points for this undertaking, decision criteria and analysis results regarding the existing assets.
7
7
8
8
## Assumptions
9
9
10
-
From the past discussions and developments in 2018, we assume that a [rosserial](http://wiki.ros.org/rosserial)- or [ros2arduino](https://github.com/ROBOTIS-GIT/ros2arduino)-like approach is no longer an option in the context of OFERA but that we strive for a solution based on rmw and rcl.
10
+
From the past discussions and developments in 2018, we assume that a [rosserial](http://wiki.ros.org/rosserial)- or [ros2arduino](https://github.com/ROBOTIS-GIT/ros2arduino)-like approach is not an option in the context of the [ROS 2 Embedded SIG](https://discourse.ros.org/t/ros2-embedded-sig-meeting-1/) and the EU project [OFERA](http://ofera.eu/), but that we strive for a solution based on rmw and rcl.
11
11
12
12
## Major Options
13
13
14
-
1. rclc: Implement a new client library in the C programming language from scratch or from the [few existing, unmaintained lines of code by the OSRF](https://github.com/ros2/rclc/commits/master).
15
-
2. rclcplus: Implement a new client library from scratch featuring basic C++ mechanisms (such as templates) but does not require a full-fledged libstdc++ (but some very basic subset only)
14
+
1. rclc: Implement a new client library in the C programming language from scratch or from the [few existing, unmaintained lines of code at https://github.com/ros2/rclc/](https://github.com/ros2/rclc/).
15
+
2. rclcplus: Implement a new client library from scratch featuring basic C++ mechanisms (such as templates), but not requiring a full-fledged libstdc++ (but some very basic subset only).
16
16
3. rclcpp: Modify the rclcpp to be usable on MCUs and NuttX using an (almost) full-fledged libstdc++
17
17
18
18
## Decision Criteria
@@ -44,7 +44,7 @@ From the past discussions and developments in 2018, we assume that a [rosserial]
44
44
45
45
## Requirements to micro-ROS Client Library
46
46
47
-
High-level requirements to the whole micro-ROS stack including the client library are documented in Deliverable [D1.7 Reference Scenarios and Technical System Requirements Definition](http://ofera.eu/storage/deliverables/OFERA_D1.7_Requirements.pdf). Import requirements immediately linked to the client library are:
47
+
In the [EU project OFERA](http://ofera.eu/), a list of high-level requirements to the whole micro-ROS stack including the client library has been compiled in the Deliverable [D1.7 Reference Scenarios and Technical System Requirements Definition](http://ofera.eu/storage/deliverables/OFERA_D1.7_Requirements.pdf). Import requirements immediately linked to the client library are:
48
48
49
49
* ROS2 lifecycle: micro-ROS nodes should support the node lifecycle defined for ROS2 nodes.
50
50
* Dynamic component parameters: micro-ROS shall provide mechanisms for dynamic management of component parameters, compatible with ROS mechanisms.
@@ -58,7 +58,7 @@ High-level requirements to the whole micro-ROS stack including the client librar
58
58
59
59
### rclcpp Library
60
60
61
-
The rclcpp library features all ROS 2 concepts -- including parameters and lifecycle node - and is maintained actively by the OSRF. Use of rclcpp would give best conditions for porting of ROS 2 user-code to micro-ROS.
61
+
The rclcpp library features all ROS 2 concepts -- including parameters and lifecycle node -- and is maintained actively by the OSRF. Use of rclcpp would give best conditions for porting of ROS 2 user-code to micro-ROS.
62
62
63
63
Questions:
64
64
@@ -92,8 +92,8 @@ A list of issues on dynamic memory management and real-time is also discussed in
92
92
93
93
Questions:
94
94
95
-
* Is it possible to avoid large heap at all by providing tiny heaps for each concept (node, subscription, publisher) on the corresponding data types on top-most layer? Can each allocation on the lower layers be clearly assigned/related to one instance on the top-most layer?
96
-
* Is a two-phase approach - allow dynamic allocation in some initialization phase but not in a later run phase - possible? How much effort is it to implement? Would such an approach be acceptable for some safety-certified implementation?
95
+
* Is it possible to avoid a large heap at all by providing tiny heaps for each concept (node, subscription, publisher) on the corresponding data types on top-most layer? Can each allocation on the lower layers be clearly assigned/related to one instance on the top-most layer?
96
+
* Is a two-phase approach -- allow dynamic allocation in some initialization phase but not in a later run phase -- possible? How much effort is it to implement? Would such an approach be acceptable for some safety-certified implementation?
97
97
98
98
As a first experiment, we implemented a simple node and subscriber directly against the rcl in the C programming language and counted the allocations and frees.
99
99
@@ -112,10 +112,11 @@ For curiosity, the numbers for Fast-RTPS:
112
112
113
113
### Current work on ROS 2
114
114
115
-
Currently there is an active interest in making ROS2 a real "real time" platform. These interest have strive to a set of developments regarding the amount of dynamic memory used along the full stack. From eProsima side they are making a big effort changin Fast RTPS dynamic memory to a static system. This eProsima approach aligns with the idea of two-steps: 1) reserve all memory needed and then 2) work with the pre-allocated memory and avoid new allocations.
115
+
Currently there is an active interest in making ROS2 a real "real time" platform. These interest have strive to a set of developments regarding the amount of dynamic memory used along the full stack. From eProsima side they are making a big effort changing Fast RTPS dynamic memory to a static system. This eProsima approach aligns with the idea of two-steps: 1) reserve all memory needed and then 2) work with the pre-allocated memory and avoid new allocations.
116
+
116
117
To develop this mechanism currently there are to main changes, all regarding STL containers:
117
118
118
-
* Use of [https://github.com/foonathan/memory](https://github.com/foonathan/memory) system, where similar to the point previously listed in this section questions, there are heaps holding sets of container elements. Them all the operations on the containers are done without relaying in new allocations.
119
+
* Use of [https://github.com/foonathan/memory](https://github.com/foonathan/memory) system, where similar to the point previously listed in this section questions, there are heaps holding sets of container elements. Then, all the operations on the containers are done without relaying in new allocations.
119
120
* Own vector specialization using two steps, a first reserve of the memory and then make some checks on the traditional API. [https://github.com/eProsima/Fast-RTPS/pull/386](https://github.com/eProsima/Fast-RTPS/pull/386)
120
121
* Reuse of container entities.
121
122
@@ -131,12 +132,12 @@ First, it is possible to use a subset only, which does not require libstdc++ at
131
132
Further links:
132
133
133
134
*[How to write a C++ program without libstdc++ (http://ptspts.blogspot.com)](http://ptspts.blogspot.com/2010/12/how-to-write-c-program-without-libstdc.html)
134
-
*[g++ without libstdc++ - can it be done? (https://stackoverflow.com/questions/3714167/)](https://stackoverflow.com/questions/3714167/g-without-libstdc-can-it-be-done-a-very-configurable-lightweight-libstd)
135
+
*[g++ without libstdc++ -- can it be done? (https://stackoverflow.com/questions/3714167/)](https://stackoverflow.com/questions/3714167/g-without-libstdc-can-it-be-done-a-very-configurable-lightweight-libstd)
135
136
*[Bit Bashing: C++ On Embedded Systems](https://bitbashing.io/embedded-cpp.html) discusses different language features of C++ and provides guidelines which to enable and which to disable for embedded programming.
136
137
137
138
### Libcxx
138
139
139
-
During early stages of NuttX support eProsima did a small POC using libcxx support provided by NuttX. [http://nuttx.org/doku.php?id=wiki:nshhowtos:llvm-stdcxx](http://nuttx.org/doku.php?id=wiki:nshhowtos:llvm-stdcxx). The POC was done using the Assis branch of libcxx however some changes on the makefile were required to be able to compile NuttX.
140
+
During early stages of NuttX support, eProsima did a small POC using libcxx support provided by NuttX. [http://nuttx.org/doku.php?id=wiki:nshhowtos:llvm-stdcxx](http://nuttx.org/doku.php?id=wiki:nshhowtos:llvm-stdcxx). The POC was done using the Assis branch of libcxx however some changes on the makefile were required to be able to compile NuttX.
140
141
141
142
Another options are stripped-down libstdc++ variants with reduced feature sets optimized for embedded applications:
142
143
@@ -165,9 +166,7 @@ We have work around this issue implementing the atomic operations on 64Bits as r
165
166
166
167
A discrimination of the usage of the workaround is still to be done. This should be used ONLY on those architectures not supporting that kind of atomic operations.
See the modified rcl version at [https://github.com/micro-ROS/rcl/commit/cdb0cca50d49c5b5576bf88d2bb7a1d57ae1e00b](https://github.com/micro-ROS/rcl/commit/cdb0cca50d49c5b5576bf88d2bb7a1d57ae1e00b)
171
170
172
171
## High-level core features missing in rcl
173
172
@@ -183,18 +182,18 @@ Logging
183
182
184
183
* Optimized implementation for MCU by eProsima
185
184
186
-
Time / Clock and Timers [eProsima+Bosch+Erle, in Turtlebot demo - step 1]
185
+
Time / Clock and Timers [eProsima+Bosch+Erle, in Turtlebot demo -- step 1]
187
186
* Jan, looks into rcl time and clock interface
188
-
* Synchronization with microprocessor - message types already available in micro-XRCE-DDS
189
-
* Adapter for RTOS required - part of abstraction layer ?!
187
+
* Synchronization with microprocessor -- message types already available in micro-XRCE-DDS
188
+
* Adapter for RTOS required -- part of abstraction layer ?!
190
189
191
-
Executor [Bosch, in Turtlebot demo - step 1]
190
+
Executor [Bosch, in Turtlebot demo -- step 1]
192
191
193
-
Lifecycle / System modes [Bosch, in Turtlebot demo - step 2]
192
+
Lifecycle / System modes [Bosch, in Turtlebot demo -- step 2]
194
193
195
-
TF [Bosch, in Turtlebot demo - step 3]
194
+
TF [Bosch, in Turtlebot demo -- step 3]
196
195
197
-
Diagnostics [Bosch, in Turtlebot demo - step 2]
196
+
Diagnostics [Bosch, in Turtlebot demo -- step 2]
198
197
199
198
* Liveliness of node: Introduce mechanism in micro-XRCE-DDS similar to standard DDS?
200
199
* Make PR for rmw extension with abstract interface to be informed about liveliness of other nodes?!
0 commit comments