35#include "generated/airframe.h"
38#ifndef DEBUG_VFF_EXTENDED
39#define DEBUG_VFF_EXTENDED 0
46#include "pprzlink/messages.h"
51#ifndef VFF_EXTENDED_INIT_PXX
52#define VFF_EXTENDED_INIT_PXX 1.0f
56#ifndef VFF_EXTENDED_ACCEL_NOISE
57#define VFF_EXTENDED_ACCEL_NOISE 0.5f
61#ifndef VFF_EXTENDED_R_BARO
62#define VFF_EXTENDED_R_BARO 2.f
77#ifdef VFF_EXTENDED_NON_FLAT_GROUND
87#define R_OBS_HEIGHT 8.f
112#if DEBUG_VFF_EXTENDED > 1
142#ifndef VFF_EXTENDED_NON_FLAT_GROUND
151#if PERIODIC_TELEMETRY
213#if DEBUG_VFF_EXTENDED
216#if DEBUG_VFF_EXTENDED > 1
312 if (conf < 0.f) {
return; }
323 if (conf < 0.f) {
return; }
329 if (conf < 0.f) {
return; }
358 const float S =
vff.
P[4][4] + conf;
412 const float S =
vff.
P[1][1] + conf;
416 K[i] =
vff.
P[i][1] * 1 /
S;
435 if (conf < 0.f) {
return; }
Common code for AP and FBW telemetry.
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
static const struct usb_device_descriptor dev
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
static void update_vz_conf(float vz, float conf)
#define VFF_EXTENDED_R_BARO
Barometer confidence.
#define VFF_EXTENDED_ACCEL_NOISE
process noise covariance Q
static void update_biased_z_conf(float z_meas, float conf)
Update sensor "with" offset (baro, sonar).
void vff_update_z_conf(float z_meas, float conf)
void vff_update_z(float z_meas)
static void update_obs_height(float obs_height, float conf)
Update obstacle height.
#define Qoffoff
VFF_EXTENDED_NON_FLAT_GROUND removes the assumption of a flat ground and tries to estimate the height...
void vff_init(float init_z, float init_zdot, float init_accel_bias, float init_offset, float init_obs_height)
static void send_vffe(struct transport_tx *trans, struct link_device *dev)
void vff_update_vz_conf(float vz_meas, float conf)
void vff_update_obs_height(float obs_height)
static void update_alt_conf(float z_meas, float conf)
Update sensor "without" offset (gps, sonar) H = [1 0 0 0 -1]; // state residual y = rangemeter - H * ...
void vff_update_baro(float z_meas)
void vff_realign(float z_meas)
void vff_propagate(float accel, float dt)
Propagate the filter in time.
void vff_update_baro_conf(float z_meas, float conf)
#define DEBUG_VFF_EXTENDED
void vff_update_agl(float z_meas, float conf)
#define VFF_EXTENDED_INIT_PXX
initial covariance diagonal
Interface for extended vertical filter (in float).
float zdotdot
z-acceleration in m/s^2 (NED, z-down)
float obs_height
estimate of height of obstacles under the vehicle
float zdot
z-velocity estimate in m/s (NED, z-down)
float offset
baro offset estimate
float z_meas
last z measurement in m
float bias
accel bias estimate in m/s^2
float z_meas_baro
last z measurement from baro in m
float P[VFF_STATE_SIZE][VFF_STATE_SIZE]
covariance matrix
float z
z-position estimate in m (NED, z-down)