Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
ins_float_invariant.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2013 Jean-Philippe Condomines, Gautier Hattenberger
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
27 #ifndef INS_FLOAT_INVARIANT_H
28 #define INS_FLOAT_INVARIANT_H
29 
30 #include "modules/ins/ins.h"
31 #include "modules/gps/gps.h"
34 
37 #define INV_STATE_DIM 15
38 
41 struct inv_state {
42  struct FloatQuat quat;
43  struct FloatRates bias;
44  struct NedCoor_f speed;
45  struct NedCoor_f pos;
46  float hb;
47  float as;
48 //float cs; ///< Estimated magnetic sensitivity
49 };
50 
53 #define INV_MEASURE_DIM 10
54 
57 struct inv_measures {
58  struct NedCoor_f pos_gps;
59  struct NedCoor_f speed_gps;
60  struct FloatVect3 mag;
61  float baro_alt;
62 };
63 
66 #define INV_COMMAND_DIM 6
67 
70 struct inv_command {
71  struct FloatRates rates;
72  struct FloatVect3 accel;
73 };
74 
77 struct inv_correction_gains {
78  struct FloatVect3 LE;
79  struct FloatVect3 ME;
80  struct FloatVect3 NE;
81  struct FloatVect3 OE;
82  float RE;
83  float SE;
84 };
85 
88 struct inv_gains {
89  float lv;
90  float lb;
91  float mv;
92  float mvz;
93  float mh;
94  float nx;
95  float nxz;
96  float nh;
97  float ov;
98  float ob;
99  float rv;
100  float rh;
101  float sh;
102 };
103 
106 struct InsFloatInv {
107  struct inv_state state;
108  struct inv_measures meas;
109  struct inv_command cmd;
110  struct inv_correction_gains corr;
111  struct inv_gains gains;
112 
113  bool reset;
114 
115  struct FloatVect3 mag_h;
117 };
118 
119 extern struct InsFloatInv ins_float_inv;
120 
121 extern void ins_float_invariant_init(void);
122 extern void ins_float_invariant_reset_ref(void);
124 extern void ins_float_invariant_align(struct FloatRates *lp_gyro,
125  struct FloatVect3 *lp_accel,
126  struct FloatVect3 *lp_mag);
127 extern void ins_float_invariant_propagate(struct FloatRates* gyro,
128  struct FloatVect3* accel, float dt);
129 extern void ins_float_invariant_update_mag(struct FloatVect3* mag);
130 extern void ins_float_invariant_update_baro(float pressure);
131 extern void ins_float_invariant_update_gps(struct GpsState *gps_s);
132 
133 #endif /* INS_FLOAT_INVARIANT_H */
134 
Device independent GPS code (interface)
data structure for GPS information
Definition: gps.h:87
Roation quaternion.
angular rates
Integrated Navigation System interface.
float rv
Tuning parameter of speed error on accel biases.
void ins_float_invariant_reset_ref(void)
float mvz
Tuning parameter of vertical speed error on speed.
struct FloatVect3 accel
Input accelerometers.
float nxz
Tuning parameter of vertical position error on position.
float lv
Tuning parameter of speed error on attitude.
struct NedCoor_f speed
Estimates speed.
void ins_float_invariant_align(struct FloatRates *lp_gyro, struct FloatVect3 *lp_accel, struct FloatVect3 *lp_mag)
float mh
Tuning parameter of baro error on vertical speed.
void ins_float_invariant_propagate(struct FloatRates *gyro, struct FloatVect3 *accel, float dt)
void ins_float_invariant_init(void)
float hb
Estimates barometers bias.
struct FloatRates bias
Estimated gyro biases.
float ob
Tuning parameter of mag error on gyro biases.
float rh
Tuning parameter of baro error on accel biases (vertical projection)
struct inv_gains gains
tuning gains
float OE
Correction gains on magnetometer sensitivity.
float mv
Tuning parameter of horizontal speed error on speed.
void ins_float_invariant_update_gps(struct GpsState *gps_s)
struct inv_state state
state vector
struct FloatVect3 LE
Correction gains on attitude.
struct FloatVect3 ME
Correction gains on gyro biases.
struct inv_command cmd
command vector
float as
Estimated accelerometer sensitivity.
void ins_float_invariant_update_mag(struct FloatVect3 *mag)
struct FloatVect3 mag
Measured magnetic field.
struct NedCoor_f pos
Estimates position.
struct FloatVect3 mag_h
struct InsFloatInv ins_float_inv
struct inv_measures meas
measurement vector
struct FloatQuat quat
Estimated attitude (quaternion)
float lb
Tuning parameter of mag error on attitude.
float SE
Correction gains on barometer bias.
void ins_float_invariant_update_baro(float pressure)
float nx
Tuning parameter of horizontal position error on position.
bool reset
flag to request reset/reinit the filter
float NE
Correction gains on accel bias.
struct FloatRates rates
Input gyro rates.
float RE
Correction gains on accel bias.
struct NedCoor_f pos_gps
Measured gps position.
float baro_alt
Measured barometric altitude.
float ov
Tuning parameter of speed error on gyro biases.
struct NedCoor_f speed_gps
Measured gps speed.
struct inv_correction_gains corr
correction gains
void ins_float_invariant_reset_vertical_ref(void)
float nh
Tuning parameter of baro error on vertical position.
float sh
Tuning parameter of baro error on baro bias.
Invariant filter structure.
Invariant filter command vector.
Invariant filter correction gains.
Invariant filter tuning gains.
Invariant filter measurement vector.
Invariant filter state.
Paparazzi floating point algebra.
vector in North East Down coordinates Units: meters
Generic orientation representation and conversions.