Paparazzi UAS
v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
|
Extended vertical filter (in float). More...
#include "subsystems/ins/vf_extended_float.h"
#include "generated/airframe.h"
#include "std.h"
#include "subsystems/datalink/telemetry.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_VFF_EXTENDED 0 |
#define | VFF_EXTENDED_INIT_PXX 1.0 |
initial covariance diagonal More... | |
#define | VFF_EXTENDED_ACCEL_NOISE 0.5 |
process noise covariance Q More... | |
#define | Qbiasbias 1e-7 |
#define | Qoffoff 1e-4 |
#define | R_BARO 1. |
#define | R_ALT 0.1 |
#define | R_OFFSET 1. |
Functions | |
static void | send_vffe (struct transport_tx *trans, struct link_device *dev) |
void | vff_init_zero (void) |
void | vff_init (float init_z, float init_zdot, float init_accel_bias, float init_baro_offset) |
void | vff_propagate (float accel, float dt) |
Propagate the filter in time. More... | |
static void | update_baro_conf (float z_meas, float conf) |
Update sensor "with" offset (baro). More... | |
void | vff_update_baro (float z_meas) |
void | vff_update_baro_conf (float z_meas, float conf) |
static void | update_alt_conf (float z_meas, float conf) |
Update sensor "without" offset (gps, sonar) H = [1 0 0 0]; // state residual y = rangemeter - H * Xm; // covariance residual S = H*Pm*H' + R; // kalman gain K = Pm*H'*inv(S); // update state Xp = Xm + K*y; // update covariance Pp = Pm - K*H*Pm;. More... | |
void | vff_update_z (float z_meas) |
void | vff_update_z_conf (float z_meas, float conf) |
static void | update_offset_conf (float offset, float conf) |
Update sensor offset (baro). More... | |
void | vff_update_offset (float offset) |
void | vff_realign (float z_meas) |
static void | update_vz_conf (float vz, float conf) |
void | vff_update_vz_conf (float vz_meas, float conf) |
Variables | |
struct VffExtended | vff |
Extended vertical filter (in float).
Estimates altitude, vertical speed, accelerometer bias and barometer offset.
X = [ z zdot accel_bias baro_offset ]
Definition in file vf_extended_float.c.
#define DEBUG_VFF_EXTENDED 0 |
Definition at line 39 of file vf_extended_float.c.
#define Qbiasbias 1e-7 |
Definition at line 60 of file vf_extended_float.c.
Referenced by vff_propagate().
#define Qoffoff 1e-4 |
Definition at line 61 of file vf_extended_float.c.
Referenced by vff_propagate().
#define R_ALT 0.1 |
Definition at line 63 of file vf_extended_float.c.
Referenced by vff_update_z().
#define R_BARO 1. |
Definition at line 62 of file vf_extended_float.c.
Referenced by vff_update_baro().
#define R_OFFSET 1. |
Definition at line 64 of file vf_extended_float.c.
Referenced by vff_update_offset().
#define VFF_EXTENDED_ACCEL_NOISE 0.5 |
process noise covariance Q
Definition at line 57 of file vf_extended_float.c.
Referenced by vff_propagate().
#define VFF_EXTENDED_INIT_PXX 1.0 |
initial covariance diagonal
Definition at line 52 of file vf_extended_float.c.
Referenced by vff_init().
|
static |
Definition at line 71 of file vf_extended_float.c.
References VffExtended::bias, VffExtended::offset, vff, VffExtended::z, VffExtended::z_meas, VffExtended::z_meas_baro, VffExtended::zdot, and VffExtended::zdotdot.
Referenced by vff_init(), and vff_propagate().
|
static |
Update sensor "without" offset (gps, sonar) H = [1 0 0 0]; // state residual y = rangemeter - H * Xm; // covariance residual S = H*Pm*H' + R; // kalman gain K = Pm*H'*inv(S); // update state Xp = Xm + K*y; // update covariance Pp = Pm - K*H*Pm;.
Definition at line 240 of file vf_extended_float.c.
References VffExtended::bias, K0, VffExtended::offset, VffExtended::P, vff, VffExtended::z, VffExtended::z_meas, and VffExtended::zdot.
Referenced by vff_update_z(), and vff_update_z_conf().
|
static |
Update sensor "with" offset (baro).
H = [1 0 0 -1]; // state residual y = rangemeter - H * Xm; // covariance residual S = H*Pm*H' + R; // kalman gain K = Pm*H'*inv(S); // update state Xp = Xm + K*y; // update covariance Pp = Pm - K*H*Pm;
Definition at line 176 of file vf_extended_float.c.
References VffExtended::bias, K0, VffExtended::offset, VffExtended::P, vff, VffExtended::z, VffExtended::z_meas, VffExtended::z_meas_baro, and VffExtended::zdot.
Referenced by vff_update_baro(), and vff_update_baro_conf().
|
static |
Update sensor offset (baro).
H = [0 0 0 1]; // state residual y = rangemeter - H * Xm; // covariance residual S = H*Pm*H' + R; // kalman gain K = Pm*H'*inv(S); // update state Xp = Xm + K*y; // update covariance Pp = Pm - K*H*Pm;
Definition at line 303 of file vf_extended_float.c.
References VffExtended::bias, K0, VffExtended::offset, VffExtended::P, vff, VffExtended::z, and VffExtended::zdot.
Referenced by vff_update_offset().
|
inlinestatic |
Definition at line 369 of file vf_extended_float.c.
References VffExtended::bias, K0, VffExtended::offset, VffExtended::P, vff, VffExtended::z, and VffExtended::zdot.
Referenced by vff_update_vz_conf().
void vff_init | ( | float | init_z, |
float | init_zdot, | ||
float | init_accel_bias, | ||
float | init_baro_offset | ||
) |
Definition at line 85 of file vf_extended_float.c.
References VffExtended::bias, DefaultPeriodic, VffExtended::offset, VffExtended::P, register_periodic_telemetry(), send_vffe(), vff, VFF_EXTENDED_INIT_PXX, VFF_STATE_SIZE, VffExtended::z, and VffExtended::zdot.
Referenced by vff_init_zero(), and vff_realign().
void vff_init_zero | ( | void | ) |
Definition at line 80 of file vf_extended_float.c.
Referenced by ins_int_init().
void vff_propagate | ( | float | accel, |
float | dt | ||
) |
Propagate the filter in time.
F = [ 1 dt -dt^2/2 0 0 1 -dt 0 0 0 1 0 0 0 0 1 ];
B = [ dt^2/2 dt 0 0]';
Q = [ Qzz 0 0 0 0 Qzdotzdot 0 0 0 0 Qbiasbias 0 0 0 0 0 Qoffoff ];
Qzz = VFF_EXTENDED_ACCEL_NOISE * DT_VFILTER * DT_VFILTER / 2. Qzdotzdot = VFF_EXTENDED_ACCEL_NOISE * DT_VFILTER
Xk1 = F * Xk0 + B * accel;
Pk1 = F * Pk0 * F' + Q;
Definition at line 127 of file vf_extended_float.c.
Referenced by ins_int_propagate().
void vff_realign | ( | float | z_meas | ) |
Definition at line 347 of file vf_extended_float.c.
Referenced by baro_cb().
void vff_update_baro | ( | float | z_meas | ) |
Definition at line 216 of file vf_extended_float.c.
References R_BARO, and update_baro_conf().
Referenced by baro_cb().
void vff_update_baro_conf | ( | float | z_meas, |
float | conf | ||
) |
Definition at line 221 of file vf_extended_float.c.
References update_baro_conf().
void vff_update_offset | ( | float | offset | ) |
Definition at line 341 of file vf_extended_float.c.
References R_OFFSET, and update_offset_conf().
void vff_update_vz_conf | ( | float | vz_meas, |
float | conf | ||
) |
Definition at line 406 of file vf_extended_float.c.
Referenced by ins_int_update_gps().
void vff_update_z | ( | float | z_meas | ) |
Definition at line 279 of file vf_extended_float.c.
References R_ALT, and update_alt_conf().
void vff_update_z_conf | ( | float | z_meas, |
float | conf | ||
) |
Definition at line 284 of file vf_extended_float.c.
Referenced by ins_int_update_gps().
struct VffExtended vff |
Definition at line 66 of file vf_extended_float.c.
Referenced by ins_update_from_vff(), send_vffe(), update_alt_conf(), update_baro_conf(), update_offset_conf(), update_vz_conf(), vff_init(), and vff_propagate().