Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
ins_ekf2.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Freek van Tienen <freek.v.tienen@gmail.com>
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, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
29 #ifndef INS_EKF2_H
30 #define INS_EKF2_H
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #include "modules/ahrs/ahrs.h"
37 #include "modules/ins/ins.h"
38 
39 /* Main EKF2 structure for keeping track of the status and use cross messaging */
40 struct ekf2_t {
41  struct FloatRates delta_gyro;
42  struct FloatVect3 delta_accel;
45  bool gyro_valid;
46  bool accel_valid;
48 
49  float temp;
50  float qnh;
53  struct LtpDef_i ltp_def;
54  bool got_imu_data;
55 
58 };
59 
60 extern void ins_ekf2_init(void);
61 extern void ins_ekf2_update(void);
62 extern void ins_ekf2_change_param(int32_t unk);
63 extern void ins_ekf2_remove_gps(int32_t mode);
64 extern void ins_ekf2_parse_EXTERNAL_POSE(uint8_t *buf);
66 extern struct ekf2_t ekf2;
67 
68 #ifdef INS_EXT_VISION_ROTATION
69 extern struct FloatQuat ins_ext_vision_rot;
70 #endif
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif /* INS_EKF2_H */
Dispatcher to register actual AHRS implementations.
Roation quaternion.
angular rates
definition of the local (flat earth) coordinate system
Integrated Navigation System interface.
int32_t mag_fusion_type
Definition: ins_ekf2.h:56
bool accel_valid
If we received a acceleration measurement.
Definition: ins_ekf2.h:46
void ins_ekf2_update(void)
Definition: ins_ekf2.cpp:671
bool got_imu_data
If we received valid IMU data (any sensor)
Definition: ins_ekf2.h:54
void ins_ekf2_remove_gps(int32_t mode)
Definition: ins_ekf2.cpp:753
int32_t fusion_mode
Definition: ins_ekf2.h:57
bool gyro_valid
If we received a gyroscope measurement.
Definition: ins_ekf2.h:45
uint32_t accel_dt
Accelerometer delta timestamp between abi messages (us)
Definition: ins_ekf2.h:44
uint32_t gyro_dt
Gyroscope delta timestamp between abi messages (us)
Definition: ins_ekf2.h:43
void ins_ekf2_init(void)
Definition: ins_ekf2.cpp:525
struct LtpDef_i ltp_def
Latest LTP definition from the quat_reset_counter EKF2.
Definition: ins_ekf2.h:53
void ins_ekf2_change_param(int32_t unk)
Definition: ins_ekf2.cpp:748
uint32_t flow_stamp
Optic flow last abi message timestamp.
Definition: ins_ekf2.h:47
struct ekf2_t ekf2
Local EKF2 status structure.
Definition: ins_ekf2.cpp:311
float temp
Latest temperature measurement in degrees celcius.
Definition: ins_ekf2.h:49
void ins_ekf2_parse_EXTERNAL_POSE(uint8_t *buf)
Definition: ins_ekf2.cpp:762
void ins_ekf2_parse_EXTERNAL_POSE_SMALL(uint8_t *buf)
Definition: ins_ekf2.cpp:796
struct FloatVect3 delta_accel
Last accelerometer measurements.
Definition: ins_ekf2.h:42
uint64_t ltp_stamp
Last LTP change timestamp from the EKF2.
Definition: ins_ekf2.h:52
float qnh
QNH value in hPa.
Definition: ins_ekf2.h:50
uint8_t quat_reset_counter
Amount of quaternion resets from the EKF2.
Definition: ins_ekf2.h:51
struct FloatRates delta_gyro
Last gyroscope measurements.
Definition: ins_ekf2.h:41
static uint8_t mode
mode holds the current sonar mode mode = 0 used at high altitude, uses 16 wave patterns mode = 1 used...
Definition: sonar_bebop.c:65
int int32_t
Typedef defining 32 bit int type.
Definition: vl53l1_types.h:83
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
Definition: vl53l1_types.h:78
unsigned long long uint64_t
Definition: vl53l1_types.h:72
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98