Spacecraft hub.
Spacecraft hub
spacecraft
spacecraft
The
Messages
spacecraft module is the primary rigid-body hub for 6-DOF translational and rotational motion. It is an instantiation of the dynamicObject abstract class and serves as the attachment point for all state and dynamic effectors.Key parameters| Variable | Type | Description |
|---|---|---|
mHub | double | Hub mass [kg] |
IHubPntBc_B | double[3][3] | Hub inertia tensor about point B in body frame [kg·m²] |
r_BcB_B | double[3] | Center of mass offset from point B in body frame [m] |
r_CN_NInit | double[3] | Initial inertial position [m] |
v_CN_NInit | double[3] | Initial inertial velocity [m/s] |
sigma_BNInit | double[3] | Initial attitude as MRP |
omega_BN_BInit | double[3] | Initial angular velocity in body frame [rad/s] |
| Message | Type | Direction | Description |
|---|---|---|---|
scStateOutMsg | SCStatesMsgPayload | Output | Spacecraft state |
scMassStateOutMsg | SCMassPropsMsgPayload | Output | Mass properties |
attRefInMsg | AttRefMsgPayload | Input (optional) | Prescribed attitude |
transRefInMsg | TransRefMsgPayload | Input (optional) | Prescribed translation |
spacecraftSystem
spacecraftSystem
spacecraftSystem extends the single-spacecraft hub to support simulations with multiple connected spacecraft objects sharing a common dynamics kernel. Use this module when you need to simulate formation flying or docked assemblies as a single dynamical system.State effectors
State effectors add internal degrees of freedom to the spacecraft. Attach them withscObject.addStateEffector(effector).
reactionWheelStateEffector
reactionWheelStateEffector
Simulates an array of reaction wheels. The module includes safety mechanisms to prevent numerical instability from excessive wheel acceleration.Key parameters
Messages
| Parameter | Default | Description |
|---|---|---|
maxWheelAcceleration | 1.0e6 rad/s² | Maximum allowed wheel acceleration |
largeTorqueThreshold | 10.0 N·m | Warning threshold for large torque with unlimited torque setting |
| Message | Type | Direction | Description |
|---|---|---|---|
rwMotorCmdInMsg | ArrayMotorTorqueMsgPayload | Input (optional) | Motor torque commands |
rwSpeedOutMsg | RWSpeedMsgPayload | Output | Wheel speed array |
rwOutMsgs | RWConfigLogMsgPayload | Output (vector) | Per-wheel log messages |
vscmgStateEffector
vscmgStateEffector
Implements Variable Speed Control Moment Gyroscopes (VSCMGs) — devices that combine a spinning wheel with a gimballed mount. Each VSCMG has two torque inputs: wheel spin torque (
u_s) and gimbal torque (u_g).Messages| Message | Type | Direction | Description |
|---|---|---|---|
cmdsInMsg | VSCMGArrayTorqueMsgPayload | Input | Wheel and gimbal torque commands |
speedOutMsg | VSCMGSpeedMsgPayload | Output | VSCMG speed states |
vscmgOutMsgs | VSCMGConfigMsgPayload | Output (vector) | Per-device config log |
hingedRigidBodyStateEffector
hingedRigidBodyStateEffector
Models a flexible appendage (e.g., a solar panel) as a rigid body attached to the hub by a single-DOF torsional hinge with a linear spring and optional damping term. Each panel has two states: hinge angle
theta and angular rate thetaDot.Messages| Message | Type | Direction | Description |
|---|---|---|---|
hingedRigidBodyRefMsg | HingedRigidBodyMsgPayload | Input (optional) | Reference angle and rate |
motorTorqueInMsg | ArrayMotorTorqueMsgPayload | Input (optional) | Hinge motor torque |
hingedRigidBodyOutMsg | HingedRigidBodyMsgPayload | Output | Panel hinge angle and rate |
hingedRigidBodyConfigLogOutMsg | SCStatesMsgPayload | Output | Panel inertial position and attitude |
fuelTank
fuelTank
Tracks fuel mass as a state variable and provides its contribution to the spacecraft mass properties. A
FuelTank must be assigned a tank model (e.g., FuelTankModelConstantVolume) and can be linked to one or more thruster effectors for automatic mass depletion.Messages| Message | Type | Direction | Description |
|---|---|---|---|
fuelTankOutMsg | FuelTankMsgPayload | Output | Tank mass and properties |
Other state effectors
Other state effectors
| Module | Description |
|---|---|
dualHingedRigidBodies | Two-panel articulated solar array with two hinge DOFs |
NHingedRigidBodies | Arbitrarily long chain of N hinged rigid body segments |
spinningBodies | Constant-rate spinning body attached to the hub |
linearTranslationalBodies | Body that translates linearly relative to the hub |
prescribedMotion | Body whose motion is fully prescribed via an input message |
LinearSpringMassDamper | Linear spring-mass-damper fuel slosh model |
sphericalPendulum | Spherical pendulum fuel slosh model |
meanRevertingNoiseStateEffector | Scalar mean-reverting noise state (e.g., density correction) |
Dynamic effectors
Dynamic effectors apply forces or torques to the hub without maintaining internal states. Attach them withscObject.addDynamicEffector(effector).
thrusterDynamicEffector / thrusterStateEffector
thrusterDynamicEffector / thrusterStateEffector
Simulates a set of thrusters.
thrusterDynamicEffector applies impulsive or continuous thrust; thrusterStateEffector models propellant-fed thrusters with a state-based mass flow rate.Use simIncludeThruster.thrusterFactory() to configure thruster arrays and attach them to both the spacecraft and a fuelTank effector.dragDynamicEffector
dragDynamicEffector
Computes aerodynamic drag using a cannonball model (attitude-independent) or flat-plate model. Supports an optional density correction state and atmosphere-relative velocity computation for low Earth orbit.Messages
| Message | Type | Direction | Description |
|---|---|---|---|
atmoDensInMsg | AtmoPropsMsgPayload | Input | Atmospheric density from an atmosphere module |
radiationPressure
radiationPressure
Computes solar radiation pressure (SRP) force and torque on the spacecraft. Supports cannonball models and lookup-table-based models for complex shapes.Messages
| Message | Type | Direction | Description |
|---|---|---|---|
sunEphmInMsg | SpicePlanetStateMsgPayload | Input | Sun state |
sunEclipseInMsg | EclipseMsgPayload | Input (optional) | Eclipse factor |
extForceTorque
extForceTorque
Applies a user-specified external force and/or torque directly to the spacecraft hub. Useful for modelling outgassing, disturbance forces, or directly injecting control inputs for testing.Messages
| Message | Type | Direction | Description |
|---|---|---|---|
cmdTorqueInMsg | CmdTorqueBodyMsgPayload | Input | Commanded body torque |
cmdForceBodyInMsg | CmdForceBodyMsgPayload | Input | Commanded force in body frame |
cmdForceInertialInMsg | CmdForceInertialMsgPayload | Input | Commanded force in inertial frame |
constraintDynamicEffector
constraintDynamicEffector
Enforces a physical connection between two separate spacecraft using Baumgarte stabilization. You specify the connection point on each spacecraft in its body frame and tune stiffness (
alpha) and damping (beta) gains.The task must execute spacecraft 1 before spacecraft 2. Set
ModelPriority or add them to the task in order.Other dynamic effectors
Other dynamic effectors
| Module | Description |
|---|---|
GravityGradientEffector | Gravity gradient torque on an extended body |
MtbEffector | Magnetic torque bar (magnetorquer) actuator |
facetDragEffector | Faceted aerodynamic drag model |
facetSRPDynamicEffector | Faceted solar radiation pressure model |
msmForceTorque | Multi-sphere model electrostatic force and torque |
hingedRigidBodyMotor | Actuator for driving a hinged rigid body hinge |
ExtPulsedTorque | Time-series of pulsed torque inputs |
Gravity models
gravityEffector — spherical harmonics
gravityEffector — spherical harmonics
The default gravity model uses a spherical harmonics expansion. Configure it through
simIncludeGravBody.gravBodyFactory(), which handles loading SPICE-compatible gravity coefficient files.polyhedralGravityModel
polyhedralGravityModel
Computes gravitational acceleration from an arbitrarily shaped body modelled as a constant-density polyhedron, following Werner and Scheeres (1996). Suitable for small-body proximity operations around asteroids or comets.Supported shape file formats:
.tab, .obj, and .txt. Vertex coordinates must be in kilometers.Integrators
TheIntegrators sub-folder provides numerical integration schemes that you assign to a spacecraft object. Available integrators include RK4, RKF45 (variable step), and Euler. Assign one with: