Module: reactionWheelStateEffector¶
Class that is used to implement an effector impacting a dynamic body that does not itself maintain a state or represent a changing component of the body (for example: gravity, thrusters, solar radiation pressure, etc.)
The module
PDF Description
contains further information on this module’s function,
how to run it, as well as testing.
- 
class ReactionWheelStateEffector: public SysModel, public StateEffector¶
- #include <reactionWheelStateEffector.h>reaction wheel state effector class Public Functions - 
ReactionWheelStateEffector()¶
 - 
~ReactionWheelStateEffector()¶
 - 
void registerStates(DynParamManager &states)¶
 - 
void linkInStates(DynParamManager &states)¶
 - 
void writeOutputStateMessages(uint64_t integTimeNanos)¶
- This method is here to write the output message structure into the specified message. - Return
- void 
- Parameters
- integTimeNanos: The current time used for time-stamping the message
 
 
 - 
void computeDerivatives(double integTime, Eigen::Vector3d rDDot_BN_N, Eigen::Vector3d omegaDot_BN_B, Eigen::Vector3d sigma_BN)¶
 - 
void updateEffectorMassProps(double integTime)¶
- Method for stateEffector to give mass contributions 
 - 
void updateContributions(double integTime, BackSubMatrices &backSubContr, Eigen::Vector3d sigma_BN, Eigen::Vector3d omega_BN_B, Eigen::Vector3d g_N)¶
- Back-sub contributions 
 - 
void updateEnergyMomContributions(double integTime, Eigen::Vector3d &rotAngMomPntCContr_B, double &rotEnergyContr, Eigen::Vector3d omega_BN_B)¶
- Energy and momentum calculations 
 - 
void SelfInit()¶
- This method is used to clear out the current RW states and make sure that the overall model is ready - Return
- void 
 
 - 
void CrossInit()¶
- This method is used to connect the input command message to the RWs. It sets the message ID based on what it finds for the input string. If the message is not successfully linked, it will warn the user. - Return
- void 
 
 - 
void addReactionWheel(RWConfigSimMsg *NewRW)¶
- class method 
 - 
void UpdateState(uint64_t CurrentSimNanos)¶
- This method is the main cyclical call for the scheduled part of the RW dynamics model. It reads the current commands array and sets the RW configuration data based on that incoming command set. Note that the main dynamical method (ComputeDynamics()) is not called here and is intended to be called from the dynamics plant in the system - Return
- void 
- Parameters
- CurrentSimNanos: The current simulation time in nanoseconds
 
 
 - 
void WriteOutputMessages(uint64_t CurrentClock)¶
- This method is here to write the output message structure into the specified message. - Return
- void 
- Parameters
- CurrentClock: The current time used for time-stamping the message
 
 
 - 
void ReadInputs()¶
- This method is used to read the incoming command message and set the associated command structure for operating the RWs. - Return
- void 
 
 - 
void ConfigureRWRequests(double CurrentTime)¶
- This method is used to read the new commands vector and set the RW firings appropriately. It assumes that the ReadInputs method has already been run successfully. - Return
- void 
- Parameters
- CurrentTime: The current simulation time converted to a double
 
 
 Public Members - 
std::vector<RWConfigSimMsg> ReactionWheelData¶
- RW information2 
 - 
Eigen::MatrixXd *g_N¶
- [m/s^2] Gravitational acceleration in N frame components 
 - 
std::string InputCmds¶
- message used to read command inputs 
 - 
std::string OutputDataString¶
- port to use for output data 
 - 
uint64_t OutputBufferCount¶
- Count on number of buffers to output 
 - 
std::vector<RWCmdSimMsg> NewRWCmds¶
- Incoming attitude commands 
 - 
RWSpeedIntMsg outputStates¶
- (-) Output data from the reaction wheels 
 - 
std::string nameOfReactionWheelOmegasState¶
- class variable 
 - 
std::string nameOfReactionWheelThetasState¶
- class variable 
 - 
size_t numRW¶
- number of reaction wheels 
 - 
size_t numRWJitter¶
- number of RW with jitter 
 - 
BSKLogger bskLogger¶
- BSK Logging 
 Private Members - 
std::vector<std::string> rwOutMsgNames¶
- vector with the message names of each RW 
 - 
std::vector<int64_t> rwOutMsgIds¶
- vector with the ID of each RW 
 - 
int64_t CmdsInMsgID¶
- Message ID for incoming data 
 - 
int64_t StateOutMsgID¶
- Message ID for outgoing data 
 - 
ArrayMotorTorqueIntMsg IncomingCmdBuffer¶
- One-time allocation for savings 
 - 
uint64_t prevCommandTime¶
- Time for previous valid thruster firing 
 
-