Skip to content

Commit ace1231

Browse files
committed
GNSS solve ambiguities on ref point
1 parent a567d2a commit ace1231

File tree

3 files changed

+68
-15
lines changed

3 files changed

+68
-15
lines changed

src/Yann/ExcludeSats.cpp

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,6 +1092,9 @@ cAppli_YannSkyMask::cAppli_YannSkyMask(int argc, char ** argv){
10921092
// Down-grading h5py to earlier version
10931093
System("pip install 'h5py==2.10.0' --force-reinstall");
10941094

1095+
// Down-grading protobuf version
1096+
System("pip install 'protobuf~=3.19.0'");
1097+
10951098
return;
10961099

10971100
}
@@ -1188,25 +1191,28 @@ cAppli_YannScript::cAppli_YannScript(int argc, char ** argv){
11881191
LArgMain() << EAM(mOut,"Ref", "file.o", "Rinex base station observation file"));
11891192

11901193

1191-
ObservationData rover = RinexReader::readObsFile(ImPattern);
1192-
ObservationData base = RinexReader::readObsFile(mOut);
1194+
ObservationData rov = RinexReader::readObsFile(ImPattern);
1195+
ObservationData bas = RinexReader::readObsFile(mOut);
11931196
NavigationData nav = RinexReader::readNavFile(aPostIn);
11941197

1195-
rover.removeSatellite("G24");
1196-
base.removeSatellite("G24");
1197-
base.removeSatellite("G10");
1198-
base.removeSatellite("G19");
1199-
1200-
NavigationDataSet eph = NavigationDataSet();
1201-
eph.addGpsEphemeris(nav);
1202-
1203-
Solution solution = Algorithms::triple_difference_kalman(rover, base, eph, base.getApproxAntennaPosition());
1198+
ObservationSlot slot = rov.getObservationSlots().at(0);
1199+
GPSTime time = slot.getTimestamp();
1200+
1201+
std::vector<std::string> SATS = slot.getSatellites();
1202+
1203+
std::string sat1 = "G16";
12041204

1205-
std::cout << "------------------------------------------------------------------------------" << std::endl;
1206-
std::cout << rover.getApproxAntennaPosition() << std::endl;
1207-
std::cout << solution.getPosition() - rover.getApproxAntennaPosition() << std::endl;
1208-
std::cout << "------------------------------------------------------------------------------" << std::endl;
12091205

1206+
std::cout << std::endl;
1207+
std::cout << "-----------------------------" << std::endl;
1208+
1209+
for (unsigned i=0; i<SATS.size(); i++){
1210+
std::string sat2 = SATS.at(i);
1211+
double N = Algorithms::solve_ambiguity_ref(rov, bas, nav, time, sat1, sat2);
1212+
std::cout << "DD " << sat1 << "-" << sat2 << " " << N << std::endl;
1213+
}
1214+
1215+
std::cout << "-----------------------------" << std::endl;
12101216

12111217
/*
12121218
std::string prn;

src/Yann/gnss/Algorithms.cpp

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,3 +880,49 @@ Solution Algorithms::triple_difference_kalman(ObservationData rover,
880880
return solution;
881881

882882
}
883+
884+
// -------------------------------------------------------------------------------
885+
// Algorithme de résolution des ambiüités sur une époque où la position de la
886+
// station mobile (et de la station de base) sont connues exactement.
887+
// -------------------------------------------------------------------------------
888+
double Algorithms::solve_ambiguity_ref(ObservationData rov, ObservationData bas, NavigationData nav, GPSTime time, std::string sat1, std::string sat2){
889+
890+
891+
double L1 = Utils::C/L1_FREQ;
892+
893+
ECEFCoords pos_r = rov.getApproxAntennaPosition();
894+
ECEFCoords pos_b = bas.getApproxAntennaPosition();
895+
896+
ObservationSlot slot_b = bas.lookForEpoch(time);
897+
ObservationSlot slot_r = rov.lookForEpoch(time);
898+
899+
double diff_b = slot_b.getTimestamp()-time;
900+
double diff_r = slot_r.getTimestamp()-time;
901+
902+
if (diff_b != 0){
903+
std::cout << "Warning: base station not synchronized. Time diff = " << diff_b*1e6 << " us" << std::endl;
904+
}
905+
if (diff_r != 0){
906+
std::cout << "Warning: rover station not synchronized. Time diff = " << diff_b*1e6 << " us" << std::endl;
907+
}
908+
909+
// Observations
910+
double C1b = slot_b.getObservation(sat1).getC1(); double L1b = slot_b.getObservation(sat1).getL1();
911+
double C2b = slot_b.getObservation(sat2).getC1(); double L2b = slot_b.getObservation(sat2).getL1();
912+
double C1r = slot_r.getObservation(sat1).getC1(); double L1r = slot_r.getObservation(sat1).getL1();
913+
double C2r = slot_r.getObservation(sat2).getC1(); double L2r = slot_r.getObservation(sat2).getL1();
914+
915+
// Positions et distances théoriques
916+
ECEFCoords pos_sat1b = nav.computeSatellitePos(sat1, slot_b.getTimestamp(), C1b); double D1b = pos_b.distanceTo(pos_sat1b);
917+
ECEFCoords pos_sat2b = nav.computeSatellitePos(sat2, slot_b.getTimestamp(), C2b); double D2b = pos_b.distanceTo(pos_sat2b);
918+
ECEFCoords pos_sat1r = nav.computeSatellitePos(sat1, slot_r.getTimestamp(), C1r); double D1r = pos_r.distanceTo(pos_sat1r);
919+
ECEFCoords pos_sat2r = nav.computeSatellitePos(sat2, slot_r.getTimestamp(), C2r); double D2r = pos_r.distanceTo(pos_sat2r);
920+
921+
// Doubles différences observées et théoriques
922+
double dd_obs = (L1b - L2b) - (L1r - L2r);
923+
double dd_thq = ((D1b - D2b) - (D1r - D2r))/L1;
924+
925+
// Résolution de l'ambigüité entière
926+
return dd_obs - dd_thq;
927+
928+
}

src/Yann/gnss/Algorithms.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class Algorithms{
4545
static Trajectory estimateTrajectory(ObservationData, NavigationData);
4646

4747
// Calcul de la position par la phase
48+
static double solve_ambiguity_ref(ObservationData rov, ObservationData bas, NavigationData nav, GPSTime time, std::string sat1, std::string sat2);
4849
static Solution triple_difference_kalman(ObservationData, ObservationData, NavigationDataSet, ECEFCoords);
4950
static ElMatrix<REAL> makeTripleDifferenceMatrix(int, int);
5051

0 commit comments

Comments
 (0)