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  float rel_heading;
50 
51  float temp;
52  float qnh;
55  struct LtpDef_i ltp_def;
56  bool got_imu_data;
57 
60 };
61 
62 extern void ins_ekf2_init(void);
63 extern void ins_ekf2_update(void);
64 extern void ins_ekf2_change_param(int32_t unk);
65 extern void ins_ekf2_remove_gps(int32_t mode);
66 extern void ins_ekf2_parse_EXTERNAL_POSE(uint8_t *buf);
68 extern struct ekf2_t ekf2;
69 
70 #ifdef INS_EXT_VISION_ROTATION
71 extern struct FloatQuat ins_ext_vision_rot;
72 #endif
73 
74 #ifdef __cplusplus
75 }
76 #endif
77 
78 #endif /* INS_EKF2_H */
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:58
bool accel_valid
If we received a acceleration measurement.
Definition: ins_ekf2.h:46
bool rel_heading_valid
If we received a valid relative heading.
Definition: ins_ekf2.h:49
void ins_ekf2_update(void)
Definition: ins_ekf2.cpp:702
bool got_imu_data
If we received valid IMU data (any sensor)
Definition: ins_ekf2.h:56
void ins_ekf2_remove_gps(int32_t mode)
Definition: ins_ekf2.cpp:784
int32_t fusion_mode
Definition: ins_ekf2.h:59
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:540
struct LtpDef_i ltp_def
Latest LTP definition from the quat_reset_counter EKF2.
Definition: ins_ekf2.h:55
void ins_ekf2_change_param(int32_t unk)
Definition: ins_ekf2.cpp:779
uint32_t flow_stamp
Optic flow last abi message timestamp.
Definition: ins_ekf2.h:47
float rel_heading
Relative heading from RTK gps (rad)
Definition: ins_ekf2.h:48
struct ekf2_t ekf2
Local EKF2 status structure.
Definition: ins_ekf2.cpp:326
float temp
Latest temperature measurement in degrees celcius.
Definition: ins_ekf2.h:51
void ins_ekf2_parse_EXTERNAL_POSE(uint8_t *buf)
Definition: ins_ekf2.cpp:793
void ins_ekf2_parse_EXTERNAL_POSE_SMALL(uint8_t *buf)
Definition: ins_ekf2.cpp:827
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:54
float qnh
QNH value in hPa.
Definition: ins_ekf2.h:52
uint8_t quat_reset_counter
Amount of quaternion resets from the EKF2.
Definition: ins_ekf2.h:53
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