Paparazzi UAS  v6.2_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 {
46 
47  struct FloatRates gyro;
48  struct FloatVect3 accel;
49  bool gyro_valid;
50  bool accel_valid;
51 
52  float temp;
53  float qnh;
56  struct LtpDef_i ltp_def;
58  bool got_imu_data;
59 
62 };
63 
64 extern void ins_ekf2_init(void);
65 extern void ins_ekf2_update(void);
66 extern void ins_ekf2_change_param(int32_t unk);
67 extern void ins_ekf2_remove_gps(int32_t mode);
68 extern void ins_ekf2_parse_EXTERNAL_POSE(uint8_t *buf);
70 extern struct ekf2_t ekf2;
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif /* INS_EKF2_H */
OrientationReps
Definition: pprz_orientation_conversion.h:79
ins.h
ekf2_t::gyro
struct FloatRates gyro
Last gyroscope measurements.
Definition: ins_ekf2.h:47
uint32_t
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
Definition: vl53l1_types.h:78
uint8_t
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98
uint64_t
unsigned long long uint64_t
Definition: vl53l1_types.h:72
ins_ekf2_remove_gps
void ins_ekf2_remove_gps(int32_t mode)
Definition: ins_ekf2.cpp:659
LtpDef_i
definition of the local (flat earth) coordinate system
Definition: pprz_geodetic_int.h:98
ekf2_t::quat_reset_counter
uint8_t quat_reset_counter
Amount of quaternion resets from the EKF2.
Definition: ins_ekf2.h:54
ekf2_t::accel_stamp
uint32_t accel_stamp
Accelerometer last abi message timestamp.
Definition: ins_ekf2.h:43
ekf2_t::gyro_stamp
uint32_t gyro_stamp
Gyroscope last abi message timestamp.
Definition: ins_ekf2.h:41
ekf2_t::accel
struct FloatVect3 accel
Last accelerometer measurements.
Definition: ins_ekf2.h:48
ins_ekf2_update
void ins_ekf2_update(void)
Definition: ins_ekf2.cpp:577
ekf2_t::qnh
float qnh
QNH value in hPa.
Definition: ins_ekf2.h:53
ins_ekf2_parse_EXTERNAL_POSE_SMALL
void ins_ekf2_parse_EXTERNAL_POSE_SMALL(uint8_t *buf)
Definition: ins_ekf2.cpp:691
FloatVect3
Definition: pprz_algebra_float.h:54
ekf2_t::accel_dt
uint32_t accel_dt
Accelerometer delta timestamp between abi messages.
Definition: ins_ekf2.h:44
ekf2_t::ltp_def
struct LtpDef_i ltp_def
Latest LTP definition from the quat_reset_counterEKF2.
Definition: ins_ekf2.h:56
ekf2_t::ltp_stamp
uint64_t ltp_stamp
Last LTP change timestamp from the EKF2.
Definition: ins_ekf2.h:55
ins_ekf2_change_param
void ins_ekf2_change_param(int32_t unk)
Definition: ins_ekf2.cpp:654
ekf2
struct ekf2_t ekf2
Local EKF2 status structure.
Definition: ins_ekf2.cpp:308
ekf2_t::mag_fusion_type
int32_t mag_fusion_type
Definition: ins_ekf2.h:60
ahrs.h
ins_ekf2_parse_EXTERNAL_POSE
void ins_ekf2_parse_EXTERNAL_POSE(uint8_t *buf)
Definition: ins_ekf2.cpp:668
ekf2_t::fusion_mode
int32_t fusion_mode
Definition: ins_ekf2.h:61
ekf2_t::body_to_imu
struct OrientationReps body_to_imu
Body to IMU rotation.
Definition: ins_ekf2.h:57
int32_t
int int32_t
Typedef defining 32 bit int type.
Definition: vl53l1_types.h:83
ekf2_t::gyro_valid
bool gyro_valid
If we received a gyroscope measurement.
Definition: ins_ekf2.h:49
ekf2_t
Definition: ins_ekf2.h:40
mode
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:69
ekf2_t::gyro_dt
uint32_t gyro_dt
Gyroscope delta timestamp between abi messages.
Definition: ins_ekf2.h:42
ekf2_t::accel_valid
bool accel_valid
If we received a acceleration measurement.
Definition: ins_ekf2.h:50
ekf2_t::flow_stamp
uint32_t flow_stamp
Optic flow last abi message timestamp.
Definition: ins_ekf2.h:45
ins_ekf2_init
void ins_ekf2_init(void)
Definition: ins_ekf2.cpp:466
ekf2_t::got_imu_data
bool got_imu_data
If we received valid IMU data (any sensor)
Definition: ins_ekf2.h:58
FloatRates
angular rates
Definition: pprz_algebra_float.h:93
ekf2_t::temp
float temp
Latest temperature measurement in degrees celcius.
Definition: ins_ekf2.h:52