Module: atmosphereBase¶
General atmosphere base class used to calculate neutral density/temperature using arbitrary models
The Atmosphere class is used to calculate the neutral density and temperature above a body using arbitrary models.
Each atmosphere is attached to a specific planet, but provides support for multiple spacecraft through addSpacecraftToModel()
.
-
class
AtmosphereBase
: public SysModel¶ Public Functions
-
AtmosphereBase
()¶ This method initializes some basic parameters for the module.
- Return
void
-
~AtmosphereBase
()¶ Destructor.
- Return
void
-
void
SelfInit
()¶ SelfInit for this method creates a seperate magnetic field message for each of the spacecraft that were added using AddSpacecraftToModel. Additional model outputs are also initialized per-spacecraft.
- Return
void
-
void
CrossInit
()¶ This method is used to connect the input position message from the spacecraft. Additonal model-specific cross inits are also conducted.
- Return
void
-
void
Reset
(uint64_t CurrentSimNanos)¶ This method is used to reset the module.
- Return
void
-
void
addSpacecraftToModel
(std::string tmpScMsgName)¶ Adds the spacecraft message name to a vector of sc message names and automatically creates an output message name.
- Return
void
- Parameters
tmpScMsgName
: A spacecraft state message name.
-
void
UpdateState
(uint64_t CurrentSimNanos)¶ Computes the current local magnetic field for each spacecraft and writes their respective messages.
- Return
void
- Parameters
CurrentSimNanos
: The current simulation time in nanoseconds
Public Members
-
std::vector<std::string>
scStateInMsgNames
¶ Vector of the spacecraft position/velocity message names.
-
std::vector<std::string>
envOutMsgNames
¶ Vector of message names to be written out by the environment.
-
std::string
planetPosInMsgName
¶ Message name for the planet’s SPICE position message.
-
double
envMinReach
¶ [m] Minimum planet-relative position needed for the environment to work, default is off (neg. value)
-
double
envMaxReach
¶ [m] Maximum distance at which the environment will be calculated, default is off (neg. value)
-
double
planetRadius
¶ [m] Radius of the planet
Protected Functions
-
void
writeMessages
(uint64_t CurrentClock)¶ This method is used to write the output magnetic field messages whose names are established in AddSpacecraftToModel.
- Return
void
- Parameters
CurrentClock
: The current time used for time-stamping the message
-
bool
readMessages
()¶ This method is used to read the incoming command message and set the associated spacecraft positions for computing the atmosphere.
- Return
void
-
void
updateLocalAtmosphere
(double currentTime)¶ This method is used to update the local magnetic field based on each spacecraft’s position.
- Return
void
-
void
updateRelativePos
(SpicePlanetStateSimMsg *planetState, SCPlusStatesSimMsg *scState)¶ This method is used to determine the spacecraft position vector relative to the planet.
- Return
void
- Parameters
planetState
: A space planetstate message struct.scState
: A spacecraftPlusStates message struct.
-
void
evaluateAtmosphereModel
(AtmoPropsSimMsg *msg, double currentTime) = 0¶
-
void
customSelfInit
()¶ Custom SelfInit() method. This allows a child class to add additional functionality to the SelfInit() method
- Return
void
-
void
customCrossInit
()¶ Custom CrossInit() method. This allows a child class to add additional functionality to the CrossInit() method
- Return
void
-
void
customReset
(uint64_t CurrentClock)¶ Custom Reset() method. This allows a child class to add additional functionality to the Reset() method
- Return
void
-
void
customWriteMessages
(uint64_t CurrentClock)¶ Custom output message writing method. This allows a child class to add additional functionality.
- Return
void
-
bool
customReadMessages
()¶ Custom output input reading method. This allows a child class to add additional functionality.
- Return
void
-
void
customSetEpochFromVariable
()¶ Custom customSetEpochFromVariable() method. This allows a child class to specify how the module epoch information is set by a module variable.
- Return
void
Protected Attributes
-
double
orbitRadius
¶ [m] sc orbit radius about planet
-
double
orbitAltitude
¶ [m] sc altitude above planetRadius
-
uint64_t
OutputBufferCount
¶ number of output buffers for messaging system
-
std::vector<AtmoPropsSimMsg>
envOutBuffer
¶ Message buffer for magnetic field messages
-
std::vector<int64_t>
envOutMsgIds
¶ vector of module output message IDs
-
std::vector<int64_t>
scStateInMsgIds
¶ vector of spacecraft state message IDs
-
int64_t
planetPosInMsgId
¶ ID of the planet state message.
-
std::vector<SCPlusStatesSimMsg>
scStates
¶ vector of the spacecraft state messages
-
SpicePlanetStateSimMsg
planetState
¶ planet state message
-
struct tm
epochDateTime
¶ time/date structure containing the epoch information using a Gregorian calendar
-
int64_t
epochInMsgId
¶ ID of the epoch message.
-