Skip to main content

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

stepsInRamp
int
Number of integration sub-steps used in the thrust ramp model. Higher values increase accuracy of the on/off transient.
mDotTotal
double
Current total propellant mass-flow rate across all firing thrusters [kg/s]. Read-only during simulation.
fuelMass
double
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:
thrDir_B
double[3]
Thrust direction unit vector in the body frame (or secondary-body frame).
thrLoc_B
double[3]
Thruster location vector from the body-frame origin B [m].
MaxThrust
double
Maximum thrust level [N].
steadyIsp
double
Specific impulse at steady-state [s].

Input messages

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)

Build docs developers (and LLMs) love