Skip to content

Commit 981b977

Browse files
committed
added figures for trigger condition
1 parent 82d184c commit 981b977

1 file changed

Lines changed: 28 additions & 23 deletions

File tree

  • _docs/concepts/client_library/execution_management

_docs/concepts/client_library/execution_management/index.md

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -266,48 +266,55 @@ The rclc Executor supports all event types as the default ROS 2 Executor, which
266266
- actions
267267
- lifecycle
268268

269+
#### Sequential execution
270+
271+
- At configuration, the user defines the order of handles.
272+
- At configuration, the user defines whether the handle shall be called only when new data is available (ON_NEW_DATA) or whether the callback shall always be called (ALWAYS).
273+
- At runtime, all handles are processed in the user-defined order
274+
- if the configuration of handle is ON_NEW_DATA, then the corresponding callback is only called if new data is available
275+
- if the configuration of the handle is ALWAYS, then the corresponding callback is always. If no data is available, then the callback is called with no data (e.g. NULL pointer).
276+
277+
Figure 9 shows three callbacks, A, B and C. Assume, they shall be executed in the order *B,A,C*. Then the user adds the callbacks to the rclc Executor in this order. Whenever new messages have arrived then the callbacks for which a new message is availabe will be always executed in the user-defined processing order.
278+
<center>
279+
<img src="png/rclc_executor_sequential_execution.png" alt="Sequential execution semantics" width="60%" />
280+
Figure 9: Sequential execution semantics.
281+
</center>
282+
269283
#### Trigger condition
270284

271285
- Given a set of handles, a trigger condition, which is based on the availability of input data of these handles, decides when the processing of all callbacks starts.
272286

273287
- Available options:
274288
- ALL operation: fires when input data is available for all handles
275-
- ANY operation: fires when input data is available for at least one handle
289+
- ANY operation: fires when input data is available for at least one handle (OR semantics)
276290
- ONE: fires when input data for a user-specified handle is available
277-
- User-defined function: user can implement more sophisticated logic
291+
- User-defined function: user can implement custom logic
278292

293+
Figure 10 shows an example of the ALL semantics. Only if all messages *msg_A, msg_B, msg_C* were received, then trigger condition is fullfilled and the callbacks are processed in a user-defined order.
279294
<center>
280-
<img src="png/trigger_ALL.png" alt="Trigger condition ALL" width="60%" />
281-
Figure 9: Trigger condition ALL
295+
<img src="png/trigger_ALL.png" alt="Trigger condition ALL" width="30%" />
296+
Figure 10: Trigger condition ALL
282297
</center>
283298

299+
Figure 11 shows an example of the ANY semantics. Thas is, if any messages *msg_A, msg_B, msg_C* was received, then trigger condition is fullfilled and the callbacks are processed in a user-defined order. This is equivalent to OR semantics.
284300
<center>
285-
<img src="png/trigger_ANY.png" alt="Trigger condition ANY" width="60%" />
286-
Figure 10: Trigger condition ANY
301+
<img src="png/trigger_OR.png" alt="Trigger condition ANY" width="30%" />
302+
Figure 11: Trigger condition ANY (OR)
287303
</center>
288304

305+
Figure 12 shows an example of the ONE semantics. Thas is, only if message *msg_B* was received, the trigger condition is fullfilled and (potentially all) callbacks are processed in a user-defined order.
289306
<center>
290-
<img src="png/trigger_ONE.png" alt="Trigger condition ONE" width="60%" />
291-
Figure 11: Trigger condition ONE
307+
<img src="png/trigger_ONE.png" alt="Trigger condition ONE" width="30%" />
308+
Figure 12: Trigger condition ONE
292309
</center>
293310

311+
Figure 13 describes the custom semantics. A custom trigger condition with could be a more complex logic of multiple messages, can be passed to the executor. This might also include hardware triggers, like interrupts.
294312
<center>
295-
<img src="png/trigger_user_defined.png" alt="Trigger condition user-defined" width="60%" />
296-
Figure 12: Trigger condition user-defined
313+
<img src="png/trigger_user_defined.png" alt="Trigger condition user-defined" width="30%" />
314+
Figure 13: Trigger condition user-defined
297315
</center>
298316

299-
#### Sequential execution
300317

301-
- At configuration, the user defines the order of handles.
302-
- At configuration, the user defines whether the handle shall be called only when new data is available (ON_NEW_DATA) or whether the callback shall always be called (ALWAYS).
303-
- At runtime, all handles are processed in the user-defined order
304-
- if the configuration of handle is ON_NEW_DATA, then the corresponding callback is only called if new data is available
305-
- if the configuration of the handle is ALWAYS, then the corresponding callback is always. If no data is available, then the callback is called with no data (e.g. NULL pointer).
306-
307-
<center>
308-
<img src="png/executor_sequential_semantics.png" alt="Sequential execution semantics" width="60%" />
309-
Figure 13: Sequential execution semantics.
310-
</center>
311318

312319
#### LET-Semantics
313320
- Assumption: time-triggered system, the executor is activated periodically
@@ -544,8 +551,6 @@ The slides can be downloaded [here](https://ec2a4d36-bac8-4759-b25e-bb1f794177f4
544551
### Download
545552
The rclc Executor can be downloaded from the [ros2/rclc repository](https://github.com/ros2/rclc). It is available for the ROS 2 versions Foxy, Galactic and Rolling. The repository provides several packages including the [rclc Executor](https://github.com/ros2/rclc/tree/master/rclc) and an [rclc_examples package](https://github.com/ros2/rclc/tree/master/rclc_examples) with several application examples.
546553
547-
548-
549554
## Callback-group-level Executor
550555
551556
The Callback-group-level Executor was an early prototype for a refined rclcpp Executor API developed in micro-ROS. It has been derived from the default rclcpp Executor and addresses some of the aforementioned deficits. Most important, it was used to validate that the underlying layers (rcl, rmw, rmw_adapter, DDS) allow for multiple Executor instances without any negative interferences.

0 commit comments

Comments
 (0)