AvrIO  1.4.5
Bibliothèque C modulaire pour ATMEL AVR
kalman.h
1 
31 #ifndef _AVRIO_KALMAN_H_
32 #define _AVRIO_KALMAN_H_
33 
34 #include <avrio/defs.h>
35 
36 __BEGIN_C_DECLS
37 /* ========================================================================== */
49 /* constants ================================================================ */
50 #define KALMAN_Q_ANGLE 0.001
51 #define KALMAN_Q_BIAS 0.003
52 #define KALMAN_R_MEASURE 0.03
53 
54 /* structures =============================================================== */
59 typedef struct xKalmanFilter {
60 
61  double fQAngle;
62  double fQBias;
63  double fRMeasure;
64 
65  double fAngle;
66  double fBias;
67  double fRate;
68 
69  double fP[2][2];
70  double fK[2];
71  double fY;
72  double fS;
74 
75 
76 /* internal public functions ================================================ */
83 void vKalmanInit (xKalmanFilter * xFilter);
84 
94 void vKalmanProcess (xKalmanFilter * xFilter, double fNewAngle, double fNewRate, uint16_t usDt);
95 
96 // -----------------------------------------------------------------------------
97 
98 # if defined(__DOXYGEN__)
99 /*
100  * __DOXYGEN__ defined
101  * Partie documentation ne devant pas être compilée.
102  * =============================================================================
103  */
109 # else
110 /*
111  * __DOXYGEN__ not defined
112  * Partie ne devant pas être documentée.
113  * =============================================================================
114  */
115 
116 /* public variables ========================================================= */
117 
118 # endif /* __DOXYGEN__ not defined */
119 /* ========================================================================== */
120 __END_C_DECLS
121 #endif /* _AVRIO_KALMAN_H_ not defined */
double fQAngle
Process noise variance for the accelerometer.
Definition: kalman.h:61
double fK[2]
Kalman gain - This is a 2x1 matrix.
Definition: kalman.h:70
double fRate
Unbiased rate calculated from the rate and the calculated bias - you have to call getAngle to update ...
Definition: kalman.h:67
double fAngle
The angle calculated by the Kalman filter - part of the 2x1 state matrix.
Definition: kalman.h:65
double fRMeasure
Measurement noise variance - this is actually the variance of the measurement noise.
Definition: kalman.h:63
double fBias
The gyro bias calculated by the Kalman filter - part of the 2x1 state matrix.
Definition: kalman.h:66
void vKalmanInit(xKalmanFilter *xFilter)
Initialise le filtre.
double fQBias
Process noise variance for the gyro bias.
Definition: kalman.h:62
double fS
Estimate error - 1x1 matrix.
Definition: kalman.h:72
double fP[2][2]
Error covariance matrix - This is a 2x2 matrix.
Definition: kalman.h:69
Données du filtre de Kalman.
Definition: kalman.h:59
double fY
Angle difference - 1x1 matrix.
Definition: kalman.h:71
void vKalmanProcess(xKalmanFilter *xFilter, double fNewAngle, double fNewRate, uint16_t usDt)
Processus de filtrage.