Reference frame generators that compute the desired attitude trajectory for the attitude control loop, covering inertial pointing, orbit-relative frames, celestial body pointing, and safe-mode sun pointing.
Attitude guidance modules produce AttRefMsgPayload messages that specify the desired reference frame orientation, angular velocity, and angular acceleration. The attitude control module then drives the spacecraft toward this reference.
Inertial pointing
Fix the spacecraft to a constant inertial direction.
Orbit-relative frames
Align the body frame with the Hill or velocity frame.
Celestial pointing
Point a body axis at a planet, moon, or the sun.
Safe-mode pointing
Drive to a sun-pointing attitude for power generation.
Generates a constant inertial attitude reference. You set the desired MRP attitude sigma_R0N once, and the module outputs a reference frame that does not rotate. Reference angular velocity and acceleration are zero.
Computes the orbital Hill reference frame (also called the LVLH frame). The reference frame aligns the first axis with the nadir direction, the third axis with the negative orbit normal, and the second axis completes the right-hand triad. Works for any Keplerian orbit — circular, elliptical, or hyperbolic.
Aligns the spacecraft with the velocity reference frame, where the first axis points along the inertial velocity vector. Like hillPoint, it supports any Keplerian orbit type and accepts an optional central-body ephemeris.
Points a primary body-fixed axis toward a primary celestial object while simultaneously doing the best possible job of pointing a secondary axis toward a second celestial object. A common example is pointing a science sensor at a planet while keeping the solar panel normal close to the sun direction.
Provides a safe-mode or power-generation pointing mode. The module crosses the measured sun direction with the desired body axis to form a principal rotation vector and extracts the principal angle via a dot product, then assembles an MRP tracking-error state. When sun-vector data is unavailable, the reference rate is set to a configured body-fixed spin and the attitude tracking error is zeroed, allowing the vehicle to continue spinning safely.
sunSafePoint outputs an AttGuidMsgPayload (tracking errors) rather than an AttRefMsgPayload (reference state). Connect it directly to a feedback controller such as mrpFeedback.
from Basilisk.fswAlgorithms import sunSafePointsunSafe = sunSafePoint.sunSafePoint()sunSafe.ModelTag = "sunSafePoint"sunSafe.sunAngleErr = 0.01 # [rad] acceptable pointing errorsunSafe.minUnitMag = 0.1 # minimum sun-vector magnitude to use measurementsunSafe.sunDirectionInMsg.subscribeTo(cssEstMsg)sunSafe.imuInMsg.subscribeTo(imuMsg)scSim.AddModelToTask(taskName, sunSafe)
Applies an MRP offset rotation on top of an existing reference message, allowing you to add a fixed or slowly-varying attitude offset without modifying the base guidance module.
Drives the camera boresight toward a target body detected by optical navigation processing, closing the loop between headingSuKF and the attitude control system.
Applies a small attitude correction to an incoming reference message. Use this to compensate for known calibration offsets between the reference frame and the actual desired pointing direction.
Converts an AttRefMsgPayload reference message and a navigation attitude message into an AttGuidMsgPayload tracking-error message suitable for input to a feedback controller.
Wraps any guidance module output and suppresses updates when the attitude error falls within a configurable deadband, reducing unnecessary thruster firings.
Optimizes the rotation of a single-axis solar array drive while satisfying a spacecraft pointing constraint, maximizing solar power while maintaining a science or communication attitude.