|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
31 #include "generated/airframe.h"
34 #ifndef FILTER_1EURO_ENABLED
35 #define FILTER_1EURO_ENABLED TRUE
39 #ifndef FILTER_1EURO_GYRO_MINCUTOFF
40 #define FILTER_1EURO_GYRO_MINCUTOFF 10.f
44 #ifndef FILTER_1EURO_GYRO_BETA
45 #define FILTER_1EURO_GYRO_BETA 0.1f
49 #ifndef FILTER_1EURO_GYRO_DCUTOFF
50 #define FILTER_1EURO_GYRO_DCUTOFF 1.f
54 #ifndef FILTER_1EURO_ACCEL_MINCUTOFF
55 #define FILTER_1EURO_ACCEL_MINCUTOFF 0.1f
59 #ifndef FILTER_1EURO_ACCEL_BETA
60 #define FILTER_1EURO_ACCEL_BETA 0.01f
64 #ifndef FILTER_1EURO_ACCEL_DCUTOFF
65 #define FILTER_1EURO_ACCEL_DCUTOFF 1.f
69 #ifndef FILTER_1EURO_FREQ
70 #if defined AHRS_PROPAGATE_FREQUENCY
71 #define FILTER_1EURO_FREQ AHRS_PROPAGATE_FREQUENCY
73 #elif defined INS_PROPAGATE_FREQUENCY
74 #define FILTER_1EURO_FREQ INS_PROPAGATE_FREQUENCY
79 #define FILTER_1EURO_FREQ PERIODIC_FREQUENCY
105 #ifndef IMU_F1E_BIND_ID
106 #define IMU_F1E_BIND_ID ABI_BROADCAST
124 #ifdef FILTER_1EURO_FREQ
137 AbiSendMsgIMU_GYRO_INT32(
IMU_F1E_ID, stamp, &gyro_i);
139 AbiSendMsgIMU_GYRO_INT32(
IMU_F1E_ID, stamp, gyro);
153 #ifdef FILTER_1EURO_FREQ
166 AbiSendMsgIMU_ACCEL_INT32(
IMU_F1E_ID, stamp, &accel_i);
168 AbiSendMsgIMU_ACCEL_INT32(
IMU_F1E_ID, stamp, accel);
179 AbiSendMsgIMU_MAG_INT32(
IMU_F1E_ID, stamp, mag);
195 for (
int i = 0; i < 3; i++) {
220 for (
int i = 0; i < 3; i++) {
229 for (
int i = 0; i < 3; i++) {
237 for (
int i = 0; i < 3; i++) {
245 for (
int i = 0; i < 3; i++) {
253 for (
int i = 0; i < 3; i++) {
261 for (
int i = 0; i < 3; i++) {
269 for (
int i = 0; i < 3; i++) {
struct Filter1eImu filter_1e_imu
configuration structure
#define FILTER_1EURO_ACCEL_DCUTOFF
Default accel dcutoff (not recommanded to change)
void filter_1euro_imu_reset(float enabled)
settings handlers
#define FILTER_1EURO_GYRO_MINCUTOFF
Default gyro min cutoff freq.
void filter_1euro_imu_update_gyro_beta(float beta)
void filter_1euro_imu_update_accel_dcutoff(float dcutoff)
#define FILTER_1EURO_ACCEL_MINCUTOFF
Default accel min cutoff freq.
float dcutoff
derivative cutoff freq (in Hz)
#define RATES_FLOAT_OF_BFP(_rf, _ri)
Event structure to store callbacks in a linked list.
float mincutoff
min cutoff freq (in Hz)
Paparazzi floating point algebra.
Paparazzi fixed point algebra.
void filter_1euro_imu_init(void)
Init and bindings.
static float update_1e_filter_at_time(struct OneEuroFilter *filter, float x, uint32_t timestamp)
Filter a float using the given One Euro Filter and the given timestamp.
#define ACCELS_BFP_OF_REAL(_ef, _ei)
#define IMU_F1E_BIND_ID
ABI bindings.
static void mag_cb(uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *mag)
static void accel_cb(uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *accel)
#define RATES_BFP_OF_REAL(_ri, _rf)
#define FILTER_1EURO_ACCEL_BETA
Default accel beta coef.
void filter_1euro_imu_update_accel_beta(float beta)
void filter_1euro_imu_update_accel_mincutoff(float mincutoff)
static struct OneEuroFilter gyro_1e[3]
array of 1 euro filters for gyrometer
#define FILTER_1EURO_FREQ
Auto freq if not defined.
#define FILTER_1EURO_GYRO_DCUTOFF
Default gyro dcutoff (not recommanded to change)
static void reset_1e_filter(struct OneEuroFilter *filter)
Reset filter (gains and parameters unchanged)
#define FILTER_1EURO_ENABLED
Enable by default.
static abi_event accel_ev
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
#define FILTER_1EURO_GYRO_BETA
Default gyro beta coef.
static struct OneEuroFilter accel_1e[3]
array of 1 euro filters for accelerometer
void filter_1euro_imu_update_gyro_mincutoff(float mincutoff)
static void gyro_cb(uint8_t sender_id, uint32_t stamp, struct Int32Rates *gyro)
static void init_1e_filter(struct OneEuroFilter *filter, float rate, float mincutoff, float beta, float dcutoff)
Initialize a 1 Euro Filter instance.
static float update_1e_filter(struct OneEuroFilter *filter, float x)
Filter a float using the given One Euro Filter.
#define ACCELS_FLOAT_OF_BFP(_ef, _ei)
Implementation of the 1 euro filter.
configuration parameters.
void filter_1euro_imu_update_gyro_dcutoff(float dcutoff)