-
Notifications
You must be signed in to change notification settings - Fork 1
/
KalmanFilterVA.h
74 lines (64 loc) · 1.78 KB
/
KalmanFilterVA.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
74
/*This is a Program h file for Kalman filtering*/
#ifndef KalmanFilterVA_h
#define KalmanFilterVA_h
#include "MatrixMath.h"
#include "math.h"
class KalmanFilterVA
{
public:
KalmanFilterVA();
~KalmanFilterVA();
unsigned long time;
int i;
float filterVal = 0.05;
float pi = 3.1415926;
float cosLat ;
int64_t Rearth ;
float RcovarianceMatrix[2][2] = {
{2.21017383364137, 3.51637078682249},
{3.51637078682249, 13.8032720993553},
};
float QcovarianceMatrix[4][4]= {
{0.01, 0, 0, 0 },
{0, 0.01, 0, 0 },
{0, 0, 0.001, 0 },
{0, 0, 0, 0.001},
};
float Hmatrix[2][4] = {
{1,0,0,0},
{0,1,0,0},
};
float HmatrixTranspose[4][2]= {
{1.0, 0.0},
{0.0, 1.0},
{0.0, 0.0},
{0.0, 0.0},
};
float PerrorCovariance[4][4]= {
{0.001, 0, 0, 0 },
{0, 0.001, 0, 0 },
{0, 0, 0.02, 0 },
{0, 0, 0, 0.02},
};
float delta_T = 0; //((float) (GPS_data[i][2] - GPS_data[i-1][2])) / 1000; //Time elapsed in seconds
float data[2]={0,0}; //{(float) (GPS_data[i][0]-GPS_data[0][0])*pi/180*Rearth/10000000,(float) (GPS_data[i][1]-GPS_data[0][1])*pi/180*Rearth*cosLat/10000000};
float Xstate[4][1] = {
{data[0]},
{data[1]},
{0.0 },
{0.0 },
};
int64_t GPS_data[1][3] = {
{0,0,0},
};
int64_t prevGPS_data[1][3] = {
{0,0,0},
};
int64_t firstGPS_data[1][3] = {
{0,0,0},
};
int64_t* KalmanProcessing(int64_t lat, int64_t lon);
int64_t* KalmanNoData();
private:
};
#endif