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.

Module I/O Messages

Msg Variable Name

Msg Type

Description

attOutMsg

NavAttMsgPayload

attitude navigation output msg

transOutMsg

NavTransMsgPayload

translation navigation output msg

scStateInMsg

SCStatesMsgPayload

spacecraft state input msg

sunStateInMsg

SpicePlanetStateMsgPayload

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

&#8212; Cholesky-decomposition or matrix square root of the covariance matrix to apply errors with

Eigen::VectorXd walkBounds

&#8212; “3-sigma” errors to permit for states

Eigen::VectorXd navErrors

&#8212; Current navigation errors applied to truth

Message<NavAttMsgPayload> attOutMsg

attitude navigation output msg

Message<NavTransMsgPayload> transOutMsg

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

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

Private Members

Eigen::MatrixXd AMatrix

&#8212; The matrix used to propagate the state

GaussMarkov errorModel

&#8212; Gauss-markov error states

uint64_t prevTime

&#8212; Previous simulation time observed