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
Copy file name to clipboardExpand all lines: docs/user-guide/concepts/simulator-architecture.md
+23-2Lines changed: 23 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -195,7 +195,7 @@ If you are adding a new sensor (e.g. camera), you could either change the `senso
195
195
The `forces_and_moments` node is responsible for computing the **aerodynamic** forces and moments based on a model of the aircraft.
196
196
Other forces like gravity and collision forces are not included in the `forces_and_moments` node.
197
197
198
-
The `forces_and_moments` node takes in raw PWM commands published by the `sil_board` node over the `sim/pwm_output` topic.
198
+
The `forces_and_moments` node takes in raw PWM commands published by the `sil_board` node over the `sim/pwm_output` topic, computes the forces and moments, and publishes those values over the `forces_and_moments` topic.
199
199
These PWM commands correspond to what would be either servo deflections or motor throttle values on the physical aircraft.
200
200
To compute the forces and moments generated by those actuator commands, we need to convert the PWM commands into inputs used by our model.
201
201
@@ -244,10 +244,31 @@ More information on these equations can be found in chapters 4 and 14 of *Small
244
244
However, we do need to accurately set the positions of the motors.
245
245
This is done through the `rotor_dists`, `rotor_radial_angles`, and `rotor_rotation_directions` parameters of the `forces_and_moments` node.
246
246
247
-
### Dynamics
248
247
!!! danger "TODO"
249
248
continue here... This page is still under construction. Check back soon!
250
249
250
+
### Dynamics
251
+
The `dynamics` node is responsible for maintaining the true state of the vehicle and for adding environmental effects.
252
+
It can be thought of as the "world node", since it is the node that implements physical phenomena like gravity, collisions, state integration, etc.
253
+
254
+
!!! note
255
+
256
+
At the time of writing, collisions have not been added to the `dynamics` node.
257
+
If you are interested in fixing this, please see [the GitHub issue](https://github.com/rosflight/rosflight_ros_pkgs/issues/214).
258
+
259
+
The `dynamics` node subscribes to the `forces_and_moments` topic and publishes to the `sim/truth_state` and `sim/wind_truth` topics.
260
+
The `sim/truth_state` topic contains the 19-DoF state for a generic rigid body (3 for position, 4 for quaternion orientation, 6 for angular and linear velocities, 6 for angular and linear accelerations).
261
+
The `sim/wind_truth` topic contains a 3-vector for each component of the wind (in the inertial frame).
262
+
263
+
!!! tip "Wind in sim"
264
+
Currently, no wind is generated by default, but a wind model like the one in chapter 4.4 of *Small Unmanned Aircraft: Theory and Practice* by Beard and McLain.
265
+
266
+
#### Setting the simulation state
267
+
It can be useful to instantiate the simulation at a particular point in state space, to run a particular experiment, to avoid takeoff, and so on.
268
+
269
+
The `dynamics` node has a service server that allows users to set the simulation state (the 19-DoF state) to whatever value you want, called the `dynamics/set_sim_state` service.
270
+
Note that if an estimator is running, it will likely do something crazy if you set the sim state while it is running.
271
+
251
272
## Swapping out modules
252
273
253
274
This section describes how one would swap out modules, i.e. a different dynamics module.
0 commit comments