Vincent Soubirane / Mbed 2 deprecated Projet_ATTITUDE_IMU

Dependencies:   mbed

Committer:
natvich
Date:
Sat Oct 30 17:17:07 2021 +0000
Revision:
1:57502185804c
Projet ATTITUDE IMU

Who changed what in which revision?

UserRevisionLine numberNew contents of line
natvich 1:57502185804c 1 /**
natvich 1:57502185804c 2 * @file FusionBias.h
natvich 1:57502185804c 3 * @author Seb Madgwick
natvich 1:57502185804c 4 * @brief The gyroscope bias correction algorithm achieves run-time calibration
natvich 1:57502185804c 5 * of the gyroscope bias. The algorithm will detect when the gyroscope is
natvich 1:57502185804c 6 * stationary for a set period of time and then begin to sample gyroscope
natvich 1:57502185804c 7 * measurements to calculate the bias as an average.
natvich 1:57502185804c 8 */
natvich 1:57502185804c 9
natvich 1:57502185804c 10 #ifndef FUSION_BIAS_H
natvich 1:57502185804c 11 #define FUSION_BIAS_H
natvich 1:57502185804c 12
natvich 1:57502185804c 13 //------------------------------------------------------------------------------
natvich 1:57502185804c 14 // Includes
natvich 1:57502185804c 15
natvich 1:57502185804c 16 #include "FusionTypes.h"
natvich 1:57502185804c 17 #include <stdbool.h>
natvich 1:57502185804c 18
natvich 1:57502185804c 19 //------------------------------------------------------------------------------
natvich 1:57502185804c 20 // Definitions
natvich 1:57502185804c 21
natvich 1:57502185804c 22 /**
natvich 1:57502185804c 23 * @brief Gyroscope bias correction algorithm structure. Structure members are
natvich 1:57502185804c 24 * used internally and should not be used by the user application.
natvich 1:57502185804c 25 */
natvich 1:57502185804c 26 typedef struct {
natvich 1:57502185804c 27 float threshold;
natvich 1:57502185804c 28 float samplePeriod;
natvich 1:57502185804c 29 float filterCoefficient;
natvich 1:57502185804c 30 float stationaryTimer;
natvich 1:57502185804c 31 FusionVector3 gyroscopeBias;
natvich 1:57502185804c 32 } FusionBias;
natvich 1:57502185804c 33
natvich 1:57502185804c 34 //------------------------------------------------------------------------------
natvich 1:57502185804c 35 // Function prototypes
natvich 1:57502185804c 36
natvich 1:57502185804c 37 void FusionBiasInitialise(FusionBias * const fusionBias, const float threshold, const float samplePeriod);
natvich 1:57502185804c 38 FusionVector3 FusionBiasUpdate(FusionBias * const fusionBias, FusionVector3 gyroscope);
natvich 1:57502185804c 39 bool FusionBiasIsActive(FusionBias * const fusionBias);
natvich 1:57502185804c 40
natvich 1:57502185804c 41 #endif
natvich 1:57502185804c 42
natvich 1:57502185804c 43 //------------------------------------------------------------------------------
natvich 1:57502185804c 44 // End of file