-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGPSKalman.h
74 lines (70 loc) · 1.92 KB
/
GPSKalman.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
//---------------------------------------------------------------------------
#ifndef GPSKalmanH
#define GPSKalmanH
//---------------------------------------------------------------------------
#include "newmat\\newmat.h"
// Q << R - ñèëüíàÿ ôèëüòðàöèÿ è èíåðöèîííîñòü
// Q ~ R - ñëàáàÿ ôèëüòðàöèÿ, íåò èñêàæåíèé À×Õ
class GPSKalman2D
{
public:
__fastcall GPSKalman2D();
__fastcall ~GPSKalman2D();
void __fastcall Reset();
void __fastcall Filter(double dTime, double & dLat, double & dLon,
double & dSpeed, double & dCourse, double & dAlt, double & dAltSpeed);
__property double R = { write=SetR };
__property double Sigma2 = { write=SetSigma2 };
__property double AltSigma = { write=SetAltSigma };
__property bool FilterAlt = { write=SetFilterAlt };
protected:
double m_dSigma;
double m_dAltSigma;
double m_dX;
double m_dY;
double m_dA;
double m_dVx;
double m_dVy;
double m_dVa;
double m_dAx;
double m_dAy;
double m_dAa;
double m_dTime;
Matrix m_mF;
Matrix m_mB;
Matrix m_mP;
Matrix m_mR;
Matrix m_mQ;
Matrix m_mI;
Matrix m_mH;
ColumnVector m_vX;
Matrix m_mFs;
Matrix m_mBs;
Matrix m_mPs;
Matrix m_mRs;
Matrix m_mQs;
Matrix m_mIs;
Matrix m_mHs;
ColumnVector m_vXs;
Matrix m_mFa;
Matrix m_mBa;
Matrix m_mPa;
Matrix m_mRa;
Matrix m_mQa;
Matrix m_mIa;
Matrix m_mHa;
ColumnVector m_vXa;
bool m_bFirstPoint;
bool m_bFilterAlt;
void __fastcall Predict(double dTime);
void __fastcall SetData(double dTime, double dX, double dY, double dSpeed, double dCourse,
double dAlt, double dAltSpeed);
void __fastcall Update(double dX, double dY, double dSpeed, double dCourse,
double dAlt, double dAltSpeed);
private:
void __fastcall SetR(double val);
void __fastcall SetSigma2(double value);
void __fastcall SetAltSigma(double value);
void __fastcall SetFilterAlt(bool value);
};
#endif