mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-16 04:05:46 +00:00
Prints fake IODE and IODC in GPS L2C-only RINEX navigation files
IODE and IODC are not defined in CNAV. If set to zero, tools such as RTKLIB are not able to compute position. With this commit, we write a fake value that changes whenever Toe in message types 10 and 11, and Toc in types 30-37, do not match.
This commit is contained in:
parent
785d0d935d
commit
cec063f360
@ -187,6 +187,7 @@ Rinex_Printer::Rinex_Printer(int conf_version)
|
|||||||
}
|
}
|
||||||
|
|
||||||
numberTypesObservations = 4; // Number of available types of observable in the system
|
numberTypesObservations = 4; // Number of available types of observable in the system
|
||||||
|
fake_cnav_iode = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1897,9 +1898,17 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_CNAV
|
|||||||
// -------- BROADCAST ORBIT - 1
|
// -------- BROADCAST ORBIT - 1
|
||||||
line.clear();
|
line.clear();
|
||||||
line += std::string(5, ' ');
|
line += std::string(5, ' ');
|
||||||
// If there is no IODE in CNAV, so we set it to zero
|
// If there is no IODE in CNAV, so we check if Toe in message Type 10, Toe in Message type 11 and Toc in message types 30-37.
|
||||||
double my_zero = 0.0;
|
// Whenever these three terms do not match, a data set cutover has occurred and new data must be collected.
|
||||||
line += Rinex_Printer::doub2for(my_zero, 18, 2);
|
// See IS-GPS-200H, p. 155
|
||||||
|
if ( !((gps_ephemeris_iter->second.d_Toe1 == gps_ephemeris_iter->second.d_Toe2) && (gps_ephemeris_iter->second.d_Toe1 == gps_ephemeris_iter->second.d_Toc)) ) // Toe1: Toe in message type 10, Toe2: Toe in message type 11
|
||||||
|
{
|
||||||
|
// Toe1: Toe in message type 10, Toe2: Toe in message type 11,
|
||||||
|
fake_cnav_iode = fake_cnav_iode + 1;
|
||||||
|
if(fake_cnav_iode == 240) fake_cnav_iode = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
line += Rinex_Printer::doub2for(fake_cnav_iode, 18, 2);
|
||||||
line += std::string(1, ' ');
|
line += std::string(1, ' ');
|
||||||
line += Rinex_Printer::doub2for(gps_ephemeris_iter->second.d_Crs, 18, 2);
|
line += Rinex_Printer::doub2for(gps_ephemeris_iter->second.d_Crs, 18, 2);
|
||||||
line += std::string(1, ' ');
|
line += std::string(1, ' ');
|
||||||
@ -1962,6 +1971,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_CNAV
|
|||||||
line += Rinex_Printer::doub2for(gps_ephemeris_iter->second.d_IDOT, 18, 2);
|
line += Rinex_Printer::doub2for(gps_ephemeris_iter->second.d_IDOT, 18, 2);
|
||||||
line += std::string(1, ' ');
|
line += std::string(1, ' ');
|
||||||
// No data flag for L2 P code
|
// No data flag for L2 P code
|
||||||
|
double my_zero = 0.0;
|
||||||
line += Rinex_Printer::doub2for(my_zero, 18, 2);
|
line += Rinex_Printer::doub2for(my_zero, 18, 2);
|
||||||
line += std::string(1, ' ');
|
line += std::string(1, ' ');
|
||||||
double GPS_week_continuous_number = static_cast<double>(gps_ephemeris_iter->second.i_GPS_week + 1024); // valid until April 7, 2019 (check http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm)
|
double GPS_week_continuous_number = static_cast<double>(gps_ephemeris_iter->second.i_GPS_week + 1024); // valid until April 7, 2019 (check http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm)
|
||||||
@ -1981,8 +1991,8 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_CNAV
|
|||||||
line += std::string(1, ' ');
|
line += std::string(1, ' ');
|
||||||
line += Rinex_Printer::doub2for(gps_ephemeris_iter->second.d_TGD, 18, 2);
|
line += Rinex_Printer::doub2for(gps_ephemeris_iter->second.d_TGD, 18, 2);
|
||||||
line += std::string(1, ' ');
|
line += std::string(1, ' ');
|
||||||
// no IODC in CNAV, so we set it to zero
|
// no IODC in CNAV, so we fake it (see above)
|
||||||
line += Rinex_Printer::doub2for(my_zero, 18, 2);
|
line += Rinex_Printer::doub2for(fake_cnav_iode, 18, 2);
|
||||||
Rinex_Printer::lengthCheck(line);
|
Rinex_Printer::lengthCheck(line);
|
||||||
out << line << std::endl;
|
out << line << std::endl;
|
||||||
|
|
||||||
|
@ -277,6 +277,8 @@ private:
|
|||||||
*/
|
*/
|
||||||
void lengthCheck(const std::string & line);
|
void lengthCheck(const std::string & line);
|
||||||
|
|
||||||
|
double fake_cnav_iode;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the string is bigger than length, truncate it from the right.
|
* If the string is bigger than length, truncate it from the right.
|
||||||
* otherwise, add pad characters to its right.
|
* otherwise, add pad characters to its right.
|
||||||
|
Loading…
Reference in New Issue
Block a user