sunSafePointCpp#
Executive Summary#
This module provides the attitude guidance output for a sun pointing mode. This could be used for safe mode, or a power generation mode. The input is the sun direction vector which does not have to be normalized, as well as the body rate information. The output is the standard BSK attitude reference state message. The sun direction measurement is cross with the desired body axis that is to point at the sun to create a principle rotation vector. The dot product between these two vectors is used to extract the principal rotation angle. With these a tracking error MRP state is computer. The body rate tracking errors relative to the reference frame are set equal to the measured body rates to bring the vehicle to rest when pointing at the sun. Thus, the reference angular rate and acceleration vectors relative to the inertial frame are nominally set to zero. If the sun vector is not available, then the reference rate is set to a body-fixed value while the attitude tracking error is set to zero.
The file
PDF Description
.
contains further information on this module’s function, how to run it, as well as testing.
Message Connection Descriptions#
The following table lists all the module input and output messages. The module msg connection is set by the user from python. The msg type contains a link to the message structure definition, while the description provides information on what this message is used for.
Msg Variable Name |
Msg Type |
Description |
---|---|---|
attGuidanceOutMsg |
AttGuidMsgPayload |
attitude guidance output message |
sunDirectionInMsg |
NavAttMsgPayload |
sun direction input message |
imuInMsg |
NavAttMsgPayload |
IMU input message |
Class SunSafePointCpp#
-
class SunSafePointCpp : public SysModel#
Sun safe point attitude guidance class.
Public Functions
-
SunSafePointCpp() = default#
Constructor.
-
~SunSafePointCpp() = default#
Destructor.
-
void reset(uint64_t currentSimNanos) override#
Reset member function.
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 currentSimNanos) override#
Update member function.
This method takes the estimated body-observed sun vector and computes the current attitude/attitude rate errors to pass on to control.
- Parameters:
callTime – [ns] Time the method is called
- Returns:
void
-
double getMinUnitMag() const#
Getter method for the minimally accepted sun body vector norm.
Getter method for the minimally accepted sun body vector norm.
- Returns:
double
-
double getSmallAngle() const#
Getter method for the small alignment tolerance angle near 0 or 180 degrees.
Getter method for the small alignment tolerance angle near 0 or 180 degrees.
- Returns:
double
-
double getSunAxisSpinRate() const#
Getter method for the desired constant spin rate about sun heading vector.
Getter method for the desired constant spin rate about sun heading vector.
- Returns:
double
-
const Eigen::Vector3d &getOmega_RN_B() const#
Getter method for the desired body rate vector if no sun direction is available.
Getter method for the desired body rate vector if no sun direction is available.
- Returns:
const Eigen::Vector3d
-
const Eigen::Vector3d &getSHatBdyCmd() const#
Getter method for the desired body vector to point at the sun.
Getter method for the desired body vector to point at the sun.
- Returns:
const Eigen::Vector3d
-
void setMinUnitMag(const double minUnitMag)#
Setter method for the minimally accepted sun body vector norm.
Setter method for the minimally accepted sun body vector norm.
- Parameters:
minUnitMag – The minimally acceptable norm of sun body vector
- Returns:
void
-
void setSmallAngle(const double smallAngle)#
Setter method for the small alignment tolerance angle near 0 or 180 degrees.
Setter method for the small alignment tolerance angle near 0 or 180 degrees.
- Parameters:
smallAngle – [rad] An angle value that specifies what is near 0 or 180 degrees
- Returns:
void
-
void setSunAxisSpinRate(const double sunAxisSpinRate)#
Setter method for the desired constant spin rate about sun heading vector.
Setter method for the desired constant spin rate about sun heading vector.
- Parameters:
sunAxisSpinRate – [rad/s] Desired constant spin rate about sun heading vector
- Returns:
void
-
void setOmega_RN_B(const Eigen::Vector3d &omega_RN_B)#
Setter method for the desired body rate vector if no sun direction is available.
Setter method for the desired body rate vector if no sun direction is available.
- Parameters:
omega_RN_B – [rad/s] Desired body rate vector if no sun direction is available
- Returns:
void
-
void setSHatBdyCmd(const Eigen::Vector3d &sHatBdyCmd)#
Setter method for the desired body vector to point at the sun.
Setter method for the desired body vector to point at the sun.
- Parameters:
sHatBdyCmd – Desired body vector to point at the sun
- Returns:
void
-
SunSafePointCpp() = default#