Skip to content

Commit 44b7431

Browse files
committed
Reorganized pages in client library section.
Signed-off-by: Ralph Lange <ralph.lange@de.bosch.com>
1 parent 259ee83 commit 44b7431

31 files changed

Lines changed: 184 additions & 158 deletions

_data/docs.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212

1313
- title: Client Library
1414
docs:
15-
- concepts/client_library
16-
- concepts/client_library/real-time_executor
17-
- concepts/client_library/system_modes
18-
- concepts/client_library/decision_paper
19-
- concepts/client_library/rcutils_analysis
15+
- concepts/client_library/introduction
16+
- concepts/client_library/features
17+
- concepts/client_library/execution_management
18+
- concepts/client_library/lifecycle_and_system_modes
19+
- concepts/client_library/diagnostics
20+
- concepts/client_library/design_analysis_and_decisions
2021

2122
- title: Middleware
2223
docs:

_docs/concepts/client_library/decision_paper/allocations_Fast-RTPS.png renamed to _docs/concepts/client_library/design_analysis_and_decisions/allocations_Fast-RTPS.png

File renamed without changes.

_docs/concepts/client_library/decision_paper/allocations_Micro_XRCE-DDS.png renamed to _docs/concepts/client_library/design_analysis_and_decisions/allocations_Micro_XRCE-DDS.png

File renamed without changes.

_docs/concepts/client_library/decision_paper/index.md renamed to _docs/concepts/client_library/design_analysis_and_decisions/index.md

Lines changed: 145 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Decision Paper
3-
permalink: /docs/concepts/client_library/decision_paper/
2+
title: Design Analysis and Decisions
3+
permalink: /docs/concepts/client_library/design_analysis_and_decisions/
44
---
55

66
This document served as decision template for the design and implementation of the micro-ROS client library in March 2019. We discuss different options and existing starting points for this undertaking, decision criteria and analysis results regarding the existing assets.
@@ -211,3 +211,146 @@ Diagnostics (Bosch)
211211
Power management (Acutronic Robotics)
212212

213213
* Highly dependent on RTOS, it would require implementation for each one
214+
215+
216+
# Embedded rcutils Analysis
217+
218+
## Proposed changes
219+
220+
The main issues found when porting rcutils package to embedded systems with RTOS during micro*ROS development were:
221+
* the lack of filesystem
222+
* dynamic memory allocations out of the RTOS control (usually with standard library implementations of `malloc` and `free`)
223+
* the POSIX API dependency
224+
225+
This document addresses the first two items.
226+
227+
To avoid the **filesystem** dependency without modifying high*level layers (such as `rcl` or `rmw`), it is proposed to use a combination between the available `rcl_logging_noop` package and a modified version of the filesystem dependencies in `rcutils`. This approach is enabled using the `RCUTILS_NO_FILESYSTEM` flag in compilation time.
228+
229+
**Dynamic memory allocation** must be bounded to ROS2 custom allocators. `rcl` and `rmw` layers usually rely on `rcutils_get_default_allocator` function to obtain allocators, so a setter function is proposed.
230+
This way, using `rcutils_set_default_allocator` function is possible to modify the defaults easing the use of custom memory management in embedded systems.
231+
232+
Dynamic memory allocation is also found when dealing with error handling in `rcutils`. By using `RCUTILS_AVOID_DYNAMIC_ALLOCATION` some string related `memmove` functions along the error handling are avoided.
233+
234+
## Dependencies in `rcl`, `rcutils` and `rmw`
235+
236+
*Test folders are excluded.*
237+
238+
### error_handling.h
239+
240+
* Macro **RCUTILS_SAFE_FWRITE_TO_STDERR** in `rcutils` error_handling.h:
241+
[Check here](https://github.com/micro-ROS/rcutils/commit/bcaa00a6ed12fc62d05dc5e44521a1648fd2d07f#diff-1b06d4a1ccca0f0dff66d961923143a1L42)
242+
* Problem: use `fwrite` to print to stderr and relies on a filesytem
243+
* Appears in:
244+
* rcl/rcl/src/rcl/expand_topic_name.c
245+
* rcl/rcl/src/rcl/logging_rosout.c
246+
* rcl/rcl/src/rcl/logging.c
247+
* rcl/rcl/src/rcl/context.c
248+
* rcl/rcl_yaml_param_parser/src/parser.c
249+
* rcutils/src/split.c
250+
* rcutils/src/error_handling.c
251+
* rcutils/src/allocator.c
252+
* rcutils/src/logging.c
253+
* rcutils/src/error_handling_helpers.h
254+
* rcutils/include/rcutils/logging.h
255+
* rcutils/include/rcutils/error_handling.h
256+
* rcl/rcl/src/rcl/expand_topic_name.c
257+
* rcl/rcl/src/rcl/logging_rosout.c
258+
* rcl/rcl/src/rcl/logging.c
259+
* rcl/rcl/src/rcl/context.c
260+
* rcl/rcl_yaml_param_parser/src/parser.c
261+
* rmw/rmw/include/rmw/error_handling.h
262+
263+
* Macro **RCUTILS_SET_ERROR_MSG** in `rcutils` error_handling.h: [Check here](https://github.com/micro-ROS/rcutils/commit/bcaa00a6ed12fc62d05dc5e44521a1648fd2d07f#diff-1b06d4a1ccca0f0dff66d961923143a1R202)
264+
* Problem: use inconditionally `memmove` inside `__rcutils_copy_string()` inside `rcutils_set_error_state`. It implies dynamic memory allocation.
265+
* Dependecies:
266+
* rcl/rcl/include/rcl/error_handling.h
267+
* rcutils/src/security_directory.c
268+
* rcutils/src/time_unix.c
269+
* rcutils/src/split.c
270+
* rcutils/src/error_handling.c
271+
* rcutils/src/time.c
272+
* rcutils/src/string_map.c
273+
* rcutils/src/uint8_array.c
274+
* rcutils/src/hash_map.c
275+
* rcutils/src/char_array.c
276+
* rcutils/src/logging.c
277+
* rcutils/src/string_array.c
278+
* rcutils/src/array_list.c
279+
* rcutils/include/rcutils/types/array_list.h
280+
* rcutils/include/rcutils/types/hash_map.h
281+
* rcutils/include/rcutils/allocator.h
282+
* rcutils/include/rcutils/error_handling.h
283+
* rcl/rcl/include/rcl/error_handling.h
284+
* rmw/rmw/include/rmw/error_handling.h
285+
286+
* Macro **RCUTILS_SET_ERROR_MSG_WITH_FORMAT_STRING** in `rcutils` error_handling.h:. [Check here](https://github.com/micro-ROS/rcutils/commit/bcaa00a6ed12fc62d05dc5e44521a1648fd2d07f#diff-1b06d4a1ccca0f0dff66d961923143a1R218)
287+
* Problem: use `RCUTILS_SET_ERROR_MSG`, see above.
288+
* Dependecies:
289+
* rcl/rcl/include/rcl/error_handling.h
290+
* rcutils/src/security_directory.c
291+
* rcutils/src/string_map.c
292+
* rcutils/src/logging.c
293+
* rcutils/include/rcutils/error_handling.h
294+
* rcl/rcl/include/rcl/error_handling.h
295+
* rmw/rmw/include/rmw/error_handling.h
296+
297+
### security_directory.c (moved from `rcl` to `rcutils`)
298+
299+
* Function **get_best_matching_directory** in `rcutils` security_directory.c [Check here](https://github.com/micro-ROS/rcutils/commit/9804287c3489ce9c88b714832abf54f9a7b7198d#diff-1ca0173d6a68ba1bdcd9ff908b769911R91)
300+
* Problem: use **tinydir** library which relies on filesytem
301+
* Dependecies:
302+
* rcutils/src/security_directory.c
303+
* rcl/rcl/src/rcl/security_directory.c
304+
305+
* Function **prefix_match_lookup**. [Check here](https://github.com/micro-ROS/rcutils/commit/9804287c3489ce9c88b714832abf54f9a7b7198d#diff-1ca0173d6a68ba1bdcd9ff908b769911L151)
306+
* Problem: use **tinydir** library which relies on filesytem
307+
* Dependencies:
308+
* rcutils/src/security_directory.c
309+
* rcl/rcl/src/rcl/security_directory.c
310+
311+
### allocator.c
312+
313+
* Function **rcutils_get_default_allocator**. [Check here](https://github.com/micro-ROS/rcutils/commit/3abb1eb2c9b206054101293997c0d4e541b1c657)
314+
* Problem: use static allocated **default_allocator** which uses malloc/free. **rcutils_set_default_allocator** is proposed.
315+
* Dependecies:
316+
* rcl/rcl/include/rcl/allocator.h
317+
* rcl/rcl/include/rcl/expand_topic_name.h
318+
* rcutils/src/allocator.c
319+
* rcutils/src/logging.c
320+
* rcutils/include/rcutils/types/string_map.h
321+
* rcutils/include/rcutils/types/array_list.h
322+
* rcutils/include/rcutils/types/string_array.h
323+
* rcutils/include/rcutils/types/hash_map.h
324+
* rcutils/include/rcutils/allocator.h
325+
* rmw_implementation/rmw_implementation/src/functions.cpp
326+
* rcl/rcl/include/rcl/allocator.h
327+
* rcl/rcl/include/rcl/expand_topic_name.h
328+
* rmw/rmw/src/allocators.c
329+
330+
### filesystem.c
331+
332+
* Functions **rcutils_get_cwd**, **rcutils_is_directory**, **rcutils_is_file**, **rcutils_exists**, **rcutils_is_readable**, **rcutils_is_writable** and **rcutils_is_readable_and_writable**. [Check here](https://github.com/micro-ROS/rcutils/commit/9804287c3489ce9c88b714832abf54f9a7b7198d)
333+
* Problem: rely on filesystem
334+
* Dependecies **rcutils_get_cwd()**:
335+
* rcutils/src/filesystem.c
336+
* rcutils/include/rcutils/filesystem.h
337+
* Dependecies **rcutils_is_directory()**:
338+
* rcutils/src/security_directory.c
339+
* rcutils/src/filesystem.c
340+
* rcutils/include/rcutils/filesystem.h
341+
* rcl/rcl/src/rcl/security_directory.c
342+
* Dependecies **rcutils_is_file()**:
343+
* rcutils/src/filesystem.c
344+
* rcutils/include/rcutils/filesystem.h
345+
* Dependencies **rcutils_exists()**:
346+
* rcutils/src/filesystem.c
347+
* rcutils/include/rcutils/filesystem.h
348+
* Dependencies **rcutils_is_readable()**:
349+
* rcutils/src/filesystem.c
350+
* rcutils/include/rcutils/filesystem.h
351+
* Dependencies **rcutils_is_writable()**:
352+
* rcutils/src/filesystem.c
353+
* rcutils/include/rcutils/filesystem.h
354+
* Dependencies **rcutils_is_readable_and_writable()**:
355+
* rcutils/src/filesystem.c
356+
* rcutils/include/rcutils/filesystem.h
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Diagnostics
3+
permalink: /docs/concepts/client_library/diagnostics/
4+
---
5+
6+
**THIS PAGE IS UNDER CONSTRUCTION**
7+
8+
[https://github.com/micro-ROS/micro_ros_diagnostics](https://github.com/micro-ROS/micro_ros_diagnostics)

_docs/concepts/client_library/real-time_executor/cbg-executor_sample_system.png renamed to _docs/concepts/client_library/execution_management/cbg-executor_sample_system.png

File renamed without changes.

_docs/concepts/client_library/real-time_executor/cbg-executor_test-bench_architecture.png renamed to _docs/concepts/client_library/execution_management/cbg-executor_test-bench_architecture.png

File renamed without changes.

_docs/concepts/client_library/real-time_executor/cbg-executor_test-bench_results.png renamed to _docs/concepts/client_library/execution_management/cbg-executor_test-bench_results.png

File renamed without changes.

_docs/concepts/client_library/real-time_executor/cbg_executor_demo_plot.png renamed to _docs/concepts/client_library/execution_management/cbg_executor_demo_plot.png

File renamed without changes.

_docs/concepts/client_library/real-time_executor/executor_class_diagram.png renamed to _docs/concepts/client_library/execution_management/executor_class_diagram.png

File renamed without changes.

0 commit comments

Comments
 (0)