-
Notifications
You must be signed in to change notification settings - Fork 0
/
kalman_filter.h
62 lines (44 loc) · 1021 Bytes
/
kalman_filter.h
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef KALMAN_FILTER_H_
#define KALMAN_FILTER_H_
#include "Eigen/Dense"
// #include "Eigen"
#include "measurement_package.h"
class KalmanFilter
{
public:
double dt = 0.1;
bool is_initialized_;
long long previous_timestamp_;
// state vector
Eigen::VectorXd x_;
// state covariance matrix
Eigen::MatrixXd P_;
// state transition matrix
Eigen::MatrixXd F_;
// process covariance matrix
Eigen::MatrixXd Q_;
// measurement matrix
Eigen::MatrixXd H_;
// measurement covariance matrix
Eigen::MatrixXd R_;
/**
* Constructor
*/
KalmanFilter();
/**
* Destructor
*/
virtual ~KalmanFilter();
/**
* Prediction Predicts the state and the state covariance
* using the process model
*/
void Predict();
/**
* Updates the state by using standard Kalman Filter equations
* @param z The measurement at k+1
*/
void Update(const Eigen::VectorXd &z);
void perform_kf(const MeasurementPackage &measurement_pack);
};
#endif /* KALMAN_FILTER_H_ */