-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKalmanFilter.h
More file actions
40 lines (35 loc) · 911 Bytes
/
KalmanFilter.h
File metadata and controls
40 lines (35 loc) · 911 Bytes
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
33
34
35
36
37
38
39
40
#pragma once
#include <Eigen/Dense>
/**
* @brief Kalman filter
*
*/
class KalmanFilter
{
public:
KalmanFilter(int dim_x, int dim_y);
KalmanFilter();
/**
* @brief Predict the estimated state
*
*/
void predict();
/**
* @brief Update the estimated state
*
* @param z: measurement
*/
void update(const Eigen::VectorXd& z);
int dim_x, dim_z;
Eigen::VectorXd x; // state
Eigen::MatrixXd P; // uncertainty convariance
Eigen::MatrixXd Q; // process uncertainty
Eigen::MatrixXd F; // state transition matrix
Eigen::MatrixXd H; // Measurement function
Eigen::MatrixXd R; // state uncertainty
Eigen::MatrixXd M; // process-measurement cross correlation
Eigen::MatrixXd K; // kalman gain
Eigen::MatrixXd S; // system uncertainty
Eigen::MatrixXd SI; // inverse system uncertainty
Eigen::MatrixXd I;
};