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




attitude navigation output msg



translation navigation output msg



spacecraft state input msg



sun state input input msg (optional)

class SimpleNav : public SysModel
#include <simpleNav.h>

simple navigation module class

Public Functions


This is the constructor for the simple nav model. It sets default variable values and initializes the various parts of the model


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]



void UpdateState(uint64_t CurrentSimNanos)

This method calls all of the run-time operations for the simple nav model.


CurrentSimNanos – The clock time associated with the model call



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.


Clock – The clock time associated with the model’s update call



void computeErrors(uint64_t CurrentSimNanos)

This method sets the propagation matrix and requests new random errors from its GaussMarkov model.


CurrentSimNanos – The clock time associated with the model call



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.


Clock – The clock time associated with the model call



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