Vincent Soubirane / Mbed 2 deprecated Projet_ATTITUDE_IMU

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers FusionBias.h Source File

FusionBias.h

Go to the documentation of this file.
00001 /**
00002  * @file FusionBias.h
00003  * @author Seb Madgwick
00004  * @brief The gyroscope bias correction algorithm achieves run-time calibration
00005  * of the gyroscope bias.  The algorithm will detect when the gyroscope is
00006  * stationary for a set period of time and then begin to sample gyroscope
00007  * measurements to calculate the bias as an average.
00008  */
00009 
00010 #ifndef FUSION_BIAS_H
00011 #define FUSION_BIAS_H
00012 
00013 //------------------------------------------------------------------------------
00014 // Includes
00015 
00016 #include "FusionTypes.h"
00017 #include <stdbool.h>
00018 
00019 //------------------------------------------------------------------------------
00020 // Definitions
00021 
00022 /**
00023  * @brief Gyroscope bias correction algorithm structure.  Structure members are
00024  * used internally and should not be used by the user application.
00025  */
00026 typedef struct {
00027     float threshold;
00028     float samplePeriod;
00029     float filterCoefficient;
00030     float stationaryTimer;
00031     FusionVector3 gyroscopeBias;
00032 } FusionBias;
00033 
00034 //------------------------------------------------------------------------------
00035 // Function prototypes
00036 
00037 void FusionBiasInitialise(FusionBias * const fusionBias, const float threshold, const float samplePeriod);
00038 FusionVector3 FusionBiasUpdate(FusionBias * const fusionBias, FusionVector3 gyroscope);
00039 bool FusionBiasIsActive(FusionBias * const fusionBias);
00040 
00041 #endif
00042 
00043 //------------------------------------------------------------------------------
00044 // End of file