Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
ahrs_float_invariant.c File Reference
#include "modules/ahrs/ahrs_float_invariant.h"
#include "modules/ahrs/ahrs_int_utils.h"
#include "generated/airframe.h"
#include "math/pprz_algebra_float.h"
#include "math/pprz_algebra_int.h"
#include "math/pprz_rk_float.h"
+ Include dependency graph for ahrs_float_invariant.c:

Go to the source code of this file.

Macros

#define AHRS_INV_LX   2. * (0.06 + 0.1)
 
#define AHRS_INV_LY   2. * (0.06 + 0.06)
 
#define AHRS_INV_LZ   2. * (0.1 + 0.06)
 
#define AHRS_INV_MX   2. * 0.05 * (0.06 + 0.1)
 
#define AHRS_INV_MY   2. * 0.05 * (0.06 + 0.06)
 
#define AHRS_INV_MZ   2. * 0.05 * (0.1 + 0.06)
 
#define AHRS_INV_N   0.25
 
#define AHRS_INV_O   0.5
 
#define B   ahrs_float_inv.mag_h
 
#define MAG_FROZEN_COUNT   30
 

Functions

static void error_output (struct AhrsFloatInv *_ahrs)
 Compute correction vectors E = ( ŷ - y ) LE, ME, NE, OE : ( gain matrix * error ) More...
 
static void invariant_model (float *o, const float *x, const int n, const float *u, const int m)
 Compute dynamic mode. More...
 
void float_quat_vmul_right (struct FloatQuat *mright, const struct FloatQuat *q, struct FloatVect3 *vi)
 Right multiplication by a quaternion. More...
 
static void init_invariant_state (void)
 
void ahrs_float_invariant_init (void)
 
void ahrs_float_invariant_align (struct FloatRates *lp_gyro, struct FloatVect3 *lp_accel, struct FloatVect3 *lp_mag)
 
void ahrs_float_invariant_propagate (struct FloatRates *gyro, float dt)
 
void ahrs_float_invariant_update_accel (struct FloatVect3 *accel)
 
void ahrs_float_invariant_update_mag (struct FloatVect3 *mag)
 

Variables

struct AhrsFloatInv ahrs_float_inv
 
static const struct FloatVect3 A = { 0.f, 0.f, -9.81f }
 

Detailed Description

Author
Jean-Philippe Condomines jp.co.nosp@m.ndom.nosp@m.ines@.nosp@m.gmai.nosp@m.l.com

AHRS using invariant filter.

Definition in file ahrs_float_invariant.c.

Macro Definition Documentation

◆ AHRS_INV_LX

#define AHRS_INV_LX   2. * (0.06 + 0.1)

Definition at line 64 of file ahrs_float_invariant.c.

◆ AHRS_INV_LY

#define AHRS_INV_LY   2. * (0.06 + 0.06)

Definition at line 68 of file ahrs_float_invariant.c.

◆ AHRS_INV_LZ

#define AHRS_INV_LZ   2. * (0.1 + 0.06)

Definition at line 72 of file ahrs_float_invariant.c.

◆ AHRS_INV_MX

#define AHRS_INV_MX   2. * 0.05 * (0.06 + 0.1)

Definition at line 76 of file ahrs_float_invariant.c.

◆ AHRS_INV_MY

#define AHRS_INV_MY   2. * 0.05 * (0.06 + 0.06)

Definition at line 80 of file ahrs_float_invariant.c.

◆ AHRS_INV_MZ

#define AHRS_INV_MZ   2. * 0.05 * (0.1 + 0.06)

Definition at line 84 of file ahrs_float_invariant.c.

◆ AHRS_INV_N

#define AHRS_INV_N   0.25

Definition at line 88 of file ahrs_float_invariant.c.

◆ AHRS_INV_O

#define AHRS_INV_O   0.5

Definition at line 92 of file ahrs_float_invariant.c.

◆ B

#define B   ahrs_float_inv.mag_h

Definition at line 101 of file ahrs_float_invariant.c.

◆ MAG_FROZEN_COUNT

#define MAG_FROZEN_COUNT   30

Definition at line 234 of file ahrs_float_invariant.c.

Function Documentation

◆ ahrs_float_invariant_align()

void ahrs_float_invariant_align ( struct FloatRates lp_gyro,
struct FloatVect3 lp_accel,
struct FloatVect3 lp_mag 
)

Definition at line 156 of file ahrs_float_invariant.c.

References ahrs_float_get_quat_from_accel_mag(), ahrs_float_inv, inv_state::bias, AhrsFloatInv::is_aligned, inv_state::quat, and AhrsFloatInv::state.

Referenced by aligner_cb().

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

◆ ahrs_float_invariant_init()

◆ ahrs_float_invariant_propagate()

◆ ahrs_float_invariant_update_accel()

void ahrs_float_invariant_update_accel ( struct FloatVect3 accel)

Definition at line 228 of file ahrs_float_invariant.c.

References inv_measures::accel, ahrs_float_inv, and AhrsFloatInv::meas.

Referenced by accel_cb().

+ Here is the caller graph for this function:

◆ ahrs_float_invariant_update_mag()

void ahrs_float_invariant_update_mag ( struct FloatVect3 mag)

Definition at line 236 of file ahrs_float_invariant.c.

References ahrs_float_inv, FLOAT_VECT3_ZERO, inv_measures::mag, MAG_FROZEN_COUNT, AhrsFloatInv::meas, VECT3_COPY, and FloatVect3::x.

Referenced by mag_cb().

+ Here is the caller graph for this function:

◆ error_output()

◆ float_quat_vmul_right()

void float_quat_vmul_right ( struct FloatQuat mright,
const struct FloatQuat q,
struct FloatVect3 vi 
)

Right multiplication by a quaternion.

vi * q

Definition at line 365 of file ahrs_float_invariant.c.

References FLOAT_QUAT_EXTRACT, FloatQuat::qi, QUAT_ASSIGN, v1, v2, VECT3_ADD, VECT3_CROSS_PRODUCT, VECT3_DOT_PRODUCT, and VECT3_SMUL.

Referenced by invariant_model().

+ Here is the caller graph for this function:

◆ init_invariant_state()

static void init_invariant_state ( void  )
inlinestatic

◆ invariant_model()

static void invariant_model ( float *  o,
const float *  x,
const int  n,
const float *  u,
const int  m 
)
inlinestatic

Variable Documentation

◆ A

const struct FloatVect3 A = { 0.f, 0.f, -9.81f }
static

Definition at line 1 of file ahrs_float_invariant.c.

Referenced by error_output().

◆ ahrs_float_inv