KalmanFilter.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. File name : kalmanFilter.h
  3. Description:
  4. Author : Oliver Wang from Seeed studio
  5. Version : V0.1
  6. Create Time: 2014/04
  7. Change Log :
  8. */
  9. #ifndef _KALMANFILTER_H
  10. #define _KALMANFILTER_H
  11. /****************************************************************************/
  12. /*** Include files ***/
  13. /****************************************************************************/
  14. #include <Arduino.h>
  15. #include <inttypes.h>
  16. /****************************************************************************/
  17. /*** Local variables ***/
  18. /****************************************************************************/
  19. /****************************************************************************/
  20. /*** Class Definitions ***/
  21. /****************************************************************************/
  22. class KalmanFilter {
  23. public:
  24. KalmanFilter();
  25. float Filter(float);
  26. private:
  27. /* variables */
  28. float X_pre, X_post, P_pre, P_post, K_cur;
  29. float Gaussian_Noise_Cov(void);
  30. };
  31. extern KalmanFilter kalmanFilter;
  32. #endif