Spacecraft Control Bundle 1
fsw_attitude_determination.h
1/*
2 * Header file for object of class fsw_attitude_determination.
3 * Copyright 2010, Princeton Satellite Systems, Inc.
4 * All Rights Reserved.
5 */
6
7#include <ControlDeck2/ControlDeck2.h>
8#import <SCControl/SCControl.h>
9#include "sc_events.h"
10#include "sc_data_names.h"
11
12#ifndef FSW_ATTITUDE_DETERMINATION
13#define FSW_ATTITUDE_DETERMINATION
14
15
17
21class fsw_attitude_determination : public cd_control_module
22{
23 public:
24 fsw_attitude_determination (const char * mod_name);
25 void initialize_data();
26 void initialize_data_requests();
27 void initialize();
28 void handle_event(int code);
29
30 protected:
31
35 CD_REQUEST_REF star_id_camera_ref;
37 CD_REQUEST_REF star_data_ref;
39 CD_REQUEST_REF unit_vector_ref;
41 CD_REQUEST_REF u_star_camera_ref;
43 CD_REQUEST_REF camera_rate_meas_ref;
45 CD_REQUEST_REF jd_ref;
47
57 CD_CREATE_REF ad_q_eci_to_body_ref;
61
70 CD_CREATE_REF ad_reset_command_ref;
84
85private:
87 UKF ukf_camera;
88
90 ml_matrix u_meas_catalog(ml_matrix id, ml_matrix u_catalog);
91
93 ml_matrix q_eci_to_body;
95 ml_matrix gyro_bias_camera;
97 double julian_date_old;
98
100 static ml_matrix meas_fun_ukf (const ml_matrix &x, void *context);
102 static ml_matrix att_prop( ml_matrix x, double t, void *context);
103
105 void reset_ukf();
106
108 ml_matrix q_eci_to_camera;
110 ml_matrix q_eci_to_camera_single_frame;
111
112 int reset_old;
113
114
116 typedef struct estimation_struct
117 {
118 double f;
119 ml_matrix q_eci_to_camera;
120 ml_matrix u_meas_cat;
121 ml_matrix body_rate;
122 ml_matrix body_rate_bias;
123 double dT;
124 } EstimationData;
125
126
127};
128
129extern "C"
130{
131 cd_control_module *fsw_attitude_determination_builder(const char *name);
132}
133
134#endif
Attitude determination using an Unscented Kalman Filter and a star camera.
Definition: fsw_attitude_determination.h:22
void handle_event(int code)
Collect the measurements and update the UKF object.
Definition: fsw_attitude_determination.cc:102
CD_REQUEST_REF unit_vector_ref
Star catalog unit vectors #u_star_catalog.
Definition: fsw_attitude_determination.h:39
CD_REQUEST_REF star_id_camera_ref
Identified stars #star_id_camera.
Definition: fsw_attitude_determination.h:35
CD_CREATE_REF ad_q_eci_to_camera_ref
Attitude determination.
Definition: fsw_attitude_determination.h:59
CD_CREATE_REF ad_covariance_camera_ref
AD covariance.
Definition: fsw_attitude_determination.h:53
CD_CREATE_REF ad_q_eci_to_body_ref
Quaternion from eci to body estimated.
Definition: fsw_attitude_determination.h:57
CD_REQUEST_REF u_star_camera_ref
Unit vectors for identified stars u_star_camera_1.
Definition: fsw_attitude_determination.h:41
CD_CREATE_REF ad_q_eci_to_camera_single_frame_ref
Single frame ad camera.
Definition: fsw_attitude_determination.h:55
CD_REQUEST_REF camera_rate_meas_ref
Measured camera rate #camera_rate_meas.
Definition: fsw_attitude_determination.h:43
void initialize_data()
Create data and request the FSW_ATTITUDE_DETERMINATION_TRIGGER.
Definition: fsw_attitude_determination.cc:19
CD_CREATE_REF ad_gyro_bias_camera_ref
Gyro bias estimated.
Definition: fsw_attitude_determination.h:51
CD_REQUEST_REF jd_ref
Julian date julian_date.
Definition: fsw_attitude_determination.h:45
CD_REQUEST_REF star_data_ref
Star data.
Definition: fsw_attitude_determination.h:37
CD_CREATE_REF ad_parameter_command_ref
The [alpha, kappa, and beta] parameters.
Definition: fsw_attitude_determination.h:72
CD_CREATE_REF ad_meas_noise_covariance_command_ref
UKF measurement noise covariance.
Definition: fsw_attitude_determination.h:78
CD_CREATE_REF ad_reset_command_ref
Attitude determination commands.
Definition: fsw_attitude_determination.h:70
CD_CREATE_REF ad_initial_state_command_ref
UKF initial state.
Definition: fsw_attitude_determination.h:80
CD_CREATE_REF ad_initial_covariance_command_ref
UKF initial covariance.
Definition: fsw_attitude_determination.h:74
CD_CREATE_REF ad_use_single_frame_command_ref
Use single frame camera solutions.
Definition: fsw_attitude_determination.h:68
CD_CREATE_REF ad_plant_noise_covariance_command_ref
UKF plant noise covariance.
Definition: fsw_attitude_determination.h:76
CD_CREATE_REF camera_data_command_ref
Definition: fsw_attitude_determination.h:66
CD_CREATE_REF ad_q_camera_to_body_command_ref
UKF initial state.
Definition: fsw_attitude_determination.h:82
Define the data names used throughout the control system.
Define the trigger and variables names for the software system.