Zephyr Scientific Library (zscilib)
complementary.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_COMPLEMENTARY_H_
24 #define ZEPHYR_INCLUDE_ZSL_FUSION_COMPLEMENTARY_H_
25 
26 #include <zsl/zsl.h>
27 #include <zsl/vectors.h>
28 #include <zsl/matrices.h>
30 #include <zsl/orientation/ahrs.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /* Source: https://ahrs.readthedocs.io/en/latest/filters/complementary.html */
37 
51 };
52 
62 int zsl_fus_comp_init(uint32_t freq, void *cfg);
63 
77 int zsl_fus_comp_feed(struct zsl_vec *a, struct zsl_vec *m,
78  struct zsl_vec *g, zsl_real_t *incl, struct zsl_quat *q,
79  void *cfg);
80 
88 void zsl_fus_comp_error(int error);
89 
90 #ifdef __cplusplus
91 }
92 #endif
93 
94 #endif /* ZEPHYR_INCLUDE_ZSL_FUSION_COMPLEMENTARY_H_ */
95  /* End of algorithms group */
zsl_fus_comp_init
int zsl_fus_comp_init(uint32_t freq, void *cfg)
Sets the sample frequency (in Hz) for the algorithm.
zsl_quat
Represents a quaternion, a 4D structure capable of representing 3D rigid body orientations.
Definition: quaternions.h:89
zsl_fus_comp_error
void zsl_fus_comp_error(int error)
Default error handler for the complementary sensor fusion driver.
quaternions.h
API header file for quaternions in zscilib.
zsl_fus_comp_feed
int zsl_fus_comp_feed(struct zsl_vec *a, struct zsl_vec *m, struct zsl_vec *g, zsl_real_t *incl, struct zsl_quat *q, void *cfg)
Complementary sensor fusion algorithm implementation.
vectors.h
API header file for vectors in zscilib.
ahrs.h
API header file for attitude and AHRS 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_fus_comp_cfg
Config settings for the complementary sensor fusion algorithm.
Definition: complementary.h:41
zsl_real_t
double zsl_real_t
Definition: zsl.h:51
zsl_fus_comp_cfg::alpha
zsl_real_t alpha
Value between 0 and 1 used to decide which part of the complementary test is more important,...
Definition: complementary.h:50