/* Extended Kalman Filter class by Sam Tabor, 2013. * http://diydrones.com/forum/topics/autonomous-soaring * Set up for identifying thermals of Gaussian form, but could be adapted to other * purposes by adapting the equations for the jacobians. */ #pragma once #include class ExtendedKalmanFilter { public: ExtendedKalmanFilter(void) {} static constexpr const uint8_t N = 4; VectorN X; MatrixN P; MatrixN Q; float R; void reset(const VectorN &x, const MatrixN &p, const MatrixN q, float r); void update(float z, float Vx, float Vy); private: float measurementpredandjacobian(VectorN &A); };