ACwing FC firmware
STM32WB55: attitude IEKF, altitude Kalman filter, flight core, protocol v2
Loading...
Searching...
No Matches
calib.c File Reference

Static calibration (see calib.h). More...

#include "calib.h"
#include "so3.h"
#include <string.h>
#include <math.h>
Include dependency graph for calib.c:

Go to the source code of this file.

Functions

void calib_reset (calib_t *c)
 
uint32_t calib_count (const calib_t *c)
 
int calib_add (calib_t *c, const float acc[3], const float gyro[3], const float mag[3], float gyro_still_thr)
 Returns 0 if the sample is compatible with "still", -1 if moving.
 
float direction_noise_std (const float(*v)[3], uint32_t n)
 
int calib_finish (const calib_t *c, float sigma_min, calib_result_t *out)
 

Detailed Description

Static calibration (see calib.h).

Definition in file calib.c.

Function Documentation

◆ calib_reset()

void calib_reset ( calib_t *  c)

Definition at line 10 of file calib.c.

Referenced by est_init(), and on_mag().

Here is the caller graph for this function:

◆ calib_count()

uint32_t calib_count ( const calib_t *  c)

Definition at line 12 of file calib.c.

References calib_t::n.

Referenced by on_mag().

Here is the caller graph for this function:

◆ calib_add()

int calib_add ( calib_t *  c,
const float  acc[3],
const float  gyro[3],
const float  mag[3],
float  gyro_still_thr 
)

Returns 0 if the sample is compatible with "still", -1 if moving.

Definition at line 14 of file calib.c.

References calib_t::acc, CALIB_MAX_SAMPLES, calib_t::gyro_norm_max, calib_t::gyro_sum, calib_t::mag, calib_t::n, and vec3_norm().

Referenced by on_mag().

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

◆ direction_noise_std()

float direction_noise_std ( const float(*)  v[3],
uint32_t  n 
)

Definition at line 29 of file calib.c.

References n, vec3_dot(), vec3_norm(), and vec3_normalize().

Referenced by calib_finish().

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

◆ calib_finish()

int calib_finish ( const calib_t *  c,
float  sigma_min,
calib_result_t *  out 
)

Definition at line 52 of file calib.c.

References calib_t::acc, direction_noise_std(), calib_t::gyro_sum, calib_t::mag, mat3_vec(), calib_t::n, s, calib_result_t::seed, calib_result_t::sigma_acc, calib_result_t::sigma_acc_raw, calib_result_t::sigma_mag, calib_result_t::sigma_mag_raw, vec3_cross(), vec3_dot(), vec3_norm(), and vec3_normalize().

Referenced by on_mag().

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