dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
insgps.h
Go to the documentation of this file.
1 
14 /*
15  * This program is free software; you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation; either version 3 of the License, or
18  * (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful, but
21  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  * for more details.
24  *
25  * You should have received a copy of the GNU General Public License along
26  * with this program; if not, see <http://www.gnu.org/licenses/>
27  */
28 
29 #ifndef INSGPS_H_
30 #define INSGPS_H_
31 
32 #include "stdint.h"
33 #include "stdbool.h"
34 
39 #define POS_SENSORS 0x007
40 #define HORIZ_POS_SENSORS 0x003
41 #define VERT_POS_SENSORS 0x004
42 #define HORIZ_VEL_SENSORS 0x018
43 #define VERT_VEL_SENSORS 0x020
44 #define MAG_SENSORS 0x1C0
45 #define BARO_SENSOR 0x200
46 
47 #define FULL_SENSORS 0x3FF
48 
53 /****************************************************/
55 /****************************************************/
56 
58 void INSGPSInit();
59 
61 void INSStatePrediction(const float gyro_data[3], const float accel_data[3], float dT);
62 
64 void INSCovariancePrediction(float dT);
65 
67 void INSCorrection(const float mag_data[3], const float Pos[3], const float Vel[3], float BaroAlt, uint16_t SensorsUsed);
68 
70 void INSGetState(float *pos, float *vel, float *attitude, float *gyro_bias, float *accel_bias);
71 
73 void INSSetArmed(bool armed);
74 
75 /****************************************************/
77 /****************************************************/
78 
79 void INSResetP(const float *PDiag);
80 void INSSetState(const float pos[3], const float vel[3], const float q[4], const float gyro_bias[3], const float accel_bias[3]);
81 void INSSetPosVelVar(float PosVar, float VelVar, float VertPosVar);
82 void INSSetGyroBias(const float gyro_bias[3]);
83 void INSSetAccelBias(const float gyro_bias[3]);
84 void INSSetAccelVar(const float accel_var[3]);
85 void INSSetGyroVar(const float gyro_var[3]);
86 void INSSetMagNorth(const float B[3]);
87 void INSSetMagVar(const float scaled_mag_var[3]);
88 void INSSetBaroVar(float baro_var);
89 void INSPosVelReset(const float pos[3], const float vel[3]);
90 
91 void INSGetVariance(float *p);
92 
93 uint16_t ins_get_num_states();
94 
95 #endif /* INSGPS_H_ */
96 
void INSGetState(float *pos, float *vel, float *attitude, float *gyro_bias, float *accel_bias)
Get the current state estimate.
void INSSetAccelBias(const float gyro_bias[3])
void INSGetVariance(float *p)
void INSSetMagVar(const float scaled_mag_var[3])
void INSSetPosVelVar(float PosVar, float VelVar, float VertPosVar)
void INSSetGyroBias(const float gyro_bias[3])
static float accel_bias[3]
Definition: sensors.c:114
void INSStatePrediction(const float gyro_data[3], const float accel_data[3], float dT)
Compute an update of the state estimate.
void INSSetMagNorth(const float B[3])
struct _msp_pid_item pos
Definition: msp_messages.h:100
void INSSetBaroVar(float baro_var)
void INSSetState(const float pos[3], const float vel[3], const float q[4], const float gyro_bias[3], const float accel_bias[3])
void INSGPSInit()
Reset the internal state variables and variances.
Definition: insgps13state.c:74
void INSCorrection(const float mag_data[3], const float Pos[3], const float Vel[3], float BaroAlt, uint16_t SensorsUsed)
Correct the state and covariance estimate based on the sensors that were updated. ...
void INSSetArmed(bool armed)
Set the current flight state.
void INSResetP(const float *PDiag)
void INSCovariancePrediction(float dT)
Compute an update of the state covariance.
uint16_t ins_get_num_states()
Definition: insgps13state.c:69
void INSSetGyroVar(const float gyro_var[3])
void INSSetAccelVar(const float accel_var[3])
void INSPosVelReset(const float pos[3], const float vel[3])
uint8_t p
Definition: msp_messages.h:96
struct _msp_pid_item vel
Definition: msp_messages.h:105