Actuator models
Commands live in one
ActuatorCommand per
entity: eight thruster throttles (thrust_cmd for thrusters 0–3,
thrust_cmd_ext for 4–7) and four wheel torques (rw_torque_cmd, N·m).
They are constant over a step and zeroed, with the wheel momenta, by every
reset. A NaN or Inf command, which the clamps below would turn into a finite
actuation (a NaN wheel torque into the full negative torque), ends the
environment instead (termination).
Reaction wheels
Up to four wheels per body, unit spin axes \(\hat{\mathbf{a}}_k\) (body frame), sharing torque limit \(\tau_{max}\), capacity \(h_{max}\) (0 = unlimited), wheel inertia \(J_w\) and viscous friction \(b\) ([8], [7]). The state of wheel \(k\) is its angular momentum \(h_k\) about its axis; its speed is reported as \(h_k / J_w\). The motor torque is the clamped command \(\tau_k = \operatorname{clamp}(\tau_{cmd,k}, -\tau_{max}, \tau_{max})\), and
Over an interval \(s\) with constant command this has the exact solution
or \(h_k(0) + \tau_k s\) when \(b = 0\), stable for any step size. It is evaluated as the undamped step scaled by a relaxation factor,
with \((1 - e^{-x})/x\) computed without cancellation for small \(x\), so a vanishing \(b\) converges to the undamped wheel. With \(h_{max} > 0\) the result is clamped to \([-h_{max}, h_{max}]\); torquing away from saturation still works ([8]). Momenta above \(h_{max}\), and an \(h_{max}\) lowered below a stored momentum, are rejected.
The integrators evaluate this solution at the times they need (the step end for Euler; \(\Delta t/2\) and \(\Delta t\) for RK4; two half steps for the symplectic scheme) and subtract the change of the wheel momentum vector
from \(\mathbf{L}\), so \(\mathbf{L} + \mathbf{h}\) changes only through external torques and the gyroscopic term (dynamics). Saturation inside a step is not located (order). See the reaction-wheel example.
Thrusters
Up to eight per body, each with a position \(\mathbf{d}_i\) from the centre of mass and a unit force direction \(\hat{\mathbf{u}}_i\) (body frame), sharing \(T_{max}\) and \(I_{sp}\). With throttle \(u_i = \operatorname{clamp}(u_{cmd,i}, 0, 1)\),
([16]), with \(\dot m = 0\) for \(I_{sp} = 0\) and the sum over configured slots only. These depend only on commands and configuration, so they are evaluated once per step and held for all stages; the force is rotated with each stage's attitude, \(R(q)\,\mathbf{F}_{thr,b}\). Without propellant all three are zero; on the burnout step they are scaled by the burn fraction (variable mass). The default layout and the rest of the usage are in the actuators guide.
Implementation:
actuators/reaction_wheels.py
(compute_rw_angular_momentum) ·
actuators/thrusters.py
(thruster_wrench) · usage in the actuators guide
References: [7], [8], [16] — see the full bibliography.