Skip to content

Commit e2a2df2

Browse files
JanStaschulatralph-lange
authored andcommitted
Changes as discussed regarding concept of ROS 2 Executor (2)
Signed-off-by: Staschulat Jan (CR/AEX3) <jan.staschulat@de.bosch.com>
1 parent 2d0700d commit e2a2df2

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

  • _docs/concepts/client_library/real-time_executor

_docs/concepts/client_library/real-time_executor/index.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,19 @@ permalink: /docs/concepts/client_library/real-time_executor/
1313
* [Architecture](#architecture)
1414
* [Scheduling Semantics](#scheduling-semantics)
1515

16+
1617
* [Rcl LET-Executor](#rcl-let-executor)
1718
* [Concept](#concept)
1819
* [Example](#example)
1920
* [Download](#download)
2021

22+
2123
* [Callback-group-level Executor](#callback-group-level-executor)
2224
* [API Changes](#api-changes)
2325
* [Meta Executor Concept](#meta-executor-concept)
2426
* [Test Bench](#test-bench)
2527

28+
2629
* [Related Work](#related-work)
2730
* [Roadmap](#roadmap)
2831
* [References](#references)
@@ -42,18 +45,21 @@ Therefore the goal of the Real-Time Executor is to support roboticists with prac
4245
- Specific support for RTOS and microcontrollers
4346

4447

45-
In ROS 1 a network thread is responsible for receiving all messages and putting them into a FIFO queue (in roscpp). That is, all callbacks were called in a FIFO manner, without any execution management. With the introduction of DDS (data distribution service) in ROS 2, the messages are buffered in DDS. In ROS 2, an Executor concept was introduced to support execution management, like priorization. At the rcl-layer, a _wait-set_ is configured with the messages to be received and in a second step, the messages are taken from the DDS-queue. The standard implementation of the ROS 2 Executor for the C++ API (rclcpp) has, however, certain unusual features, like precedence of timers over all other DDS messages, non-preemptive round-robin scheduling for subscriptions, clients and services and considering only one instance of message type (even if multiple are available). These features have the consequence, that in certain situations the standard rclcpp Executor is not deterministic and it makes proving real-time guarantees hard. We have not looked at the Executor implementation for Python (rclpy) because we have micro-controllers as the platform in mind, on which typically C or C++ appliations will run.
48+
In ROS 1 a network thread is responsible for receiving all messages and putting them into a FIFO queue (in roscpp). That is, all callbacks were called in a FIFO manner, without any execution management. With the introduction of DDS (data distribution service) in ROS 2, the messages are buffered in DDS. In ROS 2, an Executor concept was introduced to support execution management, like priorization. At the rcl-layer, a _wait-set_ is configured with handles to be received and in a second step, the handles are taken from the DDS-queue. A handle is a term defined in rcl-layer and summarizes timers, subscriptions, clients and services etc..
4649

47-
The challenges to achieve the afore-mentioned goals for ROS 2 are:
50+
The standard implementation of the ROS 2 Executor for the C++ API (rclcpp) has, however, certain unusual features, like precedence of timers over all other DDS handles, non-preemptive round-robin scheduling for non-timer handles and considering only one input data for each handle (even if multiple could be available). These features have the consequence, that in certain situations the standard rclcpp Executor is not deterministic and it makes proving real-time guarantees hard. We have not looked at the ROS 2 Executor implementation for Python frontend (rclpy) because we consider a micro-controllers platform, on which typically C or C++ appliations will run.
51+
52+
Given the goals for a Real-Time Executor and the limitations of the ROS 2 standard rclcpp Executor, the challenges are:
4853
- to develop an adequate and well-defined scheduling mechanisms for the ROS 2 framework and the real-time operating system (RTOS)
4954
- to define an easy-to-use interface for ROS-developers
5055
- to model requirements (like latencies, determinism in subsystems)
5156
- mapping of ROS framework and OS scheduler (semi-automated and optimized mapping is desired as well as generic, well-understood framework mechanisms)
5257

53-
Our approach is to provide a real-time Executor on two layers as described in section [Introduction to Client Library](../). One based on the rcl-layer written in C programming language and one based on rclcpp written in C++.
58+
Our approach is to provide Real-Time Executors on two layers as described in section [Introduction to Client Library](../). One based on the rcl-layer written in C programming language and one based on rclcpp written in C++.
5459

55-
As the first step, we propose the LET-Executor, which implements static order scheduling policy with logic execution time semantics. In this scheduling policy, all callbacks are executed in a pre-defined order. Logical execution time refers to the concept, that first input data is read before tasks are executed. Secondly, we developed a Callback-group-level Executor, which allows to prioritize a group of callbacks. These approaches are based on the concept of Executors, which have been introduced in ROS 2.
60+
As the first step, we propose the LET-Executor for the rcl-layer in C, which implements static order scheduling policy with logic execution time semantics. In this scheduling policy, all callbacks are executed in a pre-defined order. Logical execution time refers to the concept, that first input data is read before tasks are executed. Secondly, we developed a Callback-group-level Executor, which allows to prioritize a group of callbacks. These approaches are based on the concept of Executors, which have been introduced in ROS 2.
5661

62+
In the future, we plan to provide other Real-Time Executors for the rcl- and rclcpp-layer.
5763

5864
## Analysis of rclcpp standard Executor
5965

@@ -90,7 +96,7 @@ Due to these findings, the authors present an alternative approach to provide de
9096
## Rcl LET-Executor
9197
This section describes the rcl-LET-Executor. It is a first step towards deterministic execution by providing static order scheduling with a let semantics. The abbreviation let stands for Logical-Execution-Time (LET) and is a known concept in automotive domain to simplify synchronization in process scheduling. If refers to the concept to schedule multiple ready tasks in such a way, that first all input data is read for all tasks, and then all tasks are executed. This removes any inter-dependence of input data among these ready tasks and hence input data synchronization is not necessary any more[[BP2017](#BP2017)] [[EK2018](#EK2018)].
9298

93-
In the future, we plan to provide also other Executors with different deterministic semantics.
99+
94100

95101
### Concept
96102
The LET-Executor consists of tho phases, configuration and running phase. First, in configuration phase, the total number of handles are defined. A handle is the term in the rcl-layer to generalize _timers_, _subscriptions_, _services_ etc.. Also in this phase, the execution order of the callbacks is defined. Secondly, in the running phase, the availability of input data for all handles is requested from the DDS-queue, then all received input data is stored and, finally, all callbacks corresponding to the handles are executed in the specified order. With this two-step approach, the LET-Executor guarantees a deterministic callback execution (pre-defined static order) and implements the LET semantics while executing the callbacks.

0 commit comments

Comments
 (0)