30#define IEKF_P_ATT_MIN 1e-12f
31#define IEKF_P_BIAS_MIN 1e-16f
101 float g_ref[3], m_ref[3];
106 float last_acc_dir[3];
114 float innov_w_mean[3];
116 float last_acc_innov_b[3];
119 float wF[36], wA[36], wB[36];
120 float wH[18], wHt[18], wPHt[18], wK[18];
int iekf_update_mag_ex(iekf_t *f, const float mag[3], float extra_var)
As above, with an additional per-component variance (e.g.
int iekf_update_mag(iekf_t *f, const float mag[3])
void iekf_propagate(iekf_t *f, const float gyro[3], float dt)
Single-sample case: dtheta = gyro*dt (compatible with the previous port)
void iekf_init(iekf_t *f, const iekf_config_t *cfg, const iekf_seed_t *seed)
void iekf_default_config(iekf_config_t *cfg)
void iekf_get_quat(const iekf_t *f, float q[4])
int iekf_update_acc(iekf_t *f, const float acc[3])
Return 1 if the measurement was "gated" (de-weighted), 0 otherwise.
void iekf_reset_attitude(iekf_t *f, const float R0[9], float p0_att)
Re-initialisation of the attitude away from rest (estimator reset after a failsafe,...
void iekf_propagate_dtheta(iekf_t *f, const float dtheta[3], float dt)
Propagation with a measured angle increment (bias NOT yet removed): phi = dtheta - b*dt.
uint8_t decouple
1: acc corrects only roll/pitch, mag only yaw
float infl_max
— protection against "lockout" of the NIS inflation — If the estimate is truly wrong,...
uint8_t reset_jacobian
1: transport P after the retraction (default)
float sigma_bias
rad/s^2, bias random walk
float p0_att
initial attitude variance [rad^2]
uint16_t grace_updates
e.g.
float acc_nis_gate
— robustness to external accelerations / magnetic disturbances —
float persist_ratio
|mean|^2 / mean(|e|^2) above which it is persistent, e.g.
float sigma_acc
per-component std of the normalised vector
float p0_bias
initial bias variance [(rad/s)^2]
float sigma_gyro
rad/s, gyro white noise
float persist_decay
moving mean of the innovation: exp(-dt/tau), tau ~ 1 s
uint16_t lockout_updates
e.g.
float acc_tol
relative tolerance on the magnitude (gating)
float lockout_p_bump
rad^2, e.g.
float persist_min
minimum |mean| (sine of the error), e.g.
Initial conditions, typically from calib_finish()
float nom_acc
nominal magnitudes for the adaptive gating
uint16_t acc_grace
remaining acc updates without inflation
uint16_t acc_gated_run
consecutive acc updates with inflation > 2
float innov_w_pow
moving mean of |innovation|^2
uint32_t lockouts
how many times the protection fired
float dip_ref
g_ref-m_ref angle, rad