35 #include <opencv2/core.hpp>
88 virtual void update_x(
const cv::Mat &x_pred, cv::Mat &x);
100 virtual void predict_x(
unsigned long tick);
170 virtual void update_P(
const cv::Mat &P_pred, cv::Mat &P);
258 virtual void h(
const cv::Mat &x_pred, cv::Mat &_z_pred) = 0;
260 virtual void update_x(
const cv::Mat &x_pred, cv::Mat &x);
282 virtual void f(
const cv::Mat &_x, cv::Mat &_x_pred,
double dt) = 0;
284 virtual void predict_x(
unsigned long tick);
320 void img_matrix(
const cv::Mat &mat,
int top,
int left);
This file defines library export definitions, version numbers and build information.
Core implementation for Kalman.
cv::Mat x_pred
Predicted state, TODO: should be protected?!
virtual cv::Mat & predict()
Predict the Kalman state vector for the given time step . x_pred = F * x.
KalmanCore(int _n)
Constructor.
cv::Mat x
The Kalman state vector (n*1)
KalmanCore(const KalmanCore &s)
Copy constructor.
cv::Mat F
The matrix (n*n) containing the transition model for the internal state.
cv::Mat & predict_update(KalmanSensorCore *sensor)
Predict the Kalman state vector and update the state using the constant Kalman gain....
int get_n()
Accessor for n.
Extended Kalman Filter (EKF) implementation.
virtual void update_F(unsigned long tick)
cv::Mat & predict_update(KalmanSensor *sensor, unsigned long tick)
Predict the Kalman state vector for the given time step and update the state using the Kalman gain.
double seconds_since_update(unsigned long tick)
Helper method.
cv::Mat P
The error covariance matrix describing the accuracy of the state estimate.
cv::Mat P_pred
The predicted error covariance matrix.
Kalman(int _n)
Constructor.
cv::Mat & predict(unsigned long tick)
Predict the Kalman state vector for the given time step This calls updateF for updating the transitio...
cv::Mat Q
The covariance matrix for the process noise.
virtual void update_F(unsigned long tick)
Core implementation for Kalman sensor.
KalmanSensorCore(int _n, int _m)
Constructor.
KalmanSensorCore(const KalmanSensorCore &k)
Copy constructor.
cv::Mat z
Latest measurement vector (m*1)
cv::Mat H
The matrix (m*n) mapping Kalman state vector into this sensor's measurements vector.
cv::Mat K
The matrix (n*m) containing Kalman gain (something between 0 and H^-1). In this core-implementation w...
virtual void update_x(const cv::Mat &x_pred, cv::Mat &x)
Method for updating the state estimate x This is called from predict_update() of Kalman....
~KalmanSensorCore()
Destructor.
int get_m()
Accessor for m.
int get_n()
Accessor for n.
Extended Kalman Filter (EKF) sensor implementation.
virtual void update_H(const cv::Mat &x_pred)
Method for updating how the Kalman state vector is mapped into this sensor's measurements vector....
virtual void update_x(const cv::Mat &x_pred, cv::Mat &x)
Method for updating the state estimate x This is called from predict_update() of Kalman....
Kalman sensor implementation.
~KalmanSensor()
Destructor.
cv::Mat R
The covariance matrix for the observation noise.
virtual void update_H(const cv::Mat &x_pred)
Method for updating how the Kalman state vector is mapped into this sensor's measurements vector....
virtual void update_P(const cv::Mat &P_pred, cv::Mat &P)
Method for updating the error covariance matrix describing the accuracy of the state estimate....
KalmanSensor(int n, int _m)
Constructor.
KalmanSensor(const KalmanSensor &k)
Copy constructor.
virtual void update_K(const cv::Mat &P_pred)
Method for updating the Kalman gain. This is called from predict_update() of Kalman.
Class for visualizing Kalman filter.
void update_post()
Update the visualization image - call this after the Kalman's predict_update.
void show()
Show the genrated visualization image.
~KalmanVisualize()
Destructor.
KalmanVisualize(KalmanCore *_kalman, KalmanSensorCore *_sensor)
Constructor for core Kalman implementation (not all visualizations possible)
void update_pre()
Update the visualization image - call this before the Kalman's predict_update.
KalmanVisualize(Kalman *_kalman, KalmanSensor *_sensor)
Constructor for full Kalman implementation.
static void out_matrix(const cv::Mat &m, char *name)
Helper method for outputting matrices (for debug purposes)