Mercurial > hg > beaglert
annotate include/Kalman.h @ 149:134bff10e561 ClockSync
Added simple one-variable one-measurement Kalman filter, Pid controller(which output is not used). Virtual clock is now much more precise and reactive for period. Still it is lagging behind a bit on the overall offset.
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Mon, 21 Sep 2015 03:12:21 +0100 |
parents | |
children |
rev | line source |
---|---|
giuliomoro@149 | 1 /* |
giuliomoro@149 | 2 * Kalman.h |
giuliomoro@149 | 3 * |
giuliomoro@149 | 4 * Created on: 20 Sep 2015 |
giuliomoro@149 | 5 * Author: giulio |
giuliomoro@149 | 6 */ |
giuliomoro@149 | 7 |
giuliomoro@149 | 8 #ifndef KALMAN_H_ |
giuliomoro@149 | 9 #define KALMAN_H_ |
giuliomoro@149 | 10 |
giuliomoro@149 | 11 class KalmanOne{ |
giuliomoro@149 | 12 public: |
giuliomoro@149 | 13 double A; |
giuliomoro@149 | 14 double H; |
giuliomoro@149 | 15 double Q; |
giuliomoro@149 | 16 double R; |
giuliomoro@149 | 17 double x; |
giuliomoro@149 | 18 double P; |
giuliomoro@149 | 19 void init(double newQ, double newR, double newX); |
giuliomoro@149 | 20 double process(double z); |
giuliomoro@149 | 21 }; |
giuliomoro@149 | 22 |
giuliomoro@149 | 23 |
giuliomoro@149 | 24 |
giuliomoro@149 | 25 #endif /* KALMAN_H_ */ |