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
* corrected Figure numbers
* Update _docs/concepts/client_library/execution_management/index.md
Co-authored-by: Ralph Lange <ralph-lange@users.noreply.github.com>
* Update _docs/concepts/client_library/execution_management/index.md
Co-authored-by: Ralph Lange <ralph-lange@users.noreply.github.com>
Co-authored-by: Ralph Lange <ralph-lange@users.noreply.github.com>
Copy file name to clipboardExpand all lines: _docs/concepts/client_library/execution_management/index.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,13 +122,13 @@ Now we describe common software design patterns which are used in mobile robotic
122
122
123
123
**Concept:**
124
124
125
-
A common design paradigm in mobile robotics is a control loop, consisting of several phases: A sensing phase to aquire sensor data, a plan phase for localization and path planning and an actuation-phase to steer the mobile robot. Of course, more phases are possible, here these three phases shall serve as an example. Such a processing pipeline is shown in Figure 4.
125
+
A common design paradigm in mobile robotics is a control loop, consisting of several phases: A sensing phase to aquire sensor data, a plan phase for localization and path planning and an actuation-phase to steer the mobile robot. Of course, more phases are possible, here these three phases shall serve as an example. Such a processing pipeline is shown in Figure 1.
126
126
127
127
<center>
128
128
<imgsrc="png/sensePlanActScheme.png"alt="Sense Plan Act Pipeline"width="60%"/>
129
129
</center>
130
130
<center>
131
-
Figure 4: Multiple sensors driving a Sense-Plan-Act pipeline.
131
+
Figure 1: Multiple sensors driving a Sense-Plan-Act pipeline.
132
132
</center>
133
133
134
134
Typically multiple sensors are used to perceive the environment. For example an IMU and a laser scanner. The quality of localization algorithms highly depend on how old such sensor data is when it is processed. Ideally the latest data of all sensors should be processed. One way to achive this is to execute first all sensor drivers in the sense-phase and then process all algorithms in the plan-phase.
@@ -144,35 +144,35 @@ For this sense-plan-act pattern, we could define one executor for each phase. Th
144
144
145
145
**Concept:**
146
146
147
-
Often multiple sensors are being used to sense the environment for mobile robotics. While an IMU sensor provides data samples at a very high rate (e.g., 500 Hz), laser scans are availabe at a much slower frequency (e.g. 10Hz) determined by the revolution time. Then the challenge is, how to deterministically fuse sensor data with different frequencies. This problem is depicted in Figure 5.
147
+
Often multiple sensors are being used to sense the environment for mobile robotics. While an IMU sensor provides data samples at a very high rate (e.g., 500 Hz), laser scans are availabe at a much slower frequency (e.g. 10Hz) determined by the revolution time. Then the challenge is, how to deterministically fuse sensor data with different frequencies. This problem is depicted in Figure 2.
148
148
149
149
<center>
150
150
<imgsrc="png/sensorFusion_01.png"alt="Sychronization of multiple rates"width="30%" />
151
151
</center>
152
152
<center>
153
-
Figure 5: How to deterministically process multi-frequent sensor data.
153
+
Figure 2: How to deterministically process multi-frequent sensor data.
154
154
</center>
155
155
156
156
Due to scheduling effects, the callback for evaluating the laser scan might be called just before or just after an IMU data is received. One way to tackle this is to write additional synchronization code inside the application. Obviously, this is a cumbersome and not-portable solution.
157
157
158
-
An Alternative would be to evalute the IMU sample and the laser scan by synchronizing their frequency. For example by processing always 50 IMU samples with one laser scan. This approach is shown in Figure 6. A pre-processing callback aggregates the IMU samples and sends an aggregated message with 50 samples at 10Hz rate. Now both messages have the same frequency. With a trigger condition, which fires when both messages are available, the sensor fusion algorithm can expect always synchronized input data.
158
+
An Alternative would be to evalute the IMU sample and the laser scan by synchronizing their frequency. For example by processing always 50 IMU samples with one laser scan. This approach is shown in Figure 3. A pre-processing callback aggregates the IMU samples and sends an aggregated message with 50 samples at 10Hz rate. Now both messages have the same frequency. With a trigger condition, which fires when both messages are available, the sensor fusion algorithm can expect always synchronized input data.
159
159
160
160
<center>
161
161
<imgsrc="png/sensorFusion_02.png"alt="Sychnronization with a trigger"width="40%" />
162
162
</center>
163
163
<center>
164
-
Figure 6: Synchronization of multiple input data with a trigger.
164
+
Figure 3: Synchronization of multiple input data with a trigger.
165
165
</center>
166
166
167
167
In ROS 2, this is currently not possible to be modeled because of the lack of a trigger concept in the Executors of rclcpp and rclpy. Message filters could be used to synchronize input data based on the timestamp in the header, but this is only available in rclcpp (and not in rcl). Further more, it would be more efficient to have such a trigger concept directly in the Executor.
168
168
169
-
Another idea would be to activly request for IMU data only when a laser scan is received. This concept is shown in Figure 7. Upon arrival of a laser scan mesage, first, a message with aggregated IMU samples is requested. Then, the laser scan is processed and later the sensor fusion algorithm. An Executor, which would support sequential execution of callbacks, could realize this idea.
169
+
Another idea would be to activly request for IMU data only when a laser scan is received. This concept is shown in Figure 4. Upon arrival of a laser scan mesage, first, a message with aggregated IMU samples is requested. Then, the laser scan is processed and later the sensor fusion algorithm. An Executor, which would support sequential execution of callbacks, could realize this idea.
170
170
171
171
<center>
172
172
<imgsrc="png/sensorFusion_03.png"alt="Sychronization with sequence"width="30%" />
173
173
</center>
174
174
<center>
175
-
Figure 7: Synchronization with sequential processing.
175
+
Figure 4: Synchronization with sequential processing.
176
176
</center>
177
177
178
178
**Derived requirements:**
@@ -181,13 +181,13 @@ Figure 7: Synchronization with sequential processing.
181
181
182
182
### High-priority processing path
183
183
**Concept**
184
-
Often a robot has to fullfill several activities at the same time. For example following a path and avoiding obstacles. While path following is a permanent activity, obstacle avoidance is trigged by the environment and should be immediately reacted upon. Therefore one would like to specify priorities to activities. This is depicted in Figure 8:
184
+
Often a robot has to fullfill several activities at the same time. For example following a path and avoiding obstacles. While path following is a permanent activity, obstacle avoidance is trigged by the environment and should be immediately reacted upon. Therefore one would like to specify priorities to activities. This is depicted in Figure 5:
Figure 8: Managing high priority path with sequential order.
190
+
Figure 5: Managing high priority path with sequential order.
191
191
</center>
192
192
193
193
Assuming a simplified control loop with the activities sense-plan-act, the obstacle avoidance, which might temporarily stop the robot, should be processed before the planning phase. In this example we assume that these activites are processed in one thread.
@@ -197,22 +197,22 @@ Assuming a simplified control loop with the activities sense-plan-act, the obsta
197
197
198
198
199
199
### Real-time embedded applications
200
-
In embedded systems, real-time behavior is approached by using the time-triggered paradigm, which means that the processes are periodically activated. Processes can be assigned priorities to allow pre-emptions. Figure 1 shows an example, in which three processes with fixed periods are shown. The middle and lower process are preempted multiple times depicted with empty dashed boxes.
200
+
In embedded systems, real-time behavior is approached by using the time-triggered paradigm, which means that the processes are periodically activated. Processes can be assigned priorities to allow pre-emptions. Figure 6 shows an example, in which three processes with fixed periods are shown. The middle and lower process are preempted multiple times depicted with empty dashed boxes.
201
201
202
202
<center>
203
203
<imgsrc="png/scheduling_01.png"alt="Schedule with fixed periods"width="30%"/>
204
204
</center>
205
205
<center>
206
-
Figure 1: Fixed periodic preemptive scheduling.
206
+
Figure 6: Fixed periodic preemptive scheduling.
207
207
</center>
208
208
209
-
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.
209
+
To each process one or multiple tasks can be assigned, as shown in Figure 7. These tasks are executed sequentially, which is often called cooperative scheduling.
210
210
211
211
<center>
212
212
<imgsrc="png/scheduling_02.png"alt="Schedule with fixed periods"width="30%"/>
213
213
</center>
214
214
<center>
215
-
Figure 2: Processes with sequentially executed tasks.
215
+
Figure 7: Processes with sequentially executed tasks.
216
216
</center>
217
217
218
218
While there are different ways to assign priorities to a given number of processes,
@@ -226,10 +226,10 @@ However, data consistency is often an issue when preemptive scheduling is used a
226
226
<imgsrc="png/scheduling_LET.png"alt="Schedule with fixed periods"width="80%"/>
227
227
</center>
228
228
<center>
229
-
Figure 3: Data communication without and with Logical Execution Time paradigm.
229
+
Figure 8: Data communication without and with Logical Execution Time paradigm.
230
230
</center>
231
231
232
-
An Example of the LET concept is shown in Figure 3. Assume that two processes are communicating data via one global variable. The timepoint when this data is written is at the end of the processing time. In the default case (left side), the process p<sub>3</sub> and p<sub>4</sub> receive the update. At the right side of the figure, the same scenario is shown with LET semantics. Here, the data is communicated only at period boundaries. In this case, the lower process communicates at the end of the period, so that always process p<sub>3</sub> and p<sub>5</sub> receive the new data.
232
+
An Example of the LET concept is shown in Figure 8. Assume that two processes are communicating data via one global variable. The timepoint when this data is written is at the end of the processing time. In the default case (left side), the process p<sub>3</sub> and p<sub>4</sub> receive the update. At the right side of Figure 8, the same scenario is shown with LET semantics. Here, the data is communicated only at period boundaries. In this case, the lower process communicates at the end of the period, so that always process p<sub>3</sub> and p<sub>5</sub> receive the new data.
0 commit comments