-
Notifications
You must be signed in to change notification settings - Fork 9
/
main.cpp
98 lines (85 loc) · 2.75 KB
/
main.cpp
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#include "Rinex.h"
#include "Ephemeris.h"
#include "Receiver.h"
using namespace std;
int numiterator = 0;
int debug_stop =1;
//int main(int argc, char ** argv) {
// int n = 18;
// int m = 2;
// Eigen::MatrixXd Q = Eigen::MatrixXd::Zero(n,n);
// Eigen::VectorXd a = Eigen::VectorXd::Zero(n);
// Eigen::MatrixXd b = Eigen::MatrixXd::Zero(n, m);
// filetovector(a,n,"a");
// filetomatrix(Q,n,n,"Q");
// //matrixtofile(Q,"Qtest",'F');
// int info = 0;
// vector<double> s(2,0);
// info = lambda(n, m, a, Q, b, s);
// int aaaa = 1;
//
//}
int main(int argc,char ** argv){
string navfile = "D:\\SHMILY\\340_RTK\\RTK_CPP\\data\\base.nav";
string Bobsfile = "D:\\SHMILY\\340_RTK\\RTK_CPP\\data\\base.obs";
//string Robsfile = "D:\\SHMILY\\340_RTK\\RTK_CPP\\data\\base1.obs";
string Robsfile = "D:\\SHMILY\\340_RTK\\RTK_CPP\\data\\rover.obs";
NAV_RINEX nav(navfile);
nav.readfile();
//All_Sats_EPH allsateph(nav);
//allsateph.satephsolve(nav);
OBS_RINEX obs(Bobsfile, Robsfile);
receiver rcv(nav,1,0,"1");//dynamics_on arfilter outsolfile
gtime_t headtime = obs.readheader();
gtime_t LASTsoltime;
int LS_stat = 0;
if (headtime.time == 0)//找不到headtime,不往下进行。
return 1;
string buffB,buffR;
/*ifstream obsfileB(Bobsfile);
ifstream obsfileR(Robsfile);
obs.findfirstepoch(obsfileB, obsfileR, buffB, buffR, headtime);
do {
obs.readepoch(obsfileB, obsfileR, buffB, buffR, headtime);
obs.getdoppler();
} while (getline(obsfileB, buffB) && getline(obsfileR, buffR));
obs.printfdoppler();*/
/*原始程序*/
ifstream obsfileB(Bobsfile);
ifstream obsfileR(Robsfile);
//double nba;
//cout << sizeof(&nba) << endl;
obs.findfirstepoch(obsfileB, obsfileR,buffB,buffR,headtime);//此处已经找到了和rover第一个历元对应的base的时间
do {
/*obs.readepoch(obsfileB, obsfileR,buffB,buffR);
rcv.updateobs(obs);*/
if (!screent_obs(obsfileB, obsfileR, buffB, buffR, rcv, obs))
continue;
numiterator++;
cout << "numiterator:"<< numiterator << endl;
if (numiterator >= debug_stop) {
int aaaa = 1;
}
rcv.updateSatinfo();
/*if (obs.GPStime_R.time == 1614221810) {
int a = 1;
}*/
LASTsoltime = rcv.getsoltime();
LS_stat = rcv.LS_pos('N');//最小二乘定位
rcv.settt(LASTsoltime);
if (LS_stat) {
rcv.LS_vel();//最小二乘定速,只有在最小二乘定位成功时才进行。
}
rcv.RTK_pos("PL");//不管最小二乘定位成不成功,都要进行RTK的更新
/*if (numiterator == debug_stop) {
int aaaa = 1;
}*/
/*if (numiterator >= 147)
break;*/
rcv.soltofile("xyz",LS_stat);
} while (getline(obsfileB, buffB) && getline(obsfileR, buffR));//readepoch中的getepochdata向下推进了obsfileB
//obsfileB.close();
//obsfileR.close();
rcv.closefile();
return 0;
}