Module: planetNav

Executive Summary

This module is used to generate noisy ephemeris data, similar to what Module: simpleNav does for spacecraft states. These noisy states can either serve as a stand-in for a filter that estimates the body’s ephemeris or as measurements input into such a filter. This module is most useful for small bodies like comets or asteroids where large uncertainty in the body’s ephemeris is present. This module is not recommended for larger bodies like the Earth or the sun.

The noise present in the planetNav module is designed to mimic the error signals that will be observed in the real navigation system. The true ”noise” present in an orbit determination nav system is always a combination of bias, white noise, and brown noise (or random walk). In order to provide this, a second-order Gauss-Markov process model was added to the simulation utilities that allows the user to configure a random walk process.

Model Functions

This module allows the user to set the bounds and the standard deviations for:

  • The body’s inertial position

  • The body’s inertial velocity

  • The body’s attitude with respect to the inertial frame

  • The body’s angular velocity with respect to the inertial frame expressed in body-frame components

The user can set the noise levels of each of these parameters independently.

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

ephemerisInMsg

EphemerisMsgPayload

Planet ephemeris input msg

ephemerisOutMsg

EphemerisMsgPayload

Planet ephemeris output msg

User Guide

To create a planetNav module, first instantiate a planetNav object. Then, set the walkBounds and standard deviation of each state. Afterwards, set the crossTrans and crossAtt boleans based on whether or not position error should depend on velocity or attitude error should depend on angular velocity.

planetNavigation = planetNav.PlanetNav()
planetNavigation.ModelTag = "planetNavigation"
planetNavigation.walkBounds = errorBounds
planetNavigation.PMatrix = pMatrix
planetNavigation.crossTrans = True
planetNavigation.crossAtt = False
scSim.AddModelToTask(simTaskName, planetNavigation)

class PlanetNav : public SysModel
#include <planetNav.h>

This is an auto-created sample C++ module. The description is included with the module class definition.

Public Functions

PlanetNav()

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

~PlanetNav()

Module Destructor

void Reset(uint64_t CurrentSimNanos)

&#8212; Reset function

This method is used to reset the module and checks that required input messages are connect.

Parameters

CurrentSimNanos – The clock time associated with the module call

Returns

void

void UpdateState(uint64_t CurrentSimNanos)

&#8212; UpdateState

This is the main method that gets called every time the module is updated. Provide an appropriate description.

Parameters

CurrentSimNanos – The clock time associated with the model call

Returns

void

void computeErrors(uint64_t CurrentSimNanos)

&#8212; Compute the errors to add to the truth

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

&#8212; Add the errors to the truth

This method applies the errors to the truePlanetState

Returns

void

void readInputMessages()

This method reads the input messages associated with the planet state

void writeOutputMessages(uint64_t Clock)

—Read the input messages

This method writes the aggregate nav information into the output state message.

Parameters

CurrentSimNanos – The clock time associated with the model call

Returns

void

Public Members

Eigen::MatrixXd PMatrix

—Write the output messages

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

bool crossTrans

&#8212; Have position error depend on velocity

bool crossAtt

&#8212; Have attitude depend on attitude rate

EphemerisMsgPayload truePlanetState

planet ephemeris msg without noise

EphemerisMsgPayload noisePlanetState

planet ephemeris msg with noise

ReadFunctor<EphemerisMsgPayload> ephemerisInMsg

planet ephemeris input msg

Message<EphemerisMsgPayload> ephemerisOutMsg

planet ephemeris output msg

BSKLogger bskLogger

&#8212; BSK Logging

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