blob: 61b682ea24966c9ef876c8ccee6afaa9946fedda (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
/*
* SimpleKalmanFilter - a Kalman Filter implementation for single variable models.
* Created by Denys Sene, January, 1, 2017.
* Released under MIT License - see LICENSE file for details.
*/
#ifndef SimpleKalmanFilter_h
#define SimpleKalmanFilter_h
class SimpleKalmanFilter
{
public:
SimpleKalmanFilter(float mea_e, float est_e, float q);
float updateEstimate(float mea);
void setMeasurementError(float mea_e);
void setEstimateError(float est_e);
void setProcessNoise(float q);
float getKalmanGain();
float getEstimateError();
private:
float _err_measure;
float _err_estimate;
float _q;
float _current_estimate = 0;
float _last_estimate = 0;
float _kalman_gain = 0;
};
#endif
|