Spacecraft Control Bundle 1
ons_lunar_od.h
1/*
2 * \file ons_lunar_od.h
3 * Header file for object of class ons_lunar_od.
4 * Copyright 2010, Princeton Satellite Systems, Inc.
5 * All Rights Reserved.
6 */
7
8#include <ControlDeck2/ControlDeck2.h>
9#import <SCControl/SCControl.h>
11#include "sc_events.h"
12#include "sc_data_names.h"
13
14#ifndef ONS_LUNAR_OD
15#define ONS_LUNAR_OD
16
17
18
36
37class ons_lunar_od : public cd_control_module
38{
39 public:
40 ons_lunar_od (const char * mod_name);
41 void initialize_data();
42 void initialize_data_requests();
43 void handle_event(int code);
44 void reset_ukf();
45
46 protected:
47
51 CD_REQUEST_REF range_message_ref;
53 CD_REQUEST_REF omega_sim_ref;
55 CD_REQUEST_REF q_eci_to_body_sim_ref;
57 CD_REQUEST_REF velocity_sim_ref;
59 CD_REQUEST_REF position_sim_ref;
61 CD_REQUEST_REF jd_ref;
63 CD_REQUEST_REF ephem_planet_mu_ref;
67 CD_REQUEST_REF ephem_planet_index_ref;
69 CD_REQUEST_REF ephem_observer_ref;
73 CD_REQUEST_REF unit_vector_ref;
75 CD_REQUEST_REF q_body_to_camera_1_ref;
77 CD_REQUEST_REF q_body_to_camera_2_ref;
79 CD_REQUEST_REF star_data_1_ref;
81 CD_REQUEST_REF star_data_2_ref;
83 CD_REQUEST_REF planet_data_1_ref;
85 CD_REQUEST_REF planet_data_2_ref;
87 CD_REQUEST_REF star_id_camera_1_ref;
89 CD_REQUEST_REF star_id_camera_2_ref;
91 CD_REQUEST_REF u_star_camera_1_ref;
93 CD_REQUEST_REF u_star_camera_2_ref;
99
103 CD_CREATE_REF od_state_ref;
105 CD_CREATE_REF od_covariance_ref;
109
128
131
132
134 CD_CREATE_REF od_reset_command_ref;
135
138
144
145private:
147 UKF ukf;
148
150 static ml_matrix meas_fun_ukf (const ml_matrix &x, void *context);
152 static ml_matrix rhs_nav (ml_matrix x, double t, void *context);
154 int get_index( int id, ml_matrix index_list );
156 ml_matrix u_meas_catalog( ml_matrix id, ml_matrix u_catalog );
158 int initialized;
160 double julian_date_old;
162 double julian_date_propagate_old;
163
165 typedef struct estimation_struct
166 {
167 ml_matrix qECIToBody;
168 ml_matrix omegaBody;
169 ml_matrix r_planet_cat;
170 ml_matrix u_star_cat;
171 ml_matrix a_planet_cat;
172 ml_matrix planet_chord;
173 ml_matrix planet_planet;
174 ml_matrix planet_star;
175 ml_matrix r_gs_eci;
176 ml_matrix v_gs_eci;
177 ml_matrix r_gps_eci;
178 ml_matrix v_gps_eci;
179 ml_matrix r_isl_eci;
180 ml_matrix v_isl_eci;
181 ml_matrix meas_type;
182 ml_matrix acceleration;
183 ml_matrix meas_id;
184 } EstimationData;
185
186};
187
188extern "C"
189{
190 cd_control_module *ons_lunar_od_builder(const char *name);
191}
192
193#endif
This class computes the orbit of the main spacecraft.
Definition: ons_lunar_od.h:38
CD_REQUEST_REF ephem_planet_position_ref
Planet position.
Definition: ons_lunar_od.h:65
CD_CREATE_REF camera_2_data_command_ref
Camera 2 data.
Definition: ons_lunar_od.h:142
CD_REQUEST_REF u_star_camera_1_ref
Unit vectors for identified stars.
Definition: ons_lunar_od.h:91
CD_CREATE_REF od_parameter_command_ref
UKF parameters.
Definition: ons_lunar_od.h:121
CD_REQUEST_REF star_data_1_ref
Star data camera 1.
Definition: ons_lunar_od.h:79
CD_CREATE_REF od_covariance_diag_ref
Covariance diagonal.
Definition: ons_lunar_od.h:107
CD_CREATE_REF od_initial_covariance_command_ref
Initial covariance.
Definition: ons_lunar_od.h:115
CD_REQUEST_REF q_eci_to_body_sim_ref
Quaternion.
Definition: ons_lunar_od.h:55
CD_CREATE_REF od_initial_state_command_ref
Initial state.
Definition: ons_lunar_od.h:117
CD_REQUEST_REF ad_q_eci_to_camera_1_ref
ad camera 1
Definition: ons_lunar_od.h:95
CD_CREATE_REF od_covariance_ref
Covariance.
Definition: ons_lunar_od.h:105
CD_REQUEST_REF ephem_observer_ref
Observer.
Definition: ons_lunar_od.h:69
CD_REQUEST_REF q_body_to_camera_1_ref
Quaternion from body to camera 1.
Definition: ons_lunar_od.h:75
CD_CREATE_REF od_state_ref
State estimate.
Definition: ons_lunar_od.h:103
CD_REQUEST_REF planet_data_2_ref
Planet data camera 2.
Definition: ons_lunar_od.h:85
CD_CREATE_REF od_reset_command_ref
Reset the od.
Definition: ons_lunar_od.h:134
CD_CREATE_REF od_use_state_command_ref
Use state.
Definition: ons_lunar_od.h:127
CD_REQUEST_REF ad_q_eci_to_camera_2_ref
ad camera 2
Definition: ons_lunar_od.h:97
CD_REQUEST_REF ephem_planet_index_ref
Planet index.
Definition: ons_lunar_od.h:67
CD_CREATE_REF od_use_range_command_ref
Use range.
Definition: ons_lunar_od.h:125
CD_CREATE_REF od_update_period_command_ref
Update period.
Definition: ons_lunar_od.h:130
CD_REQUEST_REF ephem_planet_mu_ref
Planet mu.
Definition: ons_lunar_od.h:63
CD_REQUEST_REF planet_data_1_ref
Planet data camera 1.
Definition: ons_lunar_od.h:83
CD_CREATE_REF od_use_camera_command_ref
Use camera.
Definition: ons_lunar_od.h:123
CD_CREATE_REF od_orbit_center_command_ref
Use select the orbit center.
Definition: ons_lunar_od.h:137
CD_REQUEST_REF velocity_sim_ref
Velocity.
Definition: ons_lunar_od.h:57
CD_REQUEST_REF position_sim_ref
Position.
Definition: ons_lunar_od.h:59
CD_REQUEST_REF star_data_2_ref
Star data camera 2.
Definition: ons_lunar_od.h:81
CD_REQUEST_REF star_id_camera_1_ref
Star id camera 1.
Definition: ons_lunar_od.h:87
CD_REQUEST_REF ephem_planet_radius_ref
Planet radius.
Definition: ons_lunar_od.h:71
CD_REQUEST_REF star_id_camera_2_ref
Star id camera 2.
Definition: ons_lunar_od.h:89
CD_CREATE_REF od_plant_noise_covariance_command_ref
Plant noise covariance.
Definition: ons_lunar_od.h:113
CD_CREATE_REF camera_1_data_command_ref
Camera 1 data.
Definition: ons_lunar_od.h:140
CD_REQUEST_REF u_star_camera_2_ref
Unit vectors for identified stars.
Definition: ons_lunar_od.h:93
CD_REQUEST_REF q_body_to_camera_2_ref
Quaternion from body to camera 2.
Definition: ons_lunar_od.h:77
CD_REQUEST_REF jd_ref
Julian date.
Definition: ons_lunar_od.h:61
CD_REQUEST_REF range_message_ref
Range message.
Definition: ons_lunar_od.h:51
CD_CREATE_REF od_meas_noise_covariance_command_ref
Measurment noise covariance.
Definition: ons_lunar_od.h:119
CD_REQUEST_REF unit_vector_ref
Star unit vectors.
Definition: ons_lunar_od.h:73
CD_REQUEST_REF omega_sim_ref
Omega body.
Definition: ons_lunar_od.h:53
Propagate an orbit.
Define the data names used throughout the control system.
Define the trigger and variables names for the software system.