triad#
Executive Summary#
This module computes a reference attitude frame using the TRIAD method that simultaneously satisfies multiple pointing constraints. The TRIAD Method determines spacecraft attitude by aligning two sets of vector observations. the input arguments are two non-parallel vectors in the body frame ( \({}^\mathcal{B}\hat{h}_1\) and \({}^\mathcal{B}\hat{a}_1\) ) and two targeted non-parallel vector in the inertial frame. The mathematical details of the triad algorithm can be found in R. Calaon phd “Guidance, Control and Momentum Management of Spacecraft with Multiple Pointing Constraints “. it creates a rotational matrix that prioritise the alignment of the body-frame direction \({}^\mathcal{B}\hat{h}_1\) with a the targeted reference direction \({}^\mathcal{N}\hat{h}_\text{ref}\), while taking is account all other constrains of the state.
Message Connection Descriptions#
The following table lists all the module input and output messages. The msg type contains a link to the message structure definition, while the description provides information on what this message is used for.

Figure 1: TRIAD
Illustration#
Msg Variable Name |
Msg Type |
Description |
---|---|---|
attNavInMsg |
NavAttMsgPayload |
Input message containing current attitude and Sun direction in body-frame coordinates. Note that, for the Sun direction to appear in the message, the SpicePlanetStateMsgPayload must be provided as input msg to simpleNav, otherwise the Sun direction is zeroed by default. |
bodyHeadingInMsg |
BodyHeadingMsgPayload |
(optional) Input message containing the body-frame direction \({}^\mathcal{B}\hat{h}\). Alternatively, the direction can be specified as input parameter |
inertialHeadingInMsg |
InertialHeadingMsgPayload |
(optional) Input message containing the inertial-frame direction \({}^\mathcal{N}\hat{h}_\text{ref}\). Alternatively, the direction can be specified as input parameter |
ephemerisInMsg |
EphemerisMsgPayload |
(optional) Input message containing the inertial position of a celestial object, whose direction with respect to the spacecraft serves as the inertial reference direction \({}^\mathcal{N}\hat{h}_\text{ref}\). This input msg must be provided together with |
transNavInMsg |
NavTransMsgPayload |
(optional) Input message containing the inertial position and velocity of the spacecraft. This message must be connected together with |
attRefOutMsg |
AttRefMsgPayload |
Output attitude reference message containing reference attitude, reference angular rates and accelerations. |
Detailed Module Description#
The details of the equations applied by this module can be found in R. Calaon PhD thesis, “Guidance, Control and Momentum Management of Spacecraft with Multiple Pointing Constraints”.
Attention must be paid to how these pieces of input information is provided:
Input body-frame heading: this can be specified either via the input parameter
h1Hat_B
, or connecting the input messagebodyHeadingInMsg
. Specifying the body-frame heading via the input parameter is desirable when such direction does not change over time; vice versa, when the body-frame heading is time varying, this needs to be passed via thebodyHeadingInMsg
. When bothh1Hat_B
andbodyHeadingInMsg
are provided, the module ignoresh1Hat_B
and reads the body-frame direction from the input message.Input inertial-frame heading: this can be specified via the input parameter
hHat_N
, connecting the messageinertialHeadingInMsg
, or connecting both the messagesephemerisInMsg
andtransNavInMsg
. The input parameterhHat_N
is desirable when the inertial heading is fixed in time. The messageinertialHeadingInMsg
is needed when the heading direction is time-varying. Finally, providingephemerisInMsg
andtransNavInMsg
allows to compute the inertial heading as the vector difference between the inertial position of a celestial object and the position of the spacecraft: this is useful when the spacecraft needs to point a body-frame heading towards a celestial object. When all of these input messages are connected, the inertial heading is computed from theinertialHeadingInMsg
.
Module Assumptions and Limitations#
The limitations of this module are inherent to the geometry of the problem, which determines whether or not all the constraints can be satisfied. This applies on singularities when the Sun Prop Earth angle (SPE) is (0,90,180).
User Guide#
The required module configuration is:
attReference = triad.Triad()
attReference.modelTag = "triad"
attReference.a1Hat_B = a1_B
scSim.AddModelToTaskAddModelToTask(simTaskName, attReference)
The module is configurable with the following parameters:
Parameter |
Default |
Description |
---|---|---|
|
[0, 0, 0] |
solar array drive direction, it must be specified by the user |
|
[0, 0, 0] |
body-frame heading |
|
[0, 0, 0] |
inertial-frame heading |
|
0 |
should be set to 1 when the celestial body pointed at is the Sun. |
Class Triad#
-
class Triad : public SysModel#
Top level structure for the sub-module routines.
Public Functions
-
void reset(uint64_t callTime) override#
This method performs a complete reset of the module. Local module variables that retain time varying states between function calls are reset to their default values.
- Parameters:
callTime – [ns] time the method is called
- Returns:
void
-
void updateState(uint64_t callTime) override#
The Update() function computes the reference MRP attitude, reference angular rate and acceleration
- Parameters:
callTime – The clock time at which the function was called (nanoseconds)
- Returns:
void
-
void setA1Hat_B(const Eigen::Vector3d &a1Hat_B)#
Setter for a1Hat_B variable.
Setter method for sigma_R0R.
- Parameters:
a1Hat_B –
- Returns:
void
-
const Eigen::Vector3d getA1Hat_B() const#
Getter for a1Hat_B variable.
Getter method for a1Hat_B.
- Returns:
const Eigen::Vector3d
-
void setH1Hat_B(const Eigen::Vector3d &h1Hat_B)#
Setter for h1Hat_B variable.
Setter method for sigma_R0R.
- Parameters:
h1Hat_B –
- Returns:
void
-
const Eigen::Vector3d getH1Hat_B() const#
Getter for h1Hat_B variable.
Getter method for h1Hat_B.
- Returns:
const Eigen::Vector3d
-
void setHHat_N(const Eigen::Vector3d &hHat_N)#
Setter for hHat_N variable.
Setter method for sigma_R0R.
- Parameters:
hHat_N –
- Returns:
void
-
const Eigen::Vector3d getHHat_N() const#
Getter for hHat_N variable.
Getter method for hHat_N.
- Returns:
const Eigen::Vector3d
-
void setCelestialBodyInput(const CelestialBody &celestialBodyInput)#
Setter for celestialBodyInput variable.
Setter method for sigma_R0R.
- Parameters:
celestialBodyInput –
- Returns:
void
-
const CelestialBody getCelestialBodyInput() const#
Getter for celestialBodyInput variable.
Getter method for celestialBodyInput.
- Returns:
const CelestialBody
-
void setBodyAxisInput(const BodyAxisInput &bodyAxisInput)#
Setter for bodyAxisInput variable.
Setter method for sigma_R0R.
- Parameters:
bodyAxisInput –
- Returns:
void
-
const BodyAxisInput getBodyAxisInput() const#
Getter for bodyAxisInput variable.
Getter method for bodyAxisInput.
- Returns:
const BodyAxisInput
-
void setInertialAxisInput(const InertialAxisInput &inertialAxisInput)#
Setter for inertialAxisInput variable.
Setter method for sigma_R0R.
- Parameters:
inertialAxisInput –
- Returns:
void
-
const InertialAxisInput getInertialAxisInput() const#
Getter for inertialAxisInput variable.
Getter method for inertialAxisInput.
- Returns:
const InertialAxisInput
Public Members
input msg measured attitude
-
ReadFunctor<BodyHeadingMsgPayload> bodyHeadingInMsg#
input body heading msg
-
ReadFunctor<InertialHeadingMsgPayload> inertialHeadingInMsg#
input inertial heading msg
input msg measured position
-
ReadFunctor<EphemerisMsgPayload> ephemerisInMsg#
input ephemeris msg
-
Message<AttRefMsgPayload> attRefOutMsg#
output attitude reference message
-
BSKLogger bskLogger = {}#
BSK Logging.
-
void reset(uint64_t callTime) override#