Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
ekf_aw_wrapper.h
Go to the documentation of this file.
1 #ifndef EKF_AW_WRAPPER_H
2 #define EKF_AW_WRAPPER_H
3 
4 #include "std.h"
8 #include "modules/meteo/ekf_aw.h"
9 
10 
11 // EKF structure
12 struct ekfAw {
13 
14  // States
15  struct NedCoor_f wind;
16  struct NedCoor_f V_body;
17  struct NedCoor_f offset;
18 
19  // Inputs
20  struct FloatVect3 acc;
21  struct FloatRates gyro;
22  struct FloatEulers euler;
23 
24 #define EKF_AW_RPM_HOVER_NUM 4
25  int32_t last_RPM_hover[EKF_AW_RPM_HOVER_NUM]; // Value obtained from ABI Callback
26  int32_t last_RPM_pusher; // Value obtained from ABI Callback
28  float RPM_pusher;
29  float skew;
31 
32 
33  // Measurements
34  struct FloatVect3 Vg_NED;
35  struct FloatVect3 acc_filt;
36  float V_pitot;
37 
38  // Innovation
39  struct FloatVect3 innov_V_gnd;
42 
43  // Covariance
44  float meas_cov[7];
45  float state_cov[9];
46  float process_cov[12];
47 
48  // Forces
49  float fuselage_force[3];
50  float wing_force[3];
51  float elevator_force[3];
52  float hover_force[3];
53  float pusher_force[3];
54 
55  // Other
56  bool reset;
57  bool in_air;
58  struct NedCoor_f wind_guess;
59  struct NedCoor_f offset_guess;
60  struct ekfHealth health;
66 
67 };
68 
69 extern void ekf_aw_wrapper_init(void);
70 extern void ekf_aw_wrapper_periodic(void);
71 extern void ekf_aw_wrapper_fetch(void);
72 
73 extern void set_in_air_status(bool);
74 
75 
76 extern float tau_filter_high;
77 extern float tau_filter_low;
78 
79 extern struct ekfAw ekf_aw;
80 
81 // Handlers
82 #define ekf_aw_wrapper_reset(_v) { \
83  ekf_aw.reset = false; \
84  ekf_aw_reset(); \
85  ekf_aw_reset_health(); \
86  }
87 
88 #define ekf_aw_wrapper_set_wind_N(_v) { \
89  ekf_aw.wind_guess.x = _v; \
90  ekf_aw_set_wind(&ekf_aw.wind_guess); \
91  }
92 
93 #define ekf_aw_wrapper_set_wind_E(_v) { \
94  ekf_aw.wind_guess.y = _v; \
95  ekf_aw_set_wind(&ekf_aw.wind_guess); \
96  }
97 
98 #define ekf_aw_wrapper_set_wind_D(_v) { \
99  ekf_aw.wind_guess.z = _v; \
100  ekf_aw_set_wind(&ekf_aw.wind_guess); \
101  }
102 
103 #define ekf_aw_wrapper_set_offset_x(_v) { \
104  ekf_aw.offset_guess.x = _v; \
105  ekf_aw_set_offset(&ekf_aw.offset_guess); \
106  }
107 
108 #define ekf_aw_wrapper_set_offset_y(_v) { \
109  ekf_aw.offset_guess.y = _v; \
110  ekf_aw_set_offset(&ekf_aw.offset_guess); \
111  }
112 
113 #define ekf_aw_wrapper_set_offset_z(_v) { \
114  ekf_aw.offset_guess.z = _v; \
115  ekf_aw_set_offset(&ekf_aw.offset_guess); \
116  }
117 
118 #endif /* EKF_AW_WRAPPER_H */
bool override_quick_convergence
struct FloatVect3 innov_V_gnd
Pitot tube airspeed.
uint64_t time_last_on_gnd
bool in_air
struct NedCoor_f offset
float fuselage_force[3]
struct FloatVect3 acc_filt
Ground Speed.
struct FloatVect3 acc
Last accelerometer measurements.
int32_t last_RPM_hover[EKF_AW_RPM_HOVER_NUM]
float hover_force[3]
#define EKF_AW_RPM_HOVER_NUM
Euler angles.
void ekf_aw_wrapper_fetch(void)
struct NedCoor_f V_body
float elevator_angle
Skew.
bool override_start
void set_in_air_status(bool)
int32_t last_RPM_pusher
float wing_force[3]
float meas_cov[7]
struct FloatEulers euler
struct FloatRates gyro
Last gyroscope measurements.
bool reset
float process_cov[12]
uint64_t internal_clock
float V_pitot
float skew
Pusher motor RPM.
float tau_filter_high
struct FloatVect3 Vg_NED
struct ekfAw ekf_aw
float RPM_hover[EKF_AW_RPM_HOVER_NUM]
float pusher_force[3]
struct NedCoor_f wind
struct ekfHealth health
uint64_t time_last_in_air
float RPM_pusher
Hover motor RPM.
void ekf_aw_wrapper_periodic(void)
struct FloatVect3 innov_acc_filt
struct NedCoor_f wind_guess
float tau_filter_low
float state_cov[9]
struct NedCoor_f offset_guess
float innov_V_pitot
void ekf_aw_wrapper_init(void)
float elevator_force[3]
euler angles
angular rates
Paparazzi floating point algebra.
Paparazzi fixed point algebra.
Paparazzi floating point math for geodetic calculations.
vector in North East Down coordinates Units: meters
int int32_t
Typedef defining 32 bit int type.
Definition: vl53l1_types.h:83
unsigned long long uint64_t
Definition: vl53l1_types.h:72