KalmanFilter.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. {
  24. public:
  25. KalmanFilter();
  26. float Filter(float);
  27. private:
  28. /* variables */
  29. float X_pre, X_post, P_pre, P_post, K_cur;
  30. float Gaussian_Noise_Cov(void);
  31. };
  32. extern KalmanFilter kalmanFilter;
  33. #endif