Zephyr Scientific Library (zscilib)
aqua.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021 Marti Riba Pons
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
23 #ifndef ZEPHYR_INCLUDE_ZSL_FUSION_AQUA_H_
24 #define ZEPHYR_INCLUDE_ZSL_FUSION_AQUA_H_
25 
26 #include <zsl/zsl.h>
27 #include <zsl/vectors.h>
28 #include <zsl/matrices.h>
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 /* Source:
36  * https://res.mdpi.com/sensors/sensors-15-19302/article_deploy/sensors-15-19302.pdf
37  */
38 
51 
59 
66 
73 };
74 
84 int zsl_fus_aqua_init(uint32_t freq, void *cfg);
85 
103 int zsl_fus_aqua_feed(struct zsl_vec *a, struct zsl_vec *m,
104  struct zsl_vec *g, zsl_real_t *incl, struct zsl_quat *q,
105  void *cfg);
106 
114 void zsl_fus_aqua_error(int error);
115 
116 #ifdef __cplusplus
117 }
118 #endif
119 
120 #endif /* ZEPHYR_INCLUDE_ZSL_FUSION_AQUA_H_ */
121  /* End of algorithms group */
zsl_fus_aqua_cfg
Config settings for the AQUA sensor fusion algorithm.
Definition: aqua.h:42
zsl_quat
Represents a quaternion, a 4D structure capable of representing 3D rigid body orientations.
Definition: quaternions.h:89
zsl_fus_aqua_cfg::alpha
zsl_real_t alpha
A value between 0.0 and 1.0 which sets the gain for the cut-off frequency of the filter....
Definition: aqua.h:50
zsl_fus_aqua_init
int zsl_fus_aqua_init(uint32_t freq, void *cfg)
Sets the sample frequency (in Hz) for the algorithm.
zsl_fus_aqua_cfg::e_a
zsl_real_t e_a
Threshold value to determine whether to compute LERP or SLERP to reduce the amount of high frequency ...
Definition: aqua.h:65
zsl_fus_aqua_cfg::beta
zsl_real_t beta
Similar to alpha, this variable is set between 0.0 and 1.0 and is used to control the LERP or SLERP,...
Definition: aqua.h:58
quaternions.h
API header file for quaternions in zscilib.
vectors.h
API header file for vectors in zscilib.
matrices.h
API header file for matrices in zscilib.
zsl.h
API header file for zscilib.
zsl_vec
Represents a vector.
Definition: vectors.h:40
zsl_real_t
double zsl_real_t
Definition: zsl.h:51
zsl_fus_aqua_feed
int zsl_fus_aqua_feed(struct zsl_vec *a, struct zsl_vec *m, struct zsl_vec *g, zsl_real_t *incl, struct zsl_quat *q, void *cfg)
Algebraic Quaterion Algorithm (AQUA) sensor fusion algorithm implementation.
zsl_fus_aqua_cfg::e_m
zsl_real_t e_m
Threshold value to determine whether to compute LERP or SLERP to reduce the amount of high frequency ...
Definition: aqua.h:72
zsl_fus_aqua_error
void zsl_fus_aqua_error(int error)
Default error handler for the AQUA sensor fusion driver.