Skip to main content
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.

Inertial 3D (inertial3D)

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.

Messages

VariableTypeDirectionDescription
attRefOutMsgAttRefMsgPayloadOutputConstant inertial reference attitude
from Basilisk.fswAlgorithms import inertial3D
import numpy as np

pointing = inertial3D.inertial3D()
pointing.ModelTag = "inertial3D"
pointing.sigma_R0N = [0.1, 0.2, -0.1]  # desired MRP

scSim.AddModelToTask(taskName, pointing)

Inertial 3D spin (inertial3DSpin)

Similar to inertial3D but adds a constant spin rate about one body axis. Useful for momentum management during cruise or for spinning spacecraft.

Hill frame pointing (hillPoint)

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.

Messages

VariableTypeDirectionDescription
transNavInMsgNavTransMsgPayloadInputSpacecraft translational state
celBodyInMsgEphemerisMsgPayloadInput(optional) Central body ephemeris
attRefOutMsgAttRefMsgPayloadOutputHill-frame reference attitude
from Basilisk.fswAlgorithms import hillPoint

hillPointing = hillPoint.hillPoint()
hillPointing.ModelTag = "hillPoint"
hillPointing.transNavInMsg.subscribeTo(navTransMsg)
hillPointing.celBodyInMsg.subscribeTo(earthEphemMsg)  # optional

scSim.AddModelToTask(taskName, hillPointing)

Velocity pointing (velocityPoint)

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.

Messages

VariableTypeDirectionDescription
transNavInMsgNavTransMsgPayloadInputSpacecraft translational state
celBodyInMsgEphemerisMsgPayloadInput(optional) Central body ephemeris
attRefOutMsgAttRefMsgPayloadOutputVelocity-frame reference attitude

Celestial two-body pointing (celestialTwoBodyPoint)

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.

Messages

VariableTypeDirectionDescription
transNavInMsgNavTransMsgPayloadInputSpacecraft translational state
celBodyInMsgEphemerisMsgPayloadInputPrimary celestial body
secCelBodyInMsgEphemerisMsgPayloadInput(optional) Secondary celestial body
attRefOutMsgAttRefMsgPayloadOutputTwo-body pointing reference
from Basilisk.fswAlgorithms import celestialTwoBodyPoint

celPointing = celestialTwoBodyPoint.celestialTwoBodyPoint()
celPointing.ModelTag = "celTwoBodyPoint"
celPointing.transNavInMsg.subscribeTo(navTransMsg)
celPointing.celBodyInMsg.subscribeTo(planetEphemMsg)
celPointing.secCelBodyInMsg.subscribeTo(sunEphemMsg)   # optional secondary

scSim.AddModelToTask(taskName, celPointing)

Sun safe pointing (sunSafePoint)

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.

Messages

VariableTypeDirectionDescription
sunDirectionInMsgNavAttMsgPayloadInputSun direction vector (need not be normalized)
imuInMsgNavAttMsgPayloadInputMeasured body rates from IMU
attGuidanceOutMsgAttGuidMsgPayloadOutputAttitude guidance tracking errors
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 sunSafePoint

sunSafe = sunSafePoint.sunSafePoint()
sunSafe.ModelTag = "sunSafePoint"
sunSafe.sunAngleErr = 0.01         # [rad] acceptable pointing error
sunSafe.minUnitMag = 0.1           # minimum sun-vector magnitude to use measurement
sunSafe.sunDirectionInMsg.subscribeTo(cssEstMsg)
sunSafe.imuInMsg.subscribeTo(imuMsg)

scSim.AddModelToTask(taskName, sunSafe)

Euler rotation (eulerRotation)

Applies a sequence of Euler angle rotations on top of a base reference frame. Use it to rotate any existing reference by a fixed offset.

MRP rotation (mrpRotation)

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.

Location pointing (locationPointing)

Points a body-fixed axis toward a position vector expressed in the inertial frame. Useful for ground target tracking or relay satellite pointing.

Optical navigation pointing (opNavPoint)

Drives the camera boresight toward a target body detected by optical navigation processing, closing the loop between headingSuKF and the attitude control system.

Attitude reference correction (attRefCorrection)

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.

Attitude tracking error (attTrackingError)

Converts an AttRefMsgPayload reference message and a navigation attitude message into an AttGuidMsgPayload tracking-error message suitable for input to a feedback controller.

Waypoint reference (waypointReference)

Interpolates between a sequence of attitude waypoints to generate a smooth reference trajectory.

Constrained attitude maneuver (constrainedAttitudeManeuver)

Plans a slew maneuver that avoids user-defined constraint cones, such as keeping a star tracker away from the sun.

Simple deadband (simpleDeadband)

Wraps any guidance module output and suppresses updates when the attitude error falls within a configurable deadband, reducing unnecessary thruster firings.

Raster manager (rasterManager)

Sequences a series of attitude hold and slew commands to raster a sensor across a target region.

One-axis solar-array pointing (oneAxisSolarArrayPoint)

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.

Build docs developers (and LLMs) love