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

Go to the source code of this file.


#define INS_INV_LV   2.f
#define INS_INV_LB   6.f
#define INS_INV_MV   8.f
#define INS_INV_MVZ   15.f
#define INS_INV_MH   0.2f
#define INS_INV_NX   0.8f
#define INS_INV_NXZ   0.5f
#define INS_INV_NH   1.2f
#define INS_INV_OV   1.2f
#define INS_INV_OB   1.f
#define INS_INV_RV   4.f
#define INS_INV_RH   8.f
#define INS_INV_SH   0.01f
#define B   ins_float_inv.mag_h
#define MAG_FROZEN_COUNT   30


static void error_output (struct InsFloatInv *_ins)
 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)
static void send_inv_filter (struct transport_tx *trans, struct link_device *dev)
void ins_float_invariant_init (void)
void ins_reset_local_origin (void)
 INS local origin reset. More...
void ins_reset_altitude_ref (void)
 INS altitude reference reset. More...
void ins_float_invariant_align (struct FloatRates *lp_gyro, struct FloatVect3 *lp_accel, struct FloatVect3 *lp_mag)
void ins_float_invariant_propagate (struct FloatRates *gyro, struct FloatVect3 *accel, float dt)
void ins_float_invariant_update_gps (struct GpsState *gps_s)
void ins_float_invariant_update_baro (float pressure)
void ins_float_invariant_update_mag (struct FloatVect3 *mag)


struct InsFloatInv ins_float_inv
static const struct FloatVect3 A = { 0.f, 0.f, 9.81f }
bool ins_baro_initialized
bool ins_gps_fix_once

Detailed Description

Jean-Philippe Condomines

INS using invariant filter.

Definition in file ins_float_invariant.c.

Macro Definition Documentation

◆ B

#define B   ins_float_inv.mag_h

Definition at line 144 of file ins_float_invariant.c.



Definition at line 154 of file ins_float_invariant.c.


#define INS_INV_LB   6.f

Definition at line 89 of file ins_float_invariant.c.


#define INS_INV_LV   2.f

Definition at line 85 of file ins_float_invariant.c.


#define INS_INV_MH   0.2f

Definition at line 101 of file ins_float_invariant.c.


#define INS_INV_MV   8.f

Definition at line 93 of file ins_float_invariant.c.


#define INS_INV_MVZ   15.f

Definition at line 97 of file ins_float_invariant.c.


#define INS_INV_NH   1.2f

Definition at line 113 of file ins_float_invariant.c.


#define INS_INV_NX   0.8f

Definition at line 105 of file ins_float_invariant.c.


#define INS_INV_NXZ   0.5f

Definition at line 109 of file ins_float_invariant.c.


#define INS_INV_OB   1.f

Definition at line 121 of file ins_float_invariant.c.


#define INS_INV_OV   1.2f

Definition at line 117 of file ins_float_invariant.c.


#define INS_INV_RH   8.f

Definition at line 129 of file ins_float_invariant.c.


#define INS_INV_RV   4.f

Definition at line 125 of file ins_float_invariant.c.


#define INS_INV_SH   0.01f

Definition at line 133 of file ins_float_invariant.c.


#define MAG_FROZEN_COUNT   30

Definition at line 565 of file ins_float_invariant.c.

Function Documentation

◆ 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 737 of file ins_float_invariant.c.


Referenced by invariant_model().

+ Here is the caller graph for this function:

◆ init_invariant_state()

◆ ins_float_invariant_align()

void ins_float_invariant_align ( struct FloatRates lp_gyro,
struct FloatVect3 lp_accel,
struct FloatVect3 lp_mag 

Definition at line 324 of file ins_float_invariant.c.

References ahrs_float_get_quat_from_accel(), ahrs_float_get_quat_from_accel_mag(), inv_state::bias, ins_float_inv, InsFloatInv::is_aligned, inv_state::quat, InsFloatInv::state, and stateSetNedToBodyQuat_f().

Referenced by aligner_cb().

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

◆ ins_float_invariant_init()

◆ ins_float_invariant_propagate()

◆ ins_float_invariant_update_baro()

void ins_float_invariant_update_baro ( float  pressure)

Definition at line 531 of file ins_float_invariant.c.

References alpha, inv_measures::baro_alt, ins_baro_initialized, ins_float_inv, InsFloatInv::meas, pprz_isa_height_of_pressure(), and PPRZ_ISA_SEA_LEVEL_PRESSURE.

Referenced by baro_cb().

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

◆ ins_float_invariant_update_gps()

◆ ins_float_invariant_update_mag()

void ins_float_invariant_update_mag ( struct FloatVect3 mag)

Definition at line 567 of file ins_float_invariant.c.

References FLOAT_VECT3_ZERO, ins_float_inv, inv_measures::mag, MAG_FROZEN_COUNT, InsFloatInv::meas, VECT3_COPY, and FloatVect3::x.

Referenced by ins_float_invariant_update_gps(), and mag_cb().

+ Here is the caller graph for this function:

◆ ins_reset_altitude_ref()

void ins_reset_altitude_ref ( void  )

INS altitude reference reset.

Reset only vertical reference to the current altitude. Does nothing if not implemented by specific INS algorithm.

Definition at line 302 of file ins_float_invariant.c.

References UtmCoor_f::alt, LlaCoor_i::alt, gps, LtpDef_i::hmsl, GpsState::hmsl, ins_float_inv, LlaCoor_i::lat, LtpDef_i::lla, GpsState::lla_pos, LlaCoor_i::lon, ltp_def, ltp_def_from_lla_i(), State::ned_origin_i, inv_state::pos, inv_state::speed, InsFloatInv::state, state, stateSetLocalOrigin_i(), stateSetLocalUtmOrigin_f(), State::utm_origin_f, and NedCoor_f::z.

+ Here is the call graph for this function:

◆ ins_reset_local_origin()

void ins_reset_local_origin ( void  )

INS local origin reset.

Reset horizontal and vertical reference to the current position. Does nothing if not implemented by specific INS algorithm.

INS local origin reset.

Definition at line 282 of file ins_float_invariant.c.

References LlaCoor_i::alt, ecef_int_from_gps(), FLOAT_VECT3_ZERO, gps, LtpDef_i::hmsl, GpsState::hmsl, ins_float_inv, LtpDef_i::lla, lla_int_from_gps(), ltp_def, ltp_def_from_ecef_i(), inv_state::pos, inv_state::speed, InsFloatInv::state, stateSetLocalOrigin_i(), stateSetLocalUtmOrigin_f(), and utm_float_from_gps().

+ Here is the call graph for this function:

◆ invariant_model()

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

◆ send_inv_filter()

static void send_inv_filter ( struct transport_tx *  trans,
struct link_device *  dev 

Variable Documentation

◆ A

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

Definition at line 1 of file ins_float_invariant.c.

Referenced by ins_float_invariant_propagate(), and invariant_model().

◆ ins_baro_initialized

bool ins_baro_initialized

Definition at line 147 of file ins_float_invariant.c.

Referenced by init_invariant_state(), and ins_float_invariant_update_baro().

◆ ins_float_inv

◆ ins_gps_fix_once

bool ins_gps_fix_once