-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcontroller.h
More file actions
50 lines (38 loc) · 1.13 KB
/
controller.h
File metadata and controls
50 lines (38 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/***********************************************************/
/* controller.h */
/* Copyright (C) 2012 Matthew Peddie <peddie@alum.mit.edu> */
/* attitude controller */
/***********************************************************/
#include <xyz.h>
#include <quat.h>
#ifndef __ATTSIM_CONTROLLER_H__
#define __ATTSIM_CONTROLLER_H__
#include "sensors.h"
typedef struct estimator_params {
double kp_pqr_bias;
double kp_mag_bias;
} estimator_params;
typedef struct estimator_state {
quat_t q_lvlh2b;
xyz_t w_blvlh_b;
xyz_t pqr_bias;
xyz_t mag_bias;
} estimator_state;
typedef struct bdot_params {
const double diff_tau;
const double kp;
} bdot_params;
typedef struct bdot_state {
xyz_t mag_b_1, mag_b_dot;
xyz_t mag_b_dot_f;
} bdot_state;
typedef struct controller_params {
const bdot_params bdot;
} controller_params;
typedef struct controller_state {
bdot_state bdot;
estimator_state est;
} controller_state;
int run_controller(double ts, const measurements *meas, actuators *act);
int controller_init(void);
#endif // __ATTSIM_CONTROLLER_H__