Zephyr Scientific Library (zscilib)
Files | Data Structures | Functions
Extended Kalman

Extended Kalman sensor fuion algorithm. More...

Files

file  kalman.h
 Extended Kalman filter algorithm.
 

Data Structures

struct  zsl_fus_kalm_cfg
 Config settings for the extended Kalman filter. More...
 

Functions

int zsl_fus_kalm_init (uint32_t freq, void *cfg)
 Sets the sample frequency (in Hz) for the algorithm. More...
 
int zsl_fus_kalm_feed (struct zsl_vec *a, struct zsl_vec *m, struct zsl_vec *g, zsl_real_t *incl, struct zsl_quat *q, void *cfg)
 Extended Kalman filter algorithm implementation. More...
 
void zsl_fus_kalm_error (int error)
 Default error handler for the extended Kalman filter driver. More...
 

Detailed Description

Extended Kalman sensor fuion algorithm.

Function Documentation

◆ zsl_fus_kalm_error()

void zsl_fus_kalm_error ( int  error)

Default error handler for the extended Kalman filter driver.

Note
Normally you will want to implement your own version of this function.
Parameters
errorThe error code genereated.

◆ zsl_fus_kalm_feed()

int zsl_fus_kalm_feed ( struct zsl_vec a,
struct zsl_vec m,
struct zsl_vec g,
zsl_real_t incl,
struct zsl_quat q,
void *  cfg 
)

Extended Kalman filter algorithm implementation.

Parameters
aInput accelerometer vector (3 samples required). NULL if none.
mInput magnetometer vector (3 samples required). NULL if none.
gInput gyroscope vector (3 samples required). NULL if none.
inclInput magnetic inclination, in degrees. NULL for none.
qPointer to the output zsl_quat.
cfgPointer to the config struct for this algorithm.
Returns
int 0 if everything executed correctly, otherwise an appropriate negative error code.

◆ zsl_fus_kalm_init()

int zsl_fus_kalm_init ( uint32_t  freq,
void *  cfg 
)

Sets the sample frequency (in Hz) for the algorithm.

Parameters
freqSampling frequency in Hz.
cfgConfig struct for this filter.
Returns
int 0 if everything executed correctly, otherwise an appropriate negative error code.