Module: gravityEffector¶
- 
class SphericalHarmonics¶
- #include <gravityEffector.h>spherical harmonics class Public Functions - 
SphericalHarmonics()¶
 - 
~SphericalHarmonics()¶
 - 
bool initializeParameters()¶
- [-] configure all spher-harm based on inputs 
 - 
double getK(const unsigned int degree)¶
- class method 
 - 
Eigen::Vector3d computeField(const Eigen::Vector3d pos_Pfix, unsigned int degree, bool include_zero_degree)¶
- ——————————Main Interface————————-/// - Use to compute the field in position pos, given in a body frame. - Return
- acc Vector including the computed field. 
- Parameters
- pos_Pfix: Position in which the field is to be computed.
- degree: used to compute the field.
 
- Parameters
- include_zero_degree: Boolean that determines whether the zero-degree term is included.
 
 
 - 
bool harmReady()¶
- class variable 
 Public Members - 
double maxDeg¶
- [-] Maximum degree of the spherical harmonics 
 - 
double radEquator¶
- [-] Reference radius for the planet 
 - 
double muBody¶
- [-] Gravitation parameter for the planet 
 - 
std::vector<std::vector<double>> cBar¶
- [-] C coefficient set 
 - 
std::vector<std::vector<double>> sBar¶
- [-] S coefficient set 
 - 
std::vector<std::vector<double>> aBar¶
- [-] Normalized ‘derived’ Assoc. Legendre 
 - 
std::vector<std::vector<double>> n1¶
- [-] What am I 
 - 
std::vector<std::vector<double>> n2¶
- [-] What am I 
 - 
std::vector<std::vector<double>> nQuot1¶
- [-] What am I 
 - 
std::vector<std::vector<double>> nQuot2¶
- [-] What am I 
 - 
BSKLogger bskLogger¶
- BSK Logging 
 
- 
- 
class GravBodyData¶
- #include <gravityEffector.h>Container for gravitational body data. This class is designed to hold all of the information for a gravity body. The nominal use-case has it initialized at the python level and attached to dynamics using the AddGravityBody method. The module PDF Description contains further information on this module’s function, how to run it, as well as testing. Public Functions - 
GravBodyData()¶
- Set parameters for a gravity body. 
 - 
~GravBodyData()¶
- Destructor. 
 - 
void initBody(int64_t moduleID)¶
- Method to initialize the gravity body. 
 - 
Eigen::Vector3d computeGravityInertial(Eigen::Vector3d r_I, uint64_t simTimeNanos)¶
- compute the gravitational acceleration - Parameters
- r_I: inertial position vector
- simTimeNanos: simulation time (ns)
 
 
 - 
double computePotentialEnergy(Eigen::Vector3d r_I)¶
- compute potential energy - Parameters
- r_I: inertial position vector
 
 
 - 
void loadEphemeris(int64_t moduleID)¶
- Command to load the ephemeris data. - load ephemeris information - Parameters
- moduleID:
 
 
 - 
void registerProperties(DynParamManager &statesIn)¶
- class method 
 Public Members - 
bool isCentralBody¶
- Flag indicating that object is center. 
 - 
bool isDisplayBody¶
- Flag indicating that body is display. 
 - 
bool useSphericalHarmParams¶
- Flag indicating to use spherical harmonics perturbations. 
 - 
double mu¶
- [m3/s^2] central body gravitational param 
 - 
double ephemTime¶
- [s] Ephemeris time for the body in question 
 - 
double ephIntTime¶
- [s] Integration time associated with the ephem data 
 - 
double radEquator¶
- [m] Equatorial radius for the body 
 - 
SpicePlanetStateSimMsg localPlanet¶
- [-] Class storage of ephemeris info from scheduled portion 
 - 
SingleMessageHeader localHeader¶
- [-] Header information for ephemeris storage 
 - 
std::string bodyInMsgName¶
- Gravitational body name. 
 - 
std::string outputMsgName¶
- Ephemeris information relative to display frame. 
 - 
std::string planetEphemName¶
- Ephemeris name for the planet. 
 - 
int64_t outputMsgID¶
- ID for output message data. 
 - 
int64_t bodyMsgID¶
- ID for ephemeris data message. 
 - 
SphericalHarmonics spherHarm¶
- Object that computes the spherical harmonics gravity field. 
 - 
BSKLogger bskLogger¶
- BSK Logging 
 - 
Eigen::MatrixXd *r_PN_N¶
- [m] (state engine property) planet inertial position vector 
 - 
Eigen::MatrixXd *v_PN_N¶
- [m/s] (state engine property) planet inertial velocity vector 
 - 
Eigen::MatrixXd *muPlanet¶
- [m/s] (state engine property) planet inertial velocity vector 
 - 
Eigen::MatrixXd *J20002Pfix¶
- [m/s] (state engine property) planet attitude [PN] 
 - 
Eigen::MatrixXd *J20002Pfix_dot¶
- [m/s] (state engine property) planet attitude rate [PN_dot] 
 
- 
- 
class GravityEffector: public SysModel¶
- #include <gravityEffector.h>gravity effector class Public Functions - 
GravityEffector()¶
 - 
~GravityEffector()¶
 - 
void SelfInit()¶
- class method 
 - 
void CrossInit()¶
- class method 
 - 
void UpdateState(uint64_t CurrentSimNanos)¶
- update state - Parameters
- currentSimNanos:
 
 
 - 
void linkInStates(DynParamManager &statesIn)¶
- class method 
 - 
void registerProperties(DynParamManager &statesIn)¶
- register properties - Parameters
- statesIn: simulation states
 
 
 - 
void computeGravityField(Eigen::Vector3d r_cF_N, Eigen::Vector3d rDot_cF_N)¶
- Calculate gravitational acceleration of s/c wrt inertial (no central body) or wrt central body - Parameters
- r_cF_N: is position of center of mass of s/c wrt frame it is stored/integrated in in spacecraft
- rDot_cF_N: is the derivative of above
 
 
 - 
void updateInertialPosAndVel(Eigen::Vector3d r_BF_N, Eigen::Vector3d rDot_BF_N)¶
- Calculate gravitational acceleration of s/c wrt inertial (no central body) or wrt central body - Parameters
- r_BF_N: is position of body frame of s/c wrt frame it is stored/integrated in in spacecraft
- rDot_BF_N: is the derivative of above
 
 
 - 
void updateEnergyContributions(Eigen::Vector3d r_CN_N, double &orbPotEnergyContr)¶
- Orbital Potential Energy Contributions 
 - 
void setGravBodies(std::vector<GravBodyData*> gravBodies)¶
- class method 
 - 
void addGravBody(GravBodyData *gravBody)¶
- class method 
 - 
void prependSpacecraftNameToStates()¶
- class method 
 Public Members - 
std::string vehicleGravityPropName¶
- [-] Name of the vehicle mass state 
 - 
std::string systemTimeCorrPropName¶
- [-] Name of the correlation between times 
 - 
std::vector<GravBodyData*> gravBodies¶
- [-] Vector of bodies we feel gravity from 
 - 
GravBodyData *centralBody¶
- Central body. 
 - 
std::string inertialPositionPropName¶
- [-] Name of the inertial position property 
 - 
std::string inertialVelocityPropName¶
- [-] Name of the inertial velocity property 
 - 
std::string nameOfSpacecraftAttachedTo¶
- [-] Name of the s/c this gravity model is attached to 
 - 
BSKLogger bskLogger¶
- BSK Logging 
 Private Functions - 
Eigen::Vector3d getEulerSteppedGravBodyPosition(GravBodyData *bodyData)¶
- class method - compute planet position eiht Euler integration - Parameters
- bodyData: planet data
 
 
 - 
void writeOutputMessages(uint64_t currentSimNanos)¶
- class method - write output message - Parameters
- currentSimNanos:
 
 
 Private Members - 
Eigen::MatrixXd *gravProperty¶
- [-] g_N property for output 
 - 
Eigen::MatrixXd *timeCorr¶
- [-] Time correlation property 
 - 
int64_t centralBodyOutMsgId¶
- [-] Id for the central body spice data output message 
 - 
std::string centralBodyOutMsgName¶
- [-] Unique name for the central body spice data output message 
 - 
Eigen::MatrixXd *inertialPositionProperty¶
- [m] r_N inertial position relative to system spice zeroBase/refBase coordinate frame, property for output. 
 - 
Eigen::MatrixXd *inertialVelocityProperty¶
- [m/s] v_N inertial velocity relative to system spice zeroBase/refBase coordinate frame, property for output. 
 
-