-
Notifications
You must be signed in to change notification settings - Fork 2
/
ekf.h
49 lines (37 loc) · 965 Bytes
/
ekf.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
#ifndef EKF_H_
#define EKF_H_
#include "libs/Eigen/Dense"
#include "utility.h"
class ExtendedKalmanFilter {
public:
// state vector
Eigen::VectorXd x_;
// state covariance matrix
Eigen::MatrixXd P_;
// state transistion matrix
Eigen::MatrixXd F_;
// process covariance matrix
Eigen::MatrixXd Q_;
// measurement matrix
Eigen::MatrixXd H_;
// measurement covariance matrix
Eigen::MatrixXd R_;
//4x4 Identity matrix we will need later.
Eigen::MatrixXd I_;
/**
* Prediction Predicts the state and the state covariance
* using the process model
* @param delta_T Time between k and k+1 in s
*/
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 UpdateEkf(const Eigen::VectorXd &z);
private:
//Keep things DRY
void CallRestOfUpdate(const Eigen::VectorXd &z);
};
#endif