-
Notifications
You must be signed in to change notification settings - Fork 15
/
KalmanFilter.h
73 lines (57 loc) · 1.84 KB
/
KalmanFilter.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
63
64
65
66
67
68
69
70
71
72
73
/***************************************************************************
* *
* Copyright (C) 2017 by University of Illinois *
* *
* http://illinois.edu *
* *
***************************************************************************/
/**
* @file KalmanFilter.h
*
* A linear KalmanFilter aims to recover latent velocity variables based on
* Vicon position measurement.
*
* @author Bo Liu <[email protected]>
*
*/
#ifndef KALMANFILTER_H
#define KALMANFILTER_H
#include <QObject>
#include "eigen3/Eigen/Dense"
#include <cmath>
class KalmanFilter : public QObject
{
Q_OBJECT
public:
explicit KalmanFilter(QObject *parent = 0);
// 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_;
void update_dt(double dt);
/**
* Init Initializes Kalman filter
* @param x_in Initial state
* @param P_in Initial state covariance
* @param F_in Transition matrix
* @param H_in Measurement matrix
* @param R_in Measurement covariance matrix
* @param Q_in Process covariance matrix
*/
void init(Eigen::VectorXd &x_in, Eigen::MatrixXd &P_in, Eigen::MatrixXd &F_in,
Eigen::MatrixXd &Q_in, Eigen::MatrixXd &H_in, Eigen::MatrixXd &R_in);
void predict();
void update(const Eigen::VectorXd & z);
double dt;
signals:
public slots:
};
#endif // KALMANFILTER_H