ACwing FC firmware
STM32WB55: attitude IEKF, altitude Kalman filter, flight core, protocol v2
Loading...
Searching...
No Matches
est_pipeline.c File Reference
#include "est_pipeline.h"
#include "control_hooks.h"
#include "so3.h"
#include <string.h>
#include <math.h>
Include dependency graph for est_pipeline.c:

Go to the source code of this file.

Functions

static void trace_put (est_t *e, uint8_t op, const float *v, int nf, int trusted)
 
void est_init (est_t *e, const est_config_t *cfg, est_cb_t on_state, est_cb_t on_init, void *user)
 
static void on_step (est_t *e, float h)
 
static void on_acc_window (est_t *e, float h_win)
 
static void on_mag (est_t *e, const float m_sensor[3])
 
void est_process (est_t *e, const imu_event_t *ev, size_t n, float dt)
 dt_sample: IMU sample period measured by the MCU (s)
 

Function Documentation

◆ trace_put()

static void trace_put ( est_t *  e,
uint8_t  op,
const float *  v,
int  nf,
int  trusted 
)
static

Definition at line 10 of file est_pipeline.c.

References est_trace_t::buf, EST_OP_ACC, EST_TRACE_MAX, est_trace_t::len, est_trace_t::nops, and est_trace_t::overflow.

Referenced by on_acc_window(), on_mag(), and on_step().

Here is the caller graph for this function:

◆ est_init()

void est_init ( est_t *  e,
const est_config_t *  cfg,
est_cb_t  on_state,
est_cb_t  on_init,
void *  user 
)

Definition at line 23 of file est_pipeline.c.

References accwin_reset(), calib_reset(), on_init(), and on_state().

Referenced by ImuTask(), and take_calibrations().

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

◆ on_step()

static void on_step ( est_t *  e,
float  h 
)
static

Definition at line 34 of file est_pipeline.c.

References accwin_rotate(), ctrl_rate_step(), ctrl_rate_in_t::dt, EST_OP_PROP, ctrl_rate_in_t::gyro, iekf_propagate_dtheta(), ctrl_rate_in_t::step, and trace_put().

Referenced by est_process().

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

◆ on_acc_window()

static void on_acc_window ( est_t *  e,
float  h_win 
)
static

Definition at line 62 of file est_pipeline.c.

References accwin_mean(), accwin_reset(), ctrl_attitude_step(), ctrl_att_in_t::dt, EST_F_ACC_GATED, EST_F_RUNNING, EST_F_STILL, EST_OP_ACC, iekf_get_quat(), iekf_update_acc(), ctrl_att_in_t::q, ctrl_att_in_t::step, trace_put(), and vec3_norm().

Referenced by est_process().

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

◆ on_mag()

static void on_mag ( est_t *  e,
const float  m_sensor[3] 
)
static

Definition at line 105 of file est_pipeline.c.

References accwin_reset(), calib_add(), calib_count(), calib_finish(), calib_reset(), EST_F_MAG_GATED, EST_F_MAG_NEW, EST_OP_MAG, iekf_init(), iekf_update_mag_ex(), iekf_config_t::sigma_acc, iekf_config_t::sigma_mag, trace_put(), vec3_cross(), and vec3_norm().

Referenced by est_process().

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

◆ est_process()

void est_process ( est_t *  e,
const imu_event_t *  ev,
size_t  n,
float  dt 
)

dt_sample: IMU sample period measured by the MCU (s)

Definition at line 155 of file est_pipeline.c.

References accwin_add(), IMU_EV_ACC, IMU_EV_GYRO, IMU_EV_MAG, n, on_acc_window(), on_mag(), on_step(), and imu_event_t::v.

Referenced by ImuTask().

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