Skip to content

Commit 0786452

Browse files
committed
moved all png to sub-folder /png, centering all png figures.
1 parent 981b977 commit 0786452

11 files changed

Lines changed: 55 additions & 8 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

_docs/concepts/client_library/execution_management/index.md

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,17 @@ The dispatching mechanism resembles the ROS 1 spin thread behavior: the Executor
9090

9191
The following diagram depicts the relevant classes of the standard ROS 2 Executor implementation:
9292

93-
![ROS 2 Executor class diagram](executor_class_diagram.png)
93+
<center>
94+
<img src="png/executor_class_diagram.png" alt="ROS 2 Executor class diagram" width="100%" />
95+
</center>
9496

9597
Note that an Executor instance maintains weak pointers to the NodeBaseInterfaces of the nodes only. Therefore, nodes can be destroyed safely, without notifying the Executor.
9698

9799
Also, the Executor does not maintain an explicit callback queue, but relies on the queue mechanism of the underlying DDS implementation as illustrated in the following sequence diagram:
98100

99-
![Call sequence from executor to DDS](executor_to_dds_sequence_diagram.png)
101+
<center>
102+
<img src="png/executor_to_dds_sequence_diagram.png" alt="Call sequence from executor to DDS" width="100%" />
103+
</center>
100104

101105
The Executor concept, however, does not provide means for prioritization or categorization of the incoming callback calls. Moreover, it does not leverage the real-time characteristics of the underlying operating-system scheduler to have finer control on the order of executions. The overall implication of this behavior is that time-critical callbacks could suffer possible deadline misses and a degraded performance since they are serviced later than non-critical callbacks. Additionally, due to the FIFO mechanism, it is difficult to determine usable bounds on the worst-case latency that each callback execution may incur.
102106

@@ -118,13 +122,17 @@ In embedded systems, real-time behavior is approached by using the time-triggere
118122

119123
<center>
120124
<img src="png/scheduling_01.png" alt="Schedule with fixed periods" width="30%"/>
125+
</center>
126+
<center>
121127
Figure 1: Fixed periodic preemptive scheduling.
122128
</center>
123129

124130
To each process one or multiple tasks can be assigned, as shown in Figure 2. These tasks are executed sequentially, which is often called cooperative scheduling.
125131

126132
<center>
127133
<img src="png/scheduling_02.png" alt="Schedule with fixed periods" width="30%"/>
134+
</center>
135+
<center>
128136
Figure 2: Processes with sequentially executed tasks.
129137
</center>
130138

@@ -137,6 +145,8 @@ However, data consistency is often an issue when preemptive scheduling is used a
137145

138146
<center>
139147
<img src="png/scheduling_LET.png" alt="Schedule with fixed periods" width="80%"/>
148+
</center>
149+
<center>
140150
Figure 3: Data communication without and with Logical Execution Time paradigm.
141151
</center>
142152

@@ -166,6 +176,8 @@ A common design paradigm in mobile robotics is a control loop, consisting of sev
166176

167177
<center>
168178
<img src="png/sensePlanActScheme.png" alt="Sense Plan Act Pipeline" width="60%"/>
179+
</center>
180+
<center>
169181
Figure 4: Multiple sensors driving a Sense-Plan-Act pipeline.
170182
</center>
171183

@@ -186,6 +198,8 @@ Often multiple sensors are being used to sense the environment for mobile roboti
186198

187199
<center>
188200
<img src="png/sensorFusion_01.png" alt="Sychronization of multiple rates" width="30%" />
201+
</center>
202+
<center>
189203
Figure 5: How to deterministically process multi-frequent sensor data.
190204
</center>
191205

@@ -197,6 +211,8 @@ An Alternative would be to evalute the IMU sample and the laser scan by synchron
197211

198212
<center>
199213
<img src="png/sensorFusion_02.png" alt="Sychnronization with a trigger" width="40%" />
214+
</center>
215+
<center>
200216
Figure 6: Synchronization of multiple input data with a trigger.
201217
</center>
202218

@@ -207,6 +223,8 @@ Another idea would be to activly request for IMU data only when a laser scan is
207223

208224
<center>
209225
<img src="png/sensorFusion_03.png" alt="Sychronization with sequence" width="30%" />
226+
</center>
227+
<center>
210228
Figure 7: Synchronization with sequential processing.
211229
</center>
212230

@@ -221,6 +239,8 @@ Often a robot has to fullfill several activities at the same time. For example f
221239

222240
<center>
223241
<img src="png/highPriorityPath.png" alt="HighPriorityPath" width="50%" />
242+
</center>
243+
<center>
224244
Figure 8: Managing high priority path with sequential order.
225245
</center>
226246

@@ -276,13 +296,22 @@ The rclc Executor supports all event types as the default ROS 2 Executor, which
276296

277297
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.
278298
<center>
279-
<img src="png/rclc_executor_sequential_execution.png" alt="Sequential execution semantics" width="60%" />
299+
<img src="png/rclc_executor_sequential_execution.png" alt="Sequential execution semantics" width="50%" />
300+
</center>
301+
<center>
280302
Figure 9: Sequential execution semantics.
281303
</center>
282304

283305
#### Trigger condition
284306

285-
- 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.
307+
- 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. This is shown in Figure 10.
308+
309+
<center>
310+
<img src="png/trigger_01.png" alt="Trigger condition overview" width="50%" />
311+
</center>
312+
<center>
313+
Figure 10: Executor with trigger condition
314+
</center>
286315

287316
- Available options:
288317
- ALL operation: fires when input data is available for all handles
@@ -293,24 +322,32 @@ Figure 9: Sequential execution semantics.
293322
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.
294323
<center>
295324
<img src="png/trigger_ALL.png" alt="Trigger condition ALL" width="30%" />
325+
</center>
326+
<center>
296327
Figure 10: Trigger condition ALL
297328
</center>
298329

299330
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.
300331
<center>
301332
<img src="png/trigger_OR.png" alt="Trigger condition ANY" width="30%" />
333+
</center>
334+
<center>
302335
Figure 11: Trigger condition ANY (OR)
303336
</center>
304337

305338
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.
306339
<center>
307340
<img src="png/trigger_ONE.png" alt="Trigger condition ONE" width="30%" />
341+
</center>
342+
<center>
308343
Figure 12: Trigger condition ONE
309344
</center>
310345

311346
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.
312347
<center>
313348
<img src="png/trigger_user_defined.png" alt="Trigger condition user-defined" width="30%" />
349+
</center>
350+
<center>
314351
Figure 13: Trigger condition user-defined
315352
</center>
316353

@@ -561,7 +598,9 @@ Thus, an Executor instance can be dedicated to specific callback group(s) and th
561598
562599
The following figure illustrates this approach with two nodes served by three Callback-group-level Executors in one process:
563600
564-
![Sample system with two nodes and three Callback-group-level Executors in one process](cbg-executor_sample_system.png)
601+
<center>
602+
<img src="png/cbg-executor_sample_system.png" alt="Sample system with two nodes and three Callback-group-level Executors in one process" width="60%" />
603+
</center>
565604
566605
The different callbacks of the Drive-Base node are distributed to different Executors (visualized by the color red, yellow and green). For example the onCmdVel and publishWheelTicks callback are scheduled by the same Executor (yellow). Callbacks from different nodes can be serviced by the same Executor.
567606
@@ -592,10 +631,16 @@ The callback-group-level executor has been merged into ROS 2 rclcpp in [pull req
592631
593632
As a proof of concept, we implemented a small test bench in the present package cbg-executor_ping-pong_cpp. The test bench comprises a Ping node and a Pong node which exchange real-time and best-effort messages simultaneously with each other. Each class of messages is handled with a dedicated Executor, as illustrated in the following figure.
594633
595-
![Architecture for the Callback-group-level Executor test bench](ping_pong_diagram.png)
634+
<center>
635+
<img src="png/ping_pong_diagram.png" alt="Architecture for the Callback-group-level Executor test bench" width="100%" />
636+
</center>
637+
596638
With the test bench, we validated the functioning of the approach.
597639
598-
![Results from Callback-group-level Executor test bench](cbg_executor_demo_plot.png)
640+
<center>
641+
<img src="png/cbg_executor_demo_plot.png" alt="Results from Callback-group-level Executor test bench" width="80%" />
642+
</center>
643+
599644
In this example, the callback for the high priority task (red line) consumes 10ms and the low priority task (blue line) 40ms in the Pong Node. With a ping rate of 20 Hz, the CPU saturates (10ms\*20+40ms\*20=1000ms). With higher frequencies the high priorty task can continue to send its pong message, while the low priority pong task degrades. With a frequency of 100Hz the high priority task requires 100% CPU utilization. With higher ping rates it keeps sending pong messages with 100Hz, while the low priority task does not get any CPU ressources any more and cannot send any messages.
600645
601646
The test bench is provided in the [cbg_executor_demo](https://github.com/boschresearch/ros2_demos/tree/cbg_executor_demo/cbg_executor_demo).
@@ -647,7 +692,9 @@ A module (thread) can be configured independent of these sense-plan-act synchron
647692
648693
The high level overview of the Fawkes framework is shown in the next figure. At compile-time the configuration of the sense-plan act wakeup hook is done (upper part), while at run-time the scheduler iterates through this list of wakeup-hooks (lower part):
649694
650-
![Sequence diagram for Executor concept in Fawkes](fawkes_executor_diagram.png)
695+
<center>
696+
<img src="png/fawkes_executor_diagram.png" alt="Sequence diagram for Fawkes Executor" width="50%" />
697+
</center>
651698
652699
Hence, at run-time, the hooks are executed as a fixed static schedule without preemption. Multiple threads registered in the same hook are executed in parallel.
653700
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)