Spacecraft Control Bundle 1
fsw_ephemeris Class Reference

This class gets the ephemeris from the simulation. More...

#include <fsw_ephemeris.h>

Inheritance diagram for fsw_ephemeris:

Public Member Functions

 fsw_ephemeris (const char *mod_name)
 
void initialize_data ()
 Create data and request event notification for FSW_EPHEMERIS_TRIGGER. More...
 
void initialize_data_requests ()
 Request the ephemeris simulation variables and the orbit state. More...
 
void handle_event (int code)
 Get the ephemeris data from the sim variables and set the outputs. More...
 

Protected Attributes

EPH Inputs

The ephemeris inputs come from the simulation.


CD_REQUEST_REF observer_sim_ref
 The reference system center - sim input (int) More...
 
CD_REQUEST_REF rotation_matrix_planet_sim_ref
 Rotation matrix of planet. 9x1 in row major form. - sim input. More...
 
CD_REQUEST_REF planet_index_sim_ref
 SPICE id of planet - sim input. More...
 
CD_REQUEST_REF position_planet_sim_ref
 Planet position - sim input. More...
 
CD_REQUEST_REF velocity_planet_sim_ref
 Planet velocity - sim input. More...
 
CD_REQUEST_REF planet_mu_sim_ref
 Planet gravitional constant - sim input. More...
 
CD_REQUEST_REF planet_radius_sim_ref
 Planet radius - sim input. More...
 
CD_REQUEST_REF od_state_ref
 State estimate - module input. More...
 
EPH Outputs


CD_CREATE_REF ephem_planet_mu_ref
 Planet mu (1,n) - module output. More...
 
CD_CREATE_REF ephem_observer_ref
 Observer (int) More...
 
CD_CREATE_REF ephem_planet_rotation_matrix_ref
 Rotation matrix - module output. More...
 
CD_CREATE_REF ephem_planet_velocity_ref
 Planet velocity - module output. More...
 
CD_CREATE_REF ephem_planet_position_ref
 Planet position - module output. More...
 
CD_CREATE_REF ephem_planet_index_ref
 Planet index (1,n) - module output. More...
 
CD_CREATE_REF ephem_planet_radius_ref
 Planet radius - module output. More...
 
CD_CREATE_REF ephem_sun_vector_ref
 Sun vector - module output. More...
 

Detailed Description

This class gets the ephemeris from the simulation.

It uses the SPICE library format.

The following ephemeris information is provided:

  • observer (center of the reference frame)
  • rotation matrix for each planet
  • planet index (array of SPICE ids)
  • position of the planet
  • gravitational constant of the planet
  • radius of the planet
  • sun vector

The flight software would have its own SPICE library. This class is provided solely for convenience during development.

See also
gravity_spice

Member Function Documentation

◆ handle_event()

void fsw_ephemeris::handle_event ( int  code)

Get the ephemeris data from the sim variables and set the outputs.

The sun vector is set in two cases:

  1. If the observer is the sun, the orbit state od_state is used as the sun vector.
  2. If the sun is otherwise in the list of indices, its vector is obtained from the ephemeris.

References ephem_observer_ref, ephem_planet_index_ref, ephem_planet_mu_ref, ephem_planet_position_ref, ephem_planet_radius_ref, ephem_planet_rotation_matrix_ref, ephem_planet_velocity_ref, ephem_sun_vector_ref, observer_sim_ref, od_state, od_state_ref, planet_index_sim_ref, planet_mu_sim_ref, planet_radius_sim_ref, position_planet_sim_ref, rotation_matrix_planet_sim_ref, and velocity_planet_sim_ref.

◆ initialize_data()

◆ initialize_data_requests()

void fsw_ephemeris::initialize_data_requests ( )

Member Data Documentation

◆ ephem_observer_ref

CD_CREATE_REF fsw_ephemeris::ephem_observer_ref
protected

Observer (int)

Referenced by handle_event(), and initialize_data().

◆ ephem_planet_index_ref

CD_CREATE_REF fsw_ephemeris::ephem_planet_index_ref
protected

Planet index (1,n) - module output.

Referenced by handle_event(), and initialize_data().

◆ ephem_planet_mu_ref

CD_CREATE_REF fsw_ephemeris::ephem_planet_mu_ref
protected

Planet mu (1,n) - module output.

Referenced by handle_event(), and initialize_data().

◆ ephem_planet_position_ref

CD_CREATE_REF fsw_ephemeris::ephem_planet_position_ref
protected

Planet position - module output.

Referenced by handle_event(), and initialize_data().

◆ ephem_planet_radius_ref

CD_CREATE_REF fsw_ephemeris::ephem_planet_radius_ref
protected

Planet radius - module output.

Referenced by handle_event(), and initialize_data().

◆ ephem_planet_rotation_matrix_ref

CD_CREATE_REF fsw_ephemeris::ephem_planet_rotation_matrix_ref
protected

Rotation matrix - module output.

Referenced by handle_event(), and initialize_data().

◆ ephem_planet_velocity_ref

CD_CREATE_REF fsw_ephemeris::ephem_planet_velocity_ref
protected

Planet velocity - module output.

Referenced by handle_event(), and initialize_data().

◆ ephem_sun_vector_ref

CD_CREATE_REF fsw_ephemeris::ephem_sun_vector_ref
protected

Sun vector - module output.

Referenced by handle_event(), and initialize_data().

◆ observer_sim_ref

CD_REQUEST_REF fsw_ephemeris::observer_sim_ref
protected

The reference system center - sim input (int)

Referenced by handle_event(), and initialize_data_requests().

◆ od_state_ref

CD_REQUEST_REF fsw_ephemeris::od_state_ref
protected

State estimate - module input.

Used for the sun vector calculation when the sun is the observer.

Estimated orbit state (6x1 matrix). Consists of [r;v] in km and km/s.

Parameters
path"od_state"
typesd_type_matrix

Referenced by handle_event(), and initialize_data_requests().

◆ planet_index_sim_ref

CD_REQUEST_REF fsw_ephemeris::planet_index_sim_ref
protected

SPICE id of planet - sim input.

Referenced by handle_event(), and initialize_data_requests().

◆ planet_mu_sim_ref

CD_REQUEST_REF fsw_ephemeris::planet_mu_sim_ref
protected

Planet gravitional constant - sim input.

Referenced by handle_event(), and initialize_data_requests().

◆ planet_radius_sim_ref

CD_REQUEST_REF fsw_ephemeris::planet_radius_sim_ref
protected

Planet radius - sim input.

Referenced by handle_event(), and initialize_data_requests().

◆ position_planet_sim_ref

CD_REQUEST_REF fsw_ephemeris::position_planet_sim_ref
protected

Planet position - sim input.

Referenced by handle_event(), and initialize_data_requests().

◆ rotation_matrix_planet_sim_ref

CD_REQUEST_REF fsw_ephemeris::rotation_matrix_planet_sim_ref
protected

Rotation matrix of planet. 9x1 in row major form. - sim input.

Referenced by handle_event(), and initialize_data_requests().

◆ velocity_planet_sim_ref

CD_REQUEST_REF fsw_ephemeris::velocity_planet_sim_ref
protected

Planet velocity - sim input.

Referenced by handle_event(), and initialize_data_requests().


The documentation for this class was generated from the following files: