Module: simpleNav
Executive Summary
Simple navigation model used to provide error-ed truth (or truth). This class is used to perturb the truth state away using a gauss-markov error model. It is designed to look like a random walk process put on top of the nominal position, velocity, attitude, and attitude rate. This is meant to be used in place of the nominal navigation system output.
The module
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 |
---|---|---|
attOutMsg |
attitude navigation output msg |
|
transOutMsg |
translation navigation output msg |
|
scStateInMsg |
spacecraft state input msg |
|
sunStateInMsg |
sun state input input msg (optional) |
-
class SimpleNav : public SysModel
- #include <simpleNav.h>
simple navigation module class
Public Functions
-
SimpleNav()
This is the constructor for the simple nav model. It sets default variable values and initializes the various parts of the model
-
~SimpleNav()
Destructor. Nothing here.
-
void Reset(uint64_t CurrentSimNanos)
This method is used to reset the module. It initializes the various containers used in the model as well as creates the output message. The error states are allocated as follows: Total states: 18
Position errors [0-2]
Velocity errors [3-5]
Attitude errors [6-8]
Body Rate errors [9-11]
Sun Point error [12-14]
Accumulated DV errors [15-17]
- Returns:
void
-
void UpdateState(uint64_t CurrentSimNanos)
This method calls all of the run-time operations for the simple nav model.
- Parameters:
CurrentSimNanos – The clock time associated with the model call
- Returns:
void
-
void computeTrueOutput(uint64_t Clock)
This method uses the input messages as well as the calculated model errors to compute what the output navigation state should be.
- Parameters:
Clock – The clock time associated with the model’s update call
- Returns:
void
-
void computeErrors(uint64_t CurrentSimNanos)
This method sets the propagation matrix and requests new random errors from its GaussMarkov model.
- Parameters:
CurrentSimNanos – The clock time associated with the model call
- Returns:
void
-
void applyErrors()
-
void readInputMessages()
This method reads the input messages associated with the vehicle state and the sun state
-
void writeOutputMessages(uint64_t Clock)
This method writes the aggregate nav information into the output state message.
- Parameters:
Clock – The clock time associated with the model call
- Returns:
void
Public Members
-
Eigen::MatrixXd PMatrix
— Cholesky-decomposition or matrix square root of the covariance matrix to apply errors with
-
Eigen::VectorXd walkBounds
— “3-sigma” errors to permit for states
-
Eigen::VectorXd navErrors
— Current navigation errors applied to truth
-
Message<NavAttMsgPayload> attOutMsg
attitude navigation output msg
-
Message<NavTransMsgPayload> transOutMsg
translation navigation output msg
-
bool crossTrans
— Have position error depend on velocity
-
bool crossAtt
— Have attitude depend on attitude rate
-
NavAttMsgPayload trueAttState
— attitude nav state without errors
-
NavAttMsgPayload estAttState
— attitude nav state including errors
-
NavTransMsgPayload trueTransState
— translation nav state without errors
-
NavTransMsgPayload estTransState
— translation nav state including errors
-
SCStatesMsgPayload inertialState
— input inertial state from Star Tracker
-
SpicePlanetStateMsgPayload sunState
— input Sun state
-
BSKLogger bskLogger
— BSK Logging
-
ReadFunctor<SCStatesMsgPayload> scStateInMsg
spacecraft state input msg
-
ReadFunctor<SpicePlanetStateMsgPayload> sunStateInMsg
(optional) sun state input input msg
Private Members
-
Eigen::MatrixXd AMatrix
— The matrix used to propagate the state
-
GaussMarkov errorModel
— Gauss-markov error states
-
uint64_t prevTime
— Previous simulation time observed
-
SimpleNav()