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
| Fig 1: Architecture of the simulator. Note that the blue dashed box refers to the only parts that are active when running on hardware, while every module runs in sim. |
51
51
52
52
Throughout this guide, we will refer to **_modules_** in the simulator.
@@ -143,6 +143,40 @@ By default, this parameter is set `false`.
143
143
When `use_sim_time == true`, however, the node will listen to the `clock` topic as its internal time source.
144
144
This means that all timers, calls to `get_clock()`, or any other time for that node will be based off of the `clock` topic.
145
145
146
+
ROSflight sim can be run with or without the `time_manager`.
147
+
If you are using the `time_manager`, note that you can toggle pause/play of the simulation using the `/time_manager/toggle_pause` service call.
148
+
149
+
!!! warning "When to use the `time_manager`"
150
+
151
+
The `time_manager` is really only useful when you care about running faster or slower than real time or pausing and starting the simulation.
152
+
If you don't care about this, don't run the `time_manager` node, and don't set the `use_sim_time` parameter of other nodes to `true`.
153
+
This will free up resources otherwise used by the `time_manager`.
154
+
155
+
The `time_manager`'s main job is to publish the current time to the `clock` topic.
156
+
It needs to publish fast enough so that other timers on other nodes aren't stalled because the `clock` topic isn't coming fast enough.
157
+
158
+
159
+
The `time_manager` has some built in functionality to enable faster or slower than real time simulations.
160
+
This is done by configuring the parameters associated with the `time_manager` node.
|`default_pub_rate_us`| 100.0 | Default interval the time manager will publish to the `clock` topic (in microseconds) |
165
+
|`real_time_multiplier`| 1.0 | Multiplier for configuring faster or slower than real time simulations. E.g. set to 2 to run 2 times as fast as real time |
166
+
167
+
!!! example "Pub rate example"
168
+
169
+
Let's say I know that the fastest timer in my simulation environment runs at 400 Hz.
170
+
Thus, that timer has to tick every 2.5 ms.
171
+
The `default_pub_rate` parameter therefore needs to be **smaller than 2500** so that the timer runs reliably.
172
+
173
+
Note that we have not tested all of the timing intracacies of the `clock` topic--set it to publish faster than you need and you probably won't run into issues.
174
+
175
+
!!! example "Real time multiplier example"
176
+
177
+
If I want to run a simulation 2 times faster than real time, I would set `real_time_multiplier = 2.0`.
178
+
If I wanted to run it 0.5 times as fast as real time, I would set it to 0.5.
0 commit comments