scenarioAttitudeFeedbackNumba
Overview
Numba reimplementation of scenarioAttitudeFeedback.
The spacecraft dynamics and effectors stay in C++. Every other module in the pipeline – navigation sensor, guidance reference, tracking-error computation, and feedback controller – is reimplemented as a Making Numba Modules.
[spacecraft C++]
| scStateOutMsg
[NumbaSimpleNav] (full Gauss-Markov noise model, optional sun pointing)
| attOutMsg / transOutMsg
[NumbaAttTrackingError] <-- [NumbaInertial3D] attRefOutMsg
| attGuidOutMsg
[NumbaMrpFeedback] (full RW support, controlLawType flag)
| cmdTorqueOutMsg
[extForceTorque C++]
The Numba modules are 1-to-1 in capability with the corresponding C/C++ modules:
NumbaSimpleNav matches C++ Module: simpleNav: full 18-state Gauss-Markov error model (position, velocity, attitude, rate, sun-pointing, accumulated-DV),
crossTrans/crossAttcoupling flags, optional sun-direction output.NumbaInertial3D matches C Module: inertial3D: fixed inertial attitude reference.
NumbaAttTrackingError matches C Module: attTrackingError: MRP tracking error, frame-offset correction.
NumbaMrpFeedback matches C Module: mrpFeedback: PD/PID feedback with reaction-wheel angular-momentum augmentation and
controlLawTypeflag.
The script is found in the folder basilisk/examples and executed by using:
python3 scenarioAttitudeFeedbackNumba.py
- class scenarioAttitudeFeedbackNumba.NumbaAttTrackingError(*args, **kwargs)[source]
Bases:
NumbaModelFSW: MRP attitude tracking error from navigation and reference messages.
Matches C Module: attTrackingError including the frame-offset correction
memory.sigma_R0R(body-fixed offset from reference to control-target frame; default zero).
- class scenarioAttitudeFeedbackNumba.NumbaInertial3D(*args, **kwargs)[source]
Bases:
NumbaModelGuidance: fixed inertial attitude reference with zero rates.
Matches C Module: inertial3D.
- class scenarioAttitudeFeedbackNumba.NumbaMrpFeedback(*args, **kwargs)[source]
Bases:
NumbaModelFSW: MRP PD/PID feedback controller with full reaction-wheel support.
Matches C Module: mrpFeedback including:
Reaction-wheel angular-momentum augmentation (
rwParamsInMsg,rwSpeedsInMsg, optionalrwAvailInMsg).memory.controlLawType: 0 = reference-frame gyroscopic (default), else full-body.Integral feedback (
memory.Ki > 0) withmemory.integralLimitbound.Feed-forward torque via
memory.knownTorquePntB_B.
- Memory parameters (set directly before
InitializeSimulation()): K proportional gain on MRP error P rate-error feedback gain [N m s] Ki integral gain; negative -> disabled integralLimit wind-up bound [N m] knownTorquePntB_B feed-forward torque [N m, 3-vector] controlLawType 0 = reference-frame gyroscopic; else full-body
Bases:
NumbaModelNavigation sensor with full 18-state Gauss-Markov error model.
Matches C++ Module: simpleNav in capability:
18 error states: position [0:3], velocity [3:6], attitude [6:9], body-rate [9:12], sun-pointing [12:15], accumulated-DV [15:18].
memory.PMatrix(18x18 ndarray): process-noise std-deviation matrix.memory.walkBounds(18-vector): random-walk bounds per state.memory.crossTrans/memory.crossAtt(int32): coupling flags.self.RNGSeed: reproducible noise seed (inherited from SysModel, default0x1badcad1). Set beforeInitializeSimulation().Optional sun-direction output when
sunStateInMsgis subscribed.
Set all
memory.*attributes beforeInitializeSimulation(). Defaults are zero -> noise-free pass-through.Propagate the error-state model and publish noisy nav estimates.
- scenarioAttitudeFeedbackNumba.run(show_plots, useUnmodeledTorque, useIntGain, useKnownTorque)[source]
- Parameters:
show_plots (bool) – display plots when True
useUnmodeledTorque (bool) – apply a constant external disturbance torque
useIntGain (bool) – enable integral feedback in the controller
useKnownTorque (bool) – feed-forward the known external torque