Skip to content

Commit 515dafe

Browse files
committed
feat: dynamics node description
1 parent 3d53840 commit 515dafe

1 file changed

Lines changed: 23 additions & 2 deletions

File tree

docs/user-guide/concepts/simulator-architecture.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ If you are adding a new sensor (e.g. camera), you could either change the `senso
195195
The `forces_and_moments` node is responsible for computing the **aerodynamic** forces and moments based on a model of the aircraft.
196196
Other forces like gravity and collision forces are not included in the `forces_and_moments` node.
197197

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.
199199
These PWM commands correspond to what would be either servo deflections or motor throttle values on the physical aircraft.
200200
To compute the forces and moments generated by those actuator commands, we need to convert the PWM commands into inputs used by our model.
201201

@@ -244,10 +244,31 @@ More information on these equations can be found in chapters 4 and 14 of *Small
244244
However, we do need to accurately set the positions of the motors.
245245
This is done through the `rotor_dists`, `rotor_radial_angles`, and `rotor_rotation_directions` parameters of the `forces_and_moments` node.
246246

247-
### Dynamics
248247
!!! danger "TODO"
249248
continue here... This page is still under construction. Check back soon!
250249

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+
251272
## Swapping out modules
252273

253274
This section describes how one would swap out modules, i.e. a different dynamics module.

0 commit comments

Comments
 (0)