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.

The ephemeris message emulates the fsw process that would read a spice file for trajectory or attitude. It can contain stochastic errors although it represents the best understanding of the spacecraft states and does not come from a noisy sensor but from a ground-based estimation process.

Module I/O Messages#

Msg Variable Name

Msg Type

Description

attOutMsg

NavAttMsgPayload

attitude navigation output msg

transOutMsg

NavTransMsgPayload

translation navigation output msg

scEphemOutMsg

EphemerisMsgPayload

spacecraft ephemeris output msg

scEphemOutMsg

accelDataOutMsg

spacecraft accelerometer and gyro output msg

scStateInMsg

SCStatesMsgPayload

spacecraft state input msg

sunStateInMsg

SpicePlanetStateMsgPayload

sun state input input msg (optional)

Class SimpleNav#

class SimpleNav : public SysModel#

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 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

double gyroStandardDeviation = 1E-5#

Standard deviation for each rate component.

double accelStandardDeviation = 1E-8#

Standard deviation for each acceleration component.

double gyroBias = 0#

Bias for each rate component.

double accelBias = 0#

Bias for each acceleration component.

double gyroErrors[3 * MAX_ACC_BUF_PKT]#

Errors to apply to each gyro measurement.

double accelErrors[3 * MAX_ACC_BUF_PKT]#

Errors to apply to each accelerometer measurement.

int numberOfGyroBuffers = 100#

Number of gyro measurements per timestep.

int gyroFrequencyPerSecond = 500#

Number of gyro measurements per second.

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

Message<EphemerisMsgPayload> scEphemOutMsg#

translation navigation output msg

Message<AccDataMsgPayload> accelDataOutMsg#

accelerometer and gyro data output msg

bool crossTrans#

&#8212; Have position error depend on velocity

bool crossAtt#

&#8212; Have attitude depend on attitude rate

NavAttMsgPayload trueAttState#

&#8212; attitude nav state without errors

NavAttMsgPayload estAttState#

&#8212; attitude nav state including errors

NavTransMsgPayload trueTransState#

&#8212; translation nav state without errors

NavTransMsgPayload estTransState#

&#8212; translation nav state including errors

EphemerisMsgPayload spacecraftEphemerisState#

&#8212; full spacecraft ephemeris state with errors

AccDataMsgPayload accelDataState#

accelerometer and gyro data payload

SCStatesMsgPayload inertialState#

&#8212; input inertial state from Star Tracker

SpicePlanetStateMsgPayload sunState#

&#8212; input Sun state

BSKLogger bskLogger#

&#8212; BSK Logging

ReadFunctor<SCStatesMsgPayload> scStateInMsg#

spacecraft state input msg

ReadFunctor<SpicePlanetStateMsgPayload> sunStateInMsg#

(optional) sun state input input msg