Module: orbElemConvert

Executive Summary

An orbital element/cartesian position and velocity converter. 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 variable name 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

scStateInMsg

SCStatesMsgPayload

Spacecraft state input message

spiceStateInMsg

SpicePlanetStateMsgPayload

Spice state input message

elemInMsg

ClassicElementsMsgPayload

classical orbit elements input message

scStateOutMsg

SCStatesMsgPayload

Spacecraft state output message

spiceStateOutMsg

SpicePlanetStateMsgPayload

Spice state output message

elemOutMsg

ClassicElementsMsgPayload

classical orbit elements output message

Warning

Only one of the input messages can be connected at the same time. However, you can have 1 or more output message connected simultaneously.


class OrbElemConvert : public SysModel
#include <orbElemConvert.h>

orbit element converter module class

Public Functions

OrbElemConvert()

The constructor. Note that you may want to overwrite the message names.

~OrbElemConvert()

The destructor. So tired of typing this.

void Reset(uint64_t CurrentSimNanos)

This method is used to reset the module.

Returns

void

void UpdateState(uint64_t CurrentSimNanos)

This method is the main carrier for the conversion routine. If it detects that it needs to re-init (direction change maybe) it will re-init itself. The it either converts elements to cartesian or cartesian to elements.

Parameters

CurrentSimNanos – The current simulation time for system

Returns

void

void WriteOutputMessages(uint64_t CurrentClock)

This method writes the output data out into the messaging system. It does switch depending on whether it is outputting cartesian position/velocity or orbital elements.

Parameters

CurrentClock – The current time in the system for output stamping

Returns

void

void Elements2Cartesian()

The name kind of says it all right? Converts CurrentElem to pos/vel.

Returns

void

void Cartesian2Elements()

The name kind of says it all right? Converts pos/vel to CurrentElem.

Returns

void

void ReadInputs()

This method reads the input message in from the system and sets the appropriate parameters based on which direction the module is running

Returns

void

Public Members

double r_N[3]

m Current position vector (inertial)

double v_N[3]

m/s Current velocity vector (inertial)

double mu

&#8212; Current grav param (inertial)

ClassicElementsMsgPayload CurrentElem

&#8212; Current orbital elements

SCStatesMsgPayload statesIn

&#8212; spacecraft state message

SpicePlanetStateMsgPayload planetIn

&#8212; planet state message

ReadFunctor<SCStatesMsgPayload> scStateInMsg

&#8212; sc state input message

ReadFunctor<SpicePlanetStateMsgPayload> spiceStateInMsg

&#8212; spice state input message

ReadFunctor<ClassicElementsMsgPayload> elemInMsg

&#8212; orbit element input message

Message<SCStatesMsgPayload> scStateOutMsg

&#8212; sc state output message

Message<SpicePlanetStateMsgPayload> spiceStateOutMsg

&#8212; spice state input message

Message<ClassicElementsMsgPayload> elemOutMsg

&#8212; orbit element output message

Private Members

bool inputsGood

&#8212; flag indicating that inputs are good

BSKLogger bskLogger

&#8212; BSK Logging