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 01d382f
Browse filesBrowse the repository at this point in the historyBrowse files
While these Executor features are well suited for the embedded use-case, we identified also a number of software design patterns in robotics which are improving deterministic execution.
363
-
364
362
#### Sense-plan-act pipeline
365
363
366
-
#### Sensor fusion
367
-
368
-
- Multiple rates
369
-
- Co-relating task activation
370
-
371
-
#### High priorty path
372
-
373
-
374
-
375
-
### Summary
376
-
377
-
C executor with standard ROS2 semantics. If you want more deterministic behavior, you can do that for data-driven or time-driven software architectures.
378
-
379
-
- Standard ROS2 semantic (react on every DDS event)
380
-
381
-
- Can define trigger (AND, ANY, ONE, user-defined function)
382
-
383
-
- Sequential processing order
384
-
385
-
- LET semantics
386
-
387
-
### Future work
388
-
389
-
- Full LET semantic (sending at the end of the period)
390
-
- one publisher that periodically publish
391
-
- if multiple periods are implemented in multiple threads, need to
392
-
make publishing in each phase atomic.
393
-
- support client, services, guard conditions as handles
394
-
395
-
396
-
### Download - UPDATE!
397
-
The LET-Executor can be downloaded from the micro-ROS GitHub [rcl_executor repository](https://github.com/micro-ROS/rcl_executor). The package [rcl_executor](https://github.com/micro-ROS/rcl_executor/tree/dashing/rcl_executor) provides the LET-Executor library with a step-by-step tutorial and the package [rcl_executor_examples](https://github.com/micro-ROS/rcl_executor/tree/dashing/rcl_executor_examples) provides an example, how to use the LET-Executor.
398
-
399
-
400
-
REMOVE THIS STUFF BELOW HERE
401
-
402
-
## Rcl LET-Executor
403
-
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)].
364
+
In this example we want to realise a sense-plan-act pipeline in a single thread. The trigger condition is demonstrated by activating
365
+
the sense-phase when both data for the Laser and IMU are available. Three executors are necessary `exe_sense`, `exe_plan`
366
+
and `exe_act`. The two sensor acquisition callbacks `sense_Laser` and `sense_IMU` are registered in the Executor `exe_sense`.
367
+
The trigger condition ALL is responsible to activate the sense-phase only when all data for these two callbacks are available.
368
+
Finally all three Executors are spinning using a `while`-loop and the `spin_some` function.
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.
398
+
The sensor fusion synchronizing the multiple rates with a trigger is shown below.
We provide an example for using the LET-Executor. First, the callbacks _my\_sub\_cb_ and my_timer\_cb_ are defined for a subscription and a timer, respectivly. Then, the ROS _context_ and the ROS _node_ are defined as well as the subscription object _sub_ and the timer object _timer_.
421
+
The setup for the sensor fusion using sequential execution is shown below.
422
+
Note that the sequetial order is `sense_IMU`, which will request the aggregated IMU message, and then `sense_Laser`
423
+
while the trigger will fire, when a laser message is received.
413
424
414
-
The Executor is initialized with two handles. Then, the _add_ functions define the static execution order of the handles. In this example, the subscription _sub_ shall be processed before the timer _timer_. Finally, the Executor is activated with the _spin\_period_ function, which is continuously called every 20 ms.
The RCLC Executor is an Executor for C applications and can be used with default rclcpp Executor semantics. If additional deterministic behavior is necessary, the user can rely on pre-defined sequential execution, trigged execution and LET-Semantics for data synchronization.
444
467
445
-
// create a timer
446
-
rcl_timer_init(&timer, &my_timer_cb, ... );
468
+
### Future work
447
469
448
-
// initialize executor with two handles
449
-
rcle_let_executor_init(&exe, &context, 2, ...);
470
+
- Full LET semantics (writing data at the end of the period)
471
+
- one publisher that periodically publishes
472
+
- if Executors are running in multiple threads,
473
+
publishing needs to be atomic
474
+
- add support for handle types: client, services, guard conditions
The RCLC-Executor can be downloaded from the micro-ROS GitHub [rclc repository](https://github.com/micro-ROS/rclc). The package [rclc](https://github.com/micro-ROS/rclc/tree/feature/new_api_and_LET_executor_trigger/rclc) provides the RCLC-Executor library and the package [rclc_examples](https://github.com/micro-ROS/rclc/tree/feature/new_api_and_LET_executor_trigger/rclc_examples) provides an example, how to use the LET-Executor.
0 commit comments