Overview
ThrusterDynamicEffector is a DynamicEffector you attach to a Spacecraft object to simulate one or more thrusters. Each thruster fires based on a commanded on-time array from its input message, and the module computes the resulting force and torque in the spacecraft body frame.
from Basilisk.simulation import thrusterDynamicEffector
from Basilisk.utilities import simIncludeThruster
Key parameters
Number of integration sub-steps used in the thrust ramp model. Higher values increase accuracy of the on/off transient.
Current total propellant mass-flow rate across all firing thrusters [kg/s]. Read-only during simulation.
Current total fuel mass in the connected fuel tank [kg].
Adding thrusters
thrusterEffector.addThruster(thrConfig)
# or, for a thruster attached to a secondary body:
thrusterEffector.addThruster(thrConfig, bodyStateMsg)
thrConfig is a THRSimConfig object with the following key fields:
Thrust direction unit vector in the body frame (or secondary-body frame).
Thruster location vector from the body-frame origin B [m].
Maximum thrust level [N].
Specific impulse at steady-state [s].
cmdsInMsg
ReadFunctor<THRArrayOnTimeCmdMsgPayload>
Array of thruster on-time commands [s]. One entry per thruster.thrusterEffector.cmdsInMsg.subscribeTo(thrCmdMsg)
Output messages
thrusterOutMsgs
vector<THROutputMsgPayload>
Per-thruster output messages containing current thrust magnitude, thrust vector components, and accumulated impulse.
Full setup example
from Basilisk.simulation import thrusterDynamicEffector, spacecraft
from Basilisk.utilities import simIncludeThruster, macros, SimulationBaseClass
scSim = SimulationBaseClass.SimBaseClass()
proc = scSim.CreateNewProcess("dynProc")
scSim.CreateNewTask("dynTask", macros.sec2nano(0.1))
scObject = spacecraft.Spacecraft()
scObject.ModelTag = "bsk-Sat"
thrFactory = simIncludeThruster.thrusterFactory()
thrFactory.create(
"MOOG_Monarc_1",
[1.0, 0.0, 0.0], # thrust direction in body frame
[0.5, 0.0, 0.0], # location [m]
)
thrEffector = thrusterDynamicEffector.ThrusterDynamicEffector()
thrEffector.ModelTag = "ACSThrusterDynamics"
thrFactory.addToSpacecraft(scObject.ModelTag, thrEffector, scObject)
scObject.addDynamicEffector(thrEffector)
scSim.AddModelToTask("dynTask", thrEffector)
scSim.AddModelToTask("dynTask", scObject)