Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
filter_1euro_imu.c File Reference
#include "modules/imu/filter_1euro_imu.h"
#include "filters/1e_filter.h"
#include "math/pprz_algebra_int.h"
#include "math/pprz_algebra_float.h"
#include "modules/core/abi.h"
#include "generated/airframe.h"
+ Include dependency graph for filter_1euro_imu.c:

Go to the source code of this file.

Macros

#define FILTER_1EURO_ENABLED   TRUE
 Enable by default. More...
 
#define FILTER_1EURO_GYRO_MINCUTOFF   10.f
 Default gyro min cutoff freq. More...
 
#define FILTER_1EURO_GYRO_BETA   0.1f
 Default gyro beta coef. More...
 
#define FILTER_1EURO_GYRO_DCUTOFF   1.f
 Default gyro dcutoff (not recommanded to change) More...
 
#define FILTER_1EURO_ACCEL_MINCUTOFF   0.1f
 Default accel min cutoff freq. More...
 
#define FILTER_1EURO_ACCEL_BETA   0.01f
 Default accel beta coef. More...
 
#define FILTER_1EURO_ACCEL_DCUTOFF   1.f
 Default accel dcutoff (not recommanded to change) More...
 
#define FILTER_1EURO_FREQ   PERIODIC_FREQUENCY
 Auto freq if not defined. More...
 
#define IMU_F1E_BIND_ID   ABI_BROADCAST
 ABI bindings. More...
 

Functions

static void gyro_cb (uint8_t sender_id, uint32_t stamp, struct Int32Rates *gyro)
 
static void accel_cb (uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *accel)
 
static void mag_cb (uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *mag)
 
void filter_1euro_imu_init (void)
 Init and bindings. More...
 
void filter_1euro_imu_reset (float enabled)
 settings handlers More...
 
void filter_1euro_imu_update_gyro_mincutoff (float mincutoff)
 
void filter_1euro_imu_update_gyro_beta (float beta)
 
void filter_1euro_imu_update_gyro_dcutoff (float dcutoff)
 
void filter_1euro_imu_update_accel_mincutoff (float mincutoff)
 
void filter_1euro_imu_update_accel_beta (float beta)
 
void filter_1euro_imu_update_accel_dcutoff (float dcutoff)
 

Variables

struct Filter1eImu filter_1e_imu
 configuration structure More...
 
static struct OneEuroFilter gyro_1e [3]
 array of 1 euro filters for gyrometer More...
 
static struct OneEuroFilter accel_1e [3]
 array of 1 euro filters for accelerometer More...
 
static abi_event gyro_ev
 
static abi_event accel_ev
 
static abi_event mag_ev
 

Detailed Description

Author
Gautier Hattenberger gauti.nosp@m.er.h.nosp@m.atten.nosp@m.berg.nosp@m.er@en.nosp@m.ac.f.nosp@m.r Prefiltering for IMU data using 1euro filter

Definition in file filter_1euro_imu.c.

Macro Definition Documentation

◆ FILTER_1EURO_ACCEL_BETA

#define FILTER_1EURO_ACCEL_BETA   0.01f

Default accel beta coef.

Definition at line 60 of file filter_1euro_imu.c.

◆ FILTER_1EURO_ACCEL_DCUTOFF

#define FILTER_1EURO_ACCEL_DCUTOFF   1.f

Default accel dcutoff (not recommanded to change)

Definition at line 65 of file filter_1euro_imu.c.

◆ FILTER_1EURO_ACCEL_MINCUTOFF

#define FILTER_1EURO_ACCEL_MINCUTOFF   0.1f

Default accel min cutoff freq.

Definition at line 55 of file filter_1euro_imu.c.

◆ FILTER_1EURO_ENABLED

#define FILTER_1EURO_ENABLED   TRUE

Enable by default.

Definition at line 35 of file filter_1euro_imu.c.

◆ FILTER_1EURO_FREQ

#define FILTER_1EURO_FREQ   PERIODIC_FREQUENCY

Auto freq if not defined.

Definition at line 79 of file filter_1euro_imu.c.

◆ FILTER_1EURO_GYRO_BETA

#define FILTER_1EURO_GYRO_BETA   0.1f

Default gyro beta coef.

Definition at line 45 of file filter_1euro_imu.c.

◆ FILTER_1EURO_GYRO_DCUTOFF

#define FILTER_1EURO_GYRO_DCUTOFF   1.f

Default gyro dcutoff (not recommanded to change)

Definition at line 50 of file filter_1euro_imu.c.

◆ FILTER_1EURO_GYRO_MINCUTOFF

#define FILTER_1EURO_GYRO_MINCUTOFF   10.f

Default gyro min cutoff freq.

Definition at line 40 of file filter_1euro_imu.c.

◆ IMU_F1E_BIND_ID

#define IMU_F1E_BIND_ID   ABI_BROADCAST

ABI bindings.

by default bind to all IMU raw data and send filtered data receivers (AHRS, INS) should bind to this prefilter module IMU (gyro, accel)

Definition at line 106 of file filter_1euro_imu.c.

Function Documentation

◆ accel_cb()

static void accel_cb ( uint8_t  sender_id,
uint32_t  stamp,
struct Int32Vect3 accel 
)
static

Definition at line 143 of file filter_1euro_imu.c.

References accel_1e, ACCELS_BFP_OF_REAL, ACCELS_FLOAT_OF_BFP, Filter1eImu::enabled, filter_1e_imu, IMU_F1E_ID, update_1e_filter(), update_1e_filter_at_time(), FloatVect3::x, FloatVect3::y, and FloatVect3::z.

Referenced by filter_1euro_imu_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filter_1euro_imu_init()

◆ filter_1euro_imu_reset()

void filter_1euro_imu_reset ( float  enabled)

settings handlers

Definition at line 217 of file filter_1euro_imu.c.

References accel_1e, Filter1eImu::enabled, filter_1e_imu, gyro_1e, and reset_1e_filter().

+ Here is the call graph for this function:

◆ filter_1euro_imu_update_accel_beta()

void filter_1euro_imu_update_accel_beta ( float  beta)

◆ filter_1euro_imu_update_accel_dcutoff()

void filter_1euro_imu_update_accel_dcutoff ( float  dcutoff)

◆ filter_1euro_imu_update_accel_mincutoff()

void filter_1euro_imu_update_accel_mincutoff ( float  mincutoff)

◆ filter_1euro_imu_update_gyro_beta()

void filter_1euro_imu_update_gyro_beta ( float  beta)

◆ filter_1euro_imu_update_gyro_dcutoff()

void filter_1euro_imu_update_gyro_dcutoff ( float  dcutoff)

◆ filter_1euro_imu_update_gyro_mincutoff()

void filter_1euro_imu_update_gyro_mincutoff ( float  mincutoff)

◆ gyro_cb()

static void gyro_cb ( uint8_t  sender_id,
uint32_t  stamp,
struct Int32Rates gyro 
)
static

Definition at line 114 of file filter_1euro_imu.c.

References Filter1eImu::enabled, filter_1e_imu, gyro_1e, IMU_F1E_ID, FloatRates::p, FloatRates::q, FloatRates::r, RATES_BFP_OF_REAL, RATES_FLOAT_OF_BFP, update_1e_filter(), and update_1e_filter_at_time().

Referenced by filter_1euro_imu_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mag_cb()

static void mag_cb ( uint8_t  sender_id,
uint32_t  stamp,
struct Int32Vect3 mag 
)
static

Definition at line 172 of file filter_1euro_imu.c.

References IMU_F1E_ID.

Referenced by filter_1euro_imu_init().

+ Here is the caller graph for this function:

Variable Documentation

◆ accel_1e

◆ accel_ev

abi_event accel_ev
static

Definition at line 111 of file filter_1euro_imu.c.

Referenced by filter_1euro_imu_init().

◆ filter_1e_imu

◆ gyro_1e

◆ gyro_ev

abi_event gyro_ev
static

Definition at line 110 of file filter_1euro_imu.c.

Referenced by filter_1euro_imu_init().

◆ mag_ev

abi_event mag_ev
static

Definition at line 112 of file filter_1euro_imu.c.

Referenced by filter_1euro_imu_init().