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.
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#
-
class OrbElemConvert : public SysModel#
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#
— Current grav param (inertial)
-
ClassicElements CurrentElem#
— Current orbital elements
-
SCStatesMsgPayload statesIn#
— spacecraft state message
-
SpicePlanetStateMsgPayload planetIn#
— planet state message
-
ReadFunctor<SCStatesMsgPayload> scStateInMsg#
— sc state input message
-
ReadFunctor<SpicePlanetStateMsgPayload> spiceStateInMsg#
— spice state input message
-
ReadFunctor<ClassicElementsMsgPayload> elemInMsg#
— orbit element input message
-
Message<SCStatesMsgPayload> scStateOutMsg#
— sc state output message
-
Message<SpicePlanetStateMsgPayload> spiceStateOutMsg#
— spice state input message
-
Message<ClassicElementsMsgPayload> elemOutMsg#
— orbit element output message
-
OrbElemConvert()#