Zephyr Scientific Library (zscilib)
fusion.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021 Kevin Townsend
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
31 #ifndef ZEPHYR_INCLUDE_ZSL_FUSION_H_
32 #define ZEPHYR_INCLUDE_ZSL_FUSION_H_
33 
34 #include <zsl/zsl.h>
35 #include <zsl/vectors.h>
36 #include <zsl/matrices.h>
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
59 typedef int (*zsl_fus_init_cb_t)(uint32_t freq, void *cfg);
60 
84 typedef int (*zsl_fus_feed_cb_t)(struct zsl_vec *accel,
85  struct zsl_vec *mag, struct zsl_vec *gyro,
86  zsl_real_t *incl, struct zsl_quat *q, void *cfg);
87 
94 typedef void (*zsl_fus_error_cb_t)(int error);
95 
99 struct zsl_fus_drv {
104 
109 
114 
120  void *config;
121 };
122 
123 #ifdef __cplusplus
124 }
125 #endif
126 
127 #endif /* ZEPHYR_INCLUDE_ZSL_FUSION_H_ */
128  /* End of fusion group */
zsl_fus_drv::init_handler
zsl_fus_init_cb_t init_handler
Callback to fire when initialising the driver.
Definition: fusion.h:103
zsl_quat
Represents a quaternion, a 4D structure capable of representing 3D rigid body orientations.
Definition: quaternions.h:89
mahony.h
Mahony sensor fusion algorithm.
madgwick.h
Madgwick sensor fusion algorithm.
zsl_fus_feed_cb_t
int(* zsl_fus_feed_cb_t)(struct zsl_vec *accel, struct zsl_vec *mag, struct zsl_vec *gyro, zsl_real_t *incl, struct zsl_quat *q, void *cfg)
Update callback prototype for sensor fusion implementations.
Definition: fusion.h:84
zsl_fus_init_cb_t
int(* zsl_fus_init_cb_t)(uint32_t freq, void *cfg)
Init callback prototype for sensor fusion implementations.
Definition: fusion.h:59
saam.h
SAAM sensor fusion algorithm.
quaternions.h
API header file for quaternions in zscilib.
zsl_fus_drv::error_handler
zsl_fus_error_cb_t error_handler
Callback to fire when the 'feed' command fails.
Definition: fusion.h:113
zsl_fus_drv
Sensor fusion algorithm implementation.
Definition: fusion.h:99
complementary.h
Complementary sensor fusion algorithm.
vectors.h
API header file for vectors in zscilib.
zsl_fus_drv::config
void * config
Config settings for the driver. The exact struct or value(s) defined here are driver-specific and def...
Definition: fusion.h:120
matrices.h
API header file for matrices in zscilib.
zsl_fus_error_cb_t
void(* zsl_fus_error_cb_t)(int error)
Callback prototype when a fusion algorithm fails to properly feed.
Definition: fusion.h:94
zsl_fus_drv::feed_handler
zsl_fus_feed_cb_t feed_handler
Callback to fire when feeding/updating the driver.
Definition: fusion.h:108
zsl.h
API header file for zscilib.
aqua.h
AQUA sensor fusion algorithm.
zsl_vec
Represents a vector.
Definition: vectors.h:40
kalman.h
Extended Kalman filter algorithm.
zsl_real_t
double zsl_real_t
Definition: zsl.h:51
calibration.h
Calibration helper functions.