mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-15 04:30:33 +00:00
Merge remote-tracking branch 'origin/next' into gps_galileo_hybrid
Conflicts: src/algorithms/PVT/libs/kml_printer.h src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc
This commit is contained in:
commit
54147b519a
@ -73,17 +73,17 @@ galileo_e1_pvt_cc::galileo_e1_pvt_cc(unsigned int nchannels, boost::shared_ptr<g
|
|||||||
std::string kml_dump_filename;
|
std::string kml_dump_filename;
|
||||||
kml_dump_filename = d_dump_filename;
|
kml_dump_filename = d_dump_filename;
|
||||||
kml_dump_filename.append(".kml");
|
kml_dump_filename.append(".kml");
|
||||||
d_kml_dump.set_headers(kml_dump_filename);
|
d_kml_dump = std::make_shared<Kml_Printer>();
|
||||||
|
d_kml_dump->set_headers(kml_dump_filename);
|
||||||
|
|
||||||
//initialize nmea_printer
|
//initialize nmea_printer
|
||||||
d_nmea_printer = new Nmea_Printer(nmea_dump_filename, flag_nmea_tty_port, nmea_dump_devname);
|
d_nmea_printer = std::make_shared<Nmea_Printer>(nmea_dump_filename, flag_nmea_tty_port, nmea_dump_devname);
|
||||||
|
|
||||||
d_dump_filename.append("_raw.dat");
|
d_dump_filename.append("_raw.dat");
|
||||||
dump_ls_pvt_filename.append("_ls_pvt.dat");
|
dump_ls_pvt_filename.append("_ls_pvt.dat");
|
||||||
d_averaging_depth = averaging_depth;
|
d_averaging_depth = averaging_depth;
|
||||||
d_flag_averaging = flag_averaging;
|
d_flag_averaging = flag_averaging;
|
||||||
|
|
||||||
d_ls_pvt = new galileo_e1_ls_pvt(nchannels, dump_ls_pvt_filename, d_dump);
|
d_ls_pvt = std::make_shared<galileo_e1_ls_pvt>(nchannels, dump_ls_pvt_filename, d_dump);
|
||||||
d_ls_pvt->set_averaging_depth(d_averaging_depth);
|
d_ls_pvt->set_averaging_depth(d_averaging_depth);
|
||||||
|
|
||||||
d_sample_counter = 0;
|
d_sample_counter = 0;
|
||||||
@ -91,7 +91,7 @@ galileo_e1_pvt_cc::galileo_e1_pvt_cc(unsigned int nchannels, boost::shared_ptr<g
|
|||||||
d_rx_time = 0.0;
|
d_rx_time = 0.0;
|
||||||
|
|
||||||
b_rinex_header_writen = false;
|
b_rinex_header_writen = false;
|
||||||
rp = new Rinex_Printer();
|
rp = std::make_shared<Rinex_Printer>();
|
||||||
|
|
||||||
// ############# ENABLE DATA FILE LOG #################
|
// ############# ENABLE DATA FILE LOG #################
|
||||||
if (d_dump == true)
|
if (d_dump == true)
|
||||||
@ -115,12 +115,7 @@ galileo_e1_pvt_cc::galileo_e1_pvt_cc(unsigned int nchannels, boost::shared_ptr<g
|
|||||||
|
|
||||||
|
|
||||||
galileo_e1_pvt_cc::~galileo_e1_pvt_cc()
|
galileo_e1_pvt_cc::~galileo_e1_pvt_cc()
|
||||||
{
|
{}
|
||||||
d_kml_dump.close_file();
|
|
||||||
delete d_ls_pvt;
|
|
||||||
delete rp;
|
|
||||||
delete d_nmea_printer;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -180,37 +175,37 @@ int galileo_e1_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_it
|
|||||||
|
|
||||||
if (pvt_result == true)
|
if (pvt_result == true)
|
||||||
{
|
{
|
||||||
d_kml_dump.print_position_galileo(d_ls_pvt, d_flag_averaging);
|
d_kml_dump->print_position_galileo(d_ls_pvt, d_flag_averaging);
|
||||||
//ToDo: Implement Galileo RINEX and Galileo NMEA outputs
|
//ToDo: Implement Galileo RINEX and Galileo NMEA outputs
|
||||||
// d_nmea_printer->Print_Nmea_Line(d_ls_pvt, d_flag_averaging);
|
// d_nmea_printer->Print_Nmea_Line(d_ls_pvt, d_flag_averaging);
|
||||||
//
|
//
|
||||||
// if (!b_rinex_header_writen) // & we have utc data in nav message!
|
if (!b_rinex_header_writen) // & we have utc data in nav message!
|
||||||
// {
|
{
|
||||||
// std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter;
|
std::map<int,Galileo_Ephemeris>::iterator galileo_ephemeris_iter;
|
||||||
// gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
|
galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin();
|
||||||
// if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
|
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
|
||||||
// {
|
{
|
||||||
// rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second,d_rx_time);
|
rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time);
|
||||||
// rp->rinex_nav_header(rp->navFile,d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
|
rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
|
||||||
// b_rinex_header_writen = true; // do not write header anymore
|
b_rinex_header_writen = true; // do not write header anymore
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// if(b_rinex_header_writen) // Put here another condition to separate annotations (e.g 30 s)
|
if(b_rinex_header_writen) // Put here another condition to separate annotations (e.g 30 s)
|
||||||
// {
|
{
|
||||||
// // Limit the RINEX navigation output rate to 1/6 seg
|
// Limit the RINEX navigation output rate to 1/6 seg
|
||||||
// // Notice that d_sample_counter period is 1ms (for GPS correlators)
|
// Notice that d_sample_counter period is 4ms (for Galileo correlators)
|
||||||
// if ((d_sample_counter-d_last_sample_nav_output)>=6000)
|
if ((d_sample_counter - d_last_sample_nav_output) >= 6000)
|
||||||
// {
|
{
|
||||||
// rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map);
|
rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map);
|
||||||
// d_last_sample_nav_output=d_sample_counter;
|
d_last_sample_nav_output = d_sample_counter;
|
||||||
// }
|
}
|
||||||
// std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter;
|
std::map<int, Galileo_Ephemeris>::iterator galileo_ephemeris_iter;
|
||||||
// gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
|
galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin();
|
||||||
// if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
|
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
|
||||||
// {
|
{
|
||||||
// rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, d_rx_time, gnss_pseudoranges_map);
|
rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_pseudoranges_map);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ private:
|
|||||||
boost::shared_ptr<gr::msg_queue> d_queue;
|
boost::shared_ptr<gr::msg_queue> d_queue;
|
||||||
bool d_dump;
|
bool d_dump;
|
||||||
bool b_rinex_header_writen;
|
bool b_rinex_header_writen;
|
||||||
Rinex_Printer *rp;
|
std::shared_ptr<Rinex_Printer> rp;
|
||||||
unsigned int d_nchannels;
|
unsigned int d_nchannels;
|
||||||
std::string d_dump_filename;
|
std::string d_dump_filename;
|
||||||
std::ofstream d_dump_file;
|
std::ofstream d_dump_file;
|
||||||
@ -106,10 +106,10 @@ private:
|
|||||||
int d_display_rate_ms;
|
int d_display_rate_ms;
|
||||||
long unsigned int d_sample_counter;
|
long unsigned int d_sample_counter;
|
||||||
long unsigned int d_last_sample_nav_output;
|
long unsigned int d_last_sample_nav_output;
|
||||||
Kml_Printer d_kml_dump;
|
std::shared_ptr<Kml_Printer> d_kml_dump;
|
||||||
Nmea_Printer *d_nmea_printer;
|
std::shared_ptr<Nmea_Printer> d_nmea_printer;
|
||||||
double d_rx_time;
|
double d_rx_time;
|
||||||
galileo_e1_ls_pvt *d_ls_pvt;
|
std::shared_ptr<galileo_e1_ls_pvt> d_ls_pvt;
|
||||||
bool pseudoranges_pairCompare_min(std::pair<int,Gnss_Synchro> a, std::pair<int,Gnss_Synchro> b);
|
bool pseudoranges_pairCompare_min(std::pair<int,Gnss_Synchro> a, std::pair<int,Gnss_Synchro> b);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -87,17 +87,18 @@ gps_l1_ca_pvt_cc::gps_l1_ca_pvt_cc(unsigned int nchannels,
|
|||||||
std::string kml_dump_filename;
|
std::string kml_dump_filename;
|
||||||
kml_dump_filename = d_dump_filename;
|
kml_dump_filename = d_dump_filename;
|
||||||
kml_dump_filename.append(".kml");
|
kml_dump_filename.append(".kml");
|
||||||
d_kml_dump.set_headers(kml_dump_filename);
|
d_kml_dump = std::make_shared<Kml_Printer>();
|
||||||
|
d_kml_dump->set_headers(kml_dump_filename);
|
||||||
|
|
||||||
//initialize nmea_printer
|
//initialize nmea_printer
|
||||||
d_nmea_printer = new Nmea_Printer(nmea_dump_filename, flag_nmea_tty_port, nmea_dump_devname);
|
d_nmea_printer = std::make_shared<Nmea_Printer>(nmea_dump_filename, flag_nmea_tty_port, nmea_dump_devname);
|
||||||
|
|
||||||
d_dump_filename.append("_raw.dat");
|
d_dump_filename.append("_raw.dat");
|
||||||
dump_ls_pvt_filename.append("_ls_pvt.dat");
|
dump_ls_pvt_filename.append("_ls_pvt.dat");
|
||||||
d_averaging_depth = averaging_depth;
|
d_averaging_depth = averaging_depth;
|
||||||
d_flag_averaging = flag_averaging;
|
d_flag_averaging = flag_averaging;
|
||||||
|
|
||||||
d_ls_pvt = new gps_l1_ca_ls_pvt(nchannels,dump_ls_pvt_filename,d_dump);
|
d_ls_pvt = std::make_shared<gps_l1_ca_ls_pvt>((int)nchannels, dump_ls_pvt_filename, d_dump);
|
||||||
d_ls_pvt->set_averaging_depth(d_averaging_depth);
|
d_ls_pvt->set_averaging_depth(d_averaging_depth);
|
||||||
|
|
||||||
d_sample_counter = 0;
|
d_sample_counter = 0;
|
||||||
@ -106,7 +107,7 @@ gps_l1_ca_pvt_cc::gps_l1_ca_pvt_cc(unsigned int nchannels,
|
|||||||
|
|
||||||
b_rinex_header_writen = false;
|
b_rinex_header_writen = false;
|
||||||
b_rinex_sbs_header_writen = false;
|
b_rinex_sbs_header_writen = false;
|
||||||
rp = new Rinex_Printer();
|
rp = std::make_shared<Rinex_Printer>();
|
||||||
|
|
||||||
// ############# ENABLE DATA FILE LOG #################
|
// ############# ENABLE DATA FILE LOG #################
|
||||||
if (d_dump == true)
|
if (d_dump == true)
|
||||||
@ -130,12 +131,7 @@ gps_l1_ca_pvt_cc::gps_l1_ca_pvt_cc(unsigned int nchannels,
|
|||||||
|
|
||||||
|
|
||||||
gps_l1_ca_pvt_cc::~gps_l1_ca_pvt_cc()
|
gps_l1_ca_pvt_cc::~gps_l1_ca_pvt_cc()
|
||||||
{
|
{}
|
||||||
d_kml_dump.close_file();
|
|
||||||
delete d_ls_pvt;
|
|
||||||
delete rp;
|
|
||||||
delete d_nmea_printer;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -237,7 +233,7 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_ite
|
|||||||
pvt_result = d_ls_pvt->get_PVT(gnss_pseudoranges_map, d_rx_time, d_flag_averaging);
|
pvt_result = d_ls_pvt->get_PVT(gnss_pseudoranges_map, d_rx_time, d_flag_averaging);
|
||||||
if (pvt_result == true)
|
if (pvt_result == true)
|
||||||
{
|
{
|
||||||
d_kml_dump.print_position(d_ls_pvt, d_flag_averaging);
|
d_kml_dump->print_position(d_ls_pvt, d_flag_averaging);
|
||||||
d_nmea_printer->Print_Nmea_Line(d_ls_pvt, d_flag_averaging);
|
d_nmea_printer->Print_Nmea_Line(d_ls_pvt, d_flag_averaging);
|
||||||
|
|
||||||
if (!b_rinex_header_writen) // & we have utc data in nav message!
|
if (!b_rinex_header_writen) // & we have utc data in nav message!
|
||||||
|
@ -96,7 +96,7 @@ private:
|
|||||||
bool d_dump;
|
bool d_dump;
|
||||||
bool b_rinex_header_writen;
|
bool b_rinex_header_writen;
|
||||||
bool b_rinex_sbs_header_writen;
|
bool b_rinex_sbs_header_writen;
|
||||||
Rinex_Printer *rp;
|
std::shared_ptr<Rinex_Printer> rp;
|
||||||
unsigned int d_nchannels;
|
unsigned int d_nchannels;
|
||||||
std::string d_dump_filename;
|
std::string d_dump_filename;
|
||||||
std::ofstream d_dump_file;
|
std::ofstream d_dump_file;
|
||||||
@ -106,10 +106,10 @@ private:
|
|||||||
int d_display_rate_ms;
|
int d_display_rate_ms;
|
||||||
long unsigned int d_sample_counter;
|
long unsigned int d_sample_counter;
|
||||||
long unsigned int d_last_sample_nav_output;
|
long unsigned int d_last_sample_nav_output;
|
||||||
Kml_Printer d_kml_dump;
|
std::shared_ptr<Kml_Printer> d_kml_dump;
|
||||||
Nmea_Printer *d_nmea_printer;
|
std::shared_ptr<Nmea_Printer> d_nmea_printer;
|
||||||
double d_rx_time;
|
double d_rx_time;
|
||||||
gps_l1_ca_ls_pvt *d_ls_pvt;
|
std::shared_ptr<gps_l1_ca_ls_pvt> d_ls_pvt;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
~gps_l1_ca_pvt_cc (); //!< Default destructor
|
~gps_l1_ca_pvt_cc (); //!< Default destructor
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
# along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
# along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
add_definitions( -DGNSS_SDR_VERSION="${VERSION}" )
|
||||||
|
|
||||||
set(PVT_LIB_SOURCES
|
set(PVT_LIB_SOURCES
|
||||||
gps_l1_ca_ls_pvt.cc
|
gps_l1_ca_ls_pvt.cc
|
||||||
galileo_e1_ls_pvt.cc
|
galileo_e1_ls_pvt.cc
|
||||||
|
@ -82,22 +82,25 @@ bool Kml_Printer::set_headers(std::string filename)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool Kml_Printer::print_position(gps_l1_ca_ls_pvt* position,bool print_average_values)
|
bool Kml_Printer::print_position(const std::shared_ptr<gps_l1_ca_ls_pvt>& position, bool print_average_values)
|
||||||
{
|
{
|
||||||
double latitude;
|
double latitude;
|
||||||
double longitude;
|
double longitude;
|
||||||
double height;
|
double height;
|
||||||
|
|
||||||
|
std::shared_ptr<gps_l1_ca_ls_pvt> position_ = position;
|
||||||
|
|
||||||
if (print_average_values == false)
|
if (print_average_values == false)
|
||||||
{
|
{
|
||||||
latitude = position->d_latitude_d;
|
latitude = position_->d_latitude_d;
|
||||||
longitude = position->d_longitude_d;
|
longitude = position_->d_longitude_d;
|
||||||
height = position->d_height_m;
|
height = position_->d_height_m;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
latitude = position->d_avg_latitude_d;
|
latitude = position_->d_avg_latitude_d;
|
||||||
longitude = position->d_avg_longitude_d;
|
longitude = position_->d_avg_longitude_d;
|
||||||
height = position->d_avg_height_m;
|
height = position_->d_avg_height_m;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kml_file.is_open())
|
if (kml_file.is_open())
|
||||||
@ -113,22 +116,23 @@ bool Kml_Printer::print_position(gps_l1_ca_ls_pvt* position,bool print_average_v
|
|||||||
|
|
||||||
//ToDo: make the class ls_pvt generic and heritate the particular gps/gal/glo ls_pvt in order to
|
//ToDo: make the class ls_pvt generic and heritate the particular gps/gal/glo ls_pvt in order to
|
||||||
// reuse kml_printer functions
|
// reuse kml_printer functions
|
||||||
bool Kml_Printer::print_position_galileo(galileo_e1_ls_pvt* position,bool print_average_values)
|
bool Kml_Printer::print_position_galileo(const std::shared_ptr<galileo_e1_ls_pvt>& position, bool print_average_values)
|
||||||
{
|
{
|
||||||
double latitude;
|
double latitude;
|
||||||
double longitude;
|
double longitude;
|
||||||
double height;
|
double height;
|
||||||
|
std::shared_ptr<galileo_e1_ls_pvt> position_ = position;
|
||||||
if (print_average_values == false)
|
if (print_average_values == false)
|
||||||
{
|
{
|
||||||
latitude = position->d_latitude_d;
|
latitude = position_->d_latitude_d;
|
||||||
longitude = position->d_longitude_d;
|
longitude = position_->d_longitude_d;
|
||||||
height = position->d_height_m;
|
height = position_->d_height_m;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
latitude = position->d_avg_latitude_d;
|
latitude = position_->d_avg_latitude_d;
|
||||||
longitude = position->d_avg_longitude_d;
|
longitude = position_->d_avg_longitude_d;
|
||||||
height = position->d_avg_height_m;
|
height = position_->d_avg_height_m;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kml_file.is_open())
|
if (kml_file.is_open())
|
||||||
@ -195,5 +199,8 @@ Kml_Printer::Kml_Printer () {}
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Kml_Printer::~Kml_Printer () {}
|
Kml_Printer::~Kml_Printer ()
|
||||||
|
{
|
||||||
|
close_file();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -51,8 +51,8 @@ private:
|
|||||||
std::ofstream kml_file;
|
std::ofstream kml_file;
|
||||||
public:
|
public:
|
||||||
bool set_headers(std::string filename);
|
bool set_headers(std::string filename);
|
||||||
bool print_position(gps_l1_ca_ls_pvt* position, bool print_average_values);
|
bool print_position(const std::shared_ptr<gps_l1_ca_ls_pvt>& position, bool print_average_values);
|
||||||
bool print_position_galileo(galileo_e1_ls_pvt* position, bool print_average_values);
|
bool print_position_galileo(const std::shared_ptr<galileo_e1_ls_pvt>& position, bool print_average_values);
|
||||||
bool print_position_hybrid(hybrid_ls_pvt* position, bool print_average_values);
|
bool print_position_hybrid(hybrid_ls_pvt* position, bool print_average_values);
|
||||||
bool close_file();
|
bool close_file();
|
||||||
Kml_Printer();
|
Kml_Printer();
|
||||||
|
@ -132,7 +132,7 @@ void Nmea_Printer::close_serial ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Nmea_Printer::Print_Nmea_Line(gps_l1_ca_ls_pvt* pvt_data, bool print_average_values)
|
bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr<gps_l1_ca_ls_pvt>& pvt_data, bool print_average_values)
|
||||||
{
|
{
|
||||||
std::string GPRMC;
|
std::string GPRMC;
|
||||||
std::string GPGGA;
|
std::string GPGGA;
|
||||||
|
@ -60,7 +60,7 @@ public:
|
|||||||
/*!
|
/*!
|
||||||
* \brief Print NMEA PVT and satellite info to the initialized device
|
* \brief Print NMEA PVT and satellite info to the initialized device
|
||||||
*/
|
*/
|
||||||
bool Print_Nmea_Line(gps_l1_ca_ls_pvt* position, bool print_average_values);
|
bool Print_Nmea_Line(const std::shared_ptr<gps_l1_ca_ls_pvt>& position, bool print_average_values);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Default destructor.
|
* \brief Default destructor.
|
||||||
@ -72,9 +72,9 @@ private:
|
|||||||
std::ofstream nmea_file_descriptor; // Output file stream for NMEA log file
|
std::ofstream nmea_file_descriptor; // Output file stream for NMEA log file
|
||||||
std::string nmea_devname;
|
std::string nmea_devname;
|
||||||
int nmea_dev_descriptor; // NMEA serial device descriptor (i.e. COM port)
|
int nmea_dev_descriptor; // NMEA serial device descriptor (i.e. COM port)
|
||||||
gps_l1_ca_ls_pvt* d_PVT_data;
|
std::shared_ptr<gps_l1_ca_ls_pvt> d_PVT_data;
|
||||||
int init_serial (std::string serial_device); //serial port control
|
int init_serial(std::string serial_device); //serial port control
|
||||||
void close_serial ();
|
void close_serial();
|
||||||
std::string get_GPGGA(); // fix data
|
std::string get_GPGGA(); // fix data
|
||||||
std::string get_GPGSV(); // satellite data
|
std::string get_GPGSV(); // satellite data
|
||||||
std::string get_GPGSA(); // overall satellite reception data
|
std::string get_GPGSA(); // overall satellite reception data
|
||||||
|
@ -42,10 +42,7 @@
|
|||||||
#include <gflags/gflags.h>
|
#include <gflags/gflags.h>
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include "sbas_telemetry_data.h"
|
#include "sbas_telemetry_data.h"
|
||||||
#include "gps_navigation_message.h"
|
|
||||||
#include "gps_ephemeris.h"
|
|
||||||
#include "gps_iono.h"
|
|
||||||
#include "gps_utc_model.h"
|
|
||||||
|
|
||||||
|
|
||||||
using google::LogMessage;
|
using google::LogMessage;
|
||||||
@ -58,10 +55,13 @@ Rinex_Printer::Rinex_Printer()
|
|||||||
navfilename = Rinex_Printer::createFilename("RINEX_FILE_TYPE_GPS_NAV");
|
navfilename = Rinex_Printer::createFilename("RINEX_FILE_TYPE_GPS_NAV");
|
||||||
obsfilename = Rinex_Printer::createFilename("RINEX_FILE_TYPE_OBS");
|
obsfilename = Rinex_Printer::createFilename("RINEX_FILE_TYPE_OBS");
|
||||||
sbsfilename = Rinex_Printer::createFilename("RINEX_FILE_TYPE_SBAS");
|
sbsfilename = Rinex_Printer::createFilename("RINEX_FILE_TYPE_SBAS");
|
||||||
|
navGalfilename = Rinex_Printer::createFilename("RINEX_FILE_TYPE_GAL_NAV");
|
||||||
|
|
||||||
|
|
||||||
Rinex_Printer::navFile.open(navfilename, std::ios::out | std::ios::app);
|
Rinex_Printer::navFile.open(navfilename, std::ios::out | std::ios::app);
|
||||||
Rinex_Printer::obsFile.open(obsfilename, std::ios::out | std::ios::app);
|
Rinex_Printer::obsFile.open(obsfilename, std::ios::out | std::ios::app);
|
||||||
Rinex_Printer::sbsFile.open(sbsfilename, std::ios::out | std::ios::app);
|
Rinex_Printer::sbsFile.open(sbsfilename, std::ios::out | std::ios::app);
|
||||||
|
Rinex_Printer::navGalFile.open(navGalfilename, std::ios::out | std::ios::app);
|
||||||
|
|
||||||
// RINEX v3.00 codes
|
// RINEX v3.00 codes
|
||||||
satelliteSystem["GPS"] = "G";
|
satelliteSystem["GPS"] = "G";
|
||||||
@ -167,13 +167,15 @@ Rinex_Printer::Rinex_Printer()
|
|||||||
Rinex_Printer::~Rinex_Printer()
|
Rinex_Printer::~Rinex_Printer()
|
||||||
{
|
{
|
||||||
// close RINEX files
|
// close RINEX files
|
||||||
long posn, poso, poss;
|
long posn, poso, poss, posng;
|
||||||
posn = navFile.tellp();
|
posn = navFile.tellp();
|
||||||
poso = obsFile.tellp();
|
poso = obsFile.tellp();
|
||||||
poss = obsFile.tellp();
|
poss = sbsFile.tellp();
|
||||||
|
posng = navGalFile.tellp();
|
||||||
Rinex_Printer::navFile.close();
|
Rinex_Printer::navFile.close();
|
||||||
Rinex_Printer::obsFile.close();
|
Rinex_Printer::obsFile.close();
|
||||||
Rinex_Printer::sbsFile.close();
|
Rinex_Printer::sbsFile.close();
|
||||||
|
Rinex_Printer::navGalFile.close();
|
||||||
// If nothing written, erase the files.
|
// If nothing written, erase the files.
|
||||||
if (posn == 0)
|
if (posn == 0)
|
||||||
{
|
{
|
||||||
@ -187,6 +189,10 @@ Rinex_Printer::~Rinex_Printer()
|
|||||||
{
|
{
|
||||||
remove(sbsfilename.c_str());
|
remove(sbsfilename.c_str());
|
||||||
}
|
}
|
||||||
|
if (posng == 0)
|
||||||
|
{
|
||||||
|
remove(navGalfilename.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -335,8 +341,8 @@ std::string Rinex_Printer::getLocalTime()
|
|||||||
|
|
||||||
if (version == 3)
|
if (version == 3)
|
||||||
{
|
{
|
||||||
line += std::string(1, ' ');
|
|
||||||
line += boost::gregorian::to_iso_string(today);
|
line += boost::gregorian::to_iso_string(today);
|
||||||
|
line += std::string(1, ' ');
|
||||||
line += strmHour.str();
|
line += strmHour.str();
|
||||||
line += strmMin.str();
|
line += strmMin.str();
|
||||||
|
|
||||||
@ -353,6 +359,117 @@ std::string Rinex_Printer::getLocalTime()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Rinex_Printer::rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Galileo_Utc_Model utc_model)
|
||||||
|
{
|
||||||
|
|
||||||
|
std::string line;
|
||||||
|
stringVersion = "3.01";
|
||||||
|
version = 3;
|
||||||
|
|
||||||
|
// -------- Line 1
|
||||||
|
line = std::string(5, ' ');
|
||||||
|
line += stringVersion;
|
||||||
|
line += std::string(11, ' ');
|
||||||
|
line += std::string("N: GNSS NAV DATA");
|
||||||
|
line += std::string(4, ' ');
|
||||||
|
line += std::string("E: GALILEO");
|
||||||
|
line += std::string(10, ' ');
|
||||||
|
line += std::string("RINEX VERSION / TYPE");
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- Line 2
|
||||||
|
line.clear();
|
||||||
|
line += Rinex_Printer::getLocalTime();
|
||||||
|
line += std::string("PGM / RUN BY / DATE");
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- Line COMMENT
|
||||||
|
line.clear();
|
||||||
|
line += Rinex_Printer::leftJustify("GALILEO NAVIGATION MESSAGE FILE GENERATED BY GNSS-SDR", 60);
|
||||||
|
line += Rinex_Printer::leftJustify("COMMENT", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- Line COMMENT
|
||||||
|
line.clear();
|
||||||
|
std::string gnss_sdr_version(GNSS_SDR_VERSION);
|
||||||
|
line += "GNSS-SDR VERSION ";
|
||||||
|
line += Rinex_Printer::leftJustify(gnss_sdr_version, 43);
|
||||||
|
line += Rinex_Printer::leftJustify("COMMENT", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- Line COMMENT
|
||||||
|
line.clear();
|
||||||
|
line += Rinex_Printer::leftJustify("See http://gnss-sdr.org", 60);
|
||||||
|
line += Rinex_Printer::leftJustify("COMMENT", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
// -------- Line ionospheric info 1
|
||||||
|
line.clear();
|
||||||
|
line += std::string("GAL ");
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.ai0_5, 10, 2), 12);
|
||||||
|
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.ai1_5, 10, 2), 12);
|
||||||
|
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.ai2_5, 10, 2), 12);
|
||||||
|
double zero = 0.0;
|
||||||
|
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(zero, 10, 2), 12);
|
||||||
|
line += std::string(7, ' ');
|
||||||
|
line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
// -------- Line system time correction
|
||||||
|
line.clear();
|
||||||
|
line += std::string("GAUT");
|
||||||
|
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A0_6, 16, 2), 18);
|
||||||
|
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A1_6, 15, 2), 16);
|
||||||
|
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(utc_model.t0t_6), 7);
|
||||||
|
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(utc_model.WNot_6), 5);
|
||||||
|
line += std::string(10, ' ');
|
||||||
|
line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- Line system time correction 2
|
||||||
|
/* line.clear();
|
||||||
|
line += std::string("GPGA");
|
||||||
|
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.XXX, 16, 2), 18);
|
||||||
|
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.XXX, 15, 2), 16);
|
||||||
|
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(utc_model.XXX), 7);
|
||||||
|
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(utc_model.XXX), 5);
|
||||||
|
line += std::string(10, ' ');
|
||||||
|
line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;*/
|
||||||
|
|
||||||
|
|
||||||
|
// -------- Line 6 leap seconds
|
||||||
|
// For leap second information, see http://www.endruntechnologies.com/leap.htm
|
||||||
|
line.clear();
|
||||||
|
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(static_cast<int>(utc_model.Delta_tLS_6)), 6);
|
||||||
|
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(static_cast<int>(utc_model.Delta_tLSF_6)), 6);
|
||||||
|
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(static_cast<int>(utc_model.WN_LSF_6)), 6);
|
||||||
|
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(static_cast<int>(utc_model.DN_6)), 6);
|
||||||
|
line += std::string(36, ' ');
|
||||||
|
line += Rinex_Printer::leftJustify("LEAP SECONDS", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- End of Header
|
||||||
|
line.clear();
|
||||||
|
line += std::string(60, ' ');
|
||||||
|
line += Rinex_Printer::leftJustify("END OF HEADER", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
void Rinex_Printer::rinex_nav_header(std::ofstream& out, Gps_Iono iono, Gps_Utc_Model utc_model)
|
void Rinex_Printer::rinex_nav_header(std::ofstream& out, Gps_Iono iono, Gps_Utc_Model utc_model)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -399,6 +516,15 @@ void Rinex_Printer::rinex_nav_header(std::ofstream& out, Gps_Iono iono, Gps_Utc_
|
|||||||
Rinex_Printer::lengthCheck(line);
|
Rinex_Printer::lengthCheck(line);
|
||||||
out << line << std::endl;
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- Line COMMENT
|
||||||
|
line.clear();
|
||||||
|
std::string gnss_sdr_version(GNSS_SDR_VERSION);
|
||||||
|
line += "GNSS-SDR VERSION ";
|
||||||
|
line += Rinex_Printer::leftJustify(gnss_sdr_version, 43);
|
||||||
|
line += Rinex_Printer::leftJustify("COMMENT", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
// -------- Line COMMENT
|
// -------- Line COMMENT
|
||||||
line.clear();
|
line.clear();
|
||||||
line += Rinex_Printer::leftJustify("See http://gnss-sdr.org", 60);
|
line += Rinex_Printer::leftJustify("See http://gnss-sdr.org", 60);
|
||||||
@ -524,7 +650,6 @@ void Rinex_Printer::rinex_nav_header(std::ofstream& out, Gps_Iono iono, Gps_Utc_
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Rinex_Printer::rinex_sbs_header(std::ofstream& out)
|
void Rinex_Printer::rinex_sbs_header(std::ofstream& out)
|
||||||
{
|
{
|
||||||
std::string line;
|
std::string line;
|
||||||
@ -597,6 +722,15 @@ void Rinex_Printer::rinex_sbs_header(std::ofstream& out)
|
|||||||
Rinex_Printer::lengthCheck(line);
|
Rinex_Printer::lengthCheck(line);
|
||||||
out << line << std::endl;
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- Line COMMENT
|
||||||
|
line.clear();
|
||||||
|
std::string gnss_sdr_version(GNSS_SDR_VERSION);
|
||||||
|
line += "GNSS-SDR VERSION ";
|
||||||
|
line += Rinex_Printer::leftJustify(gnss_sdr_version, 43);
|
||||||
|
line += Rinex_Printer::leftJustify("COMMENT", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
// -------- Line COMMENT 2
|
// -------- Line COMMENT 2
|
||||||
line.clear();
|
line.clear();
|
||||||
line += Rinex_Printer::leftJustify("See http://gnss-sdr.org", 60);
|
line += Rinex_Printer::leftJustify("See http://gnss-sdr.org", 60);
|
||||||
@ -911,6 +1045,158 @@ void Rinex_Printer::log_rinex_nav(std::ofstream& out, std::map<int,Gps_Ephemeris
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Rinex_Printer::log_rinex_nav(std::ofstream& out, std::map<int, Galileo_Ephemeris> eph_map)
|
||||||
|
{
|
||||||
|
std::string line;
|
||||||
|
std::map<int,Galileo_Ephemeris>::iterator galileo_ephemeris_iter;
|
||||||
|
line.clear();
|
||||||
|
for(galileo_ephemeris_iter = eph_map.begin();
|
||||||
|
galileo_ephemeris_iter != eph_map.end();
|
||||||
|
galileo_ephemeris_iter++)
|
||||||
|
{
|
||||||
|
// -------- SV / EPOCH / SV CLK
|
||||||
|
boost::posix_time::ptime p_utc_time = Rinex_Printer::compute_Galileo_time(galileo_ephemeris_iter->second, galileo_ephemeris_iter->second.TOW_5);
|
||||||
|
std::string timestring = boost::posix_time::to_iso_string(p_utc_time);
|
||||||
|
std::string month (timestring, 4, 2);
|
||||||
|
std::string day (timestring, 6, 2);
|
||||||
|
std::string hour (timestring, 9, 2);
|
||||||
|
std::string minutes (timestring, 11, 2);
|
||||||
|
std::string seconds (timestring, 13, 2);
|
||||||
|
|
||||||
|
line += satelliteSystem["Galileo"];
|
||||||
|
if (galileo_ephemeris_iter->second.i_satellite_PRN < 10) line += std::string("0");
|
||||||
|
line += boost::lexical_cast<std::string>(galileo_ephemeris_iter->second.i_satellite_PRN);
|
||||||
|
std::string year (timestring, 0, 4);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += year;
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += month;
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += day;
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += hour;
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += minutes;
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += seconds;
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.af0_4, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.af1_4, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.af2_4, 18, 2);
|
||||||
|
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
// -------- BROADCAST ORBIT - 1
|
||||||
|
line.clear();
|
||||||
|
line += std::string(5, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.IOD_ephemeris, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.C_rs_3, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.delta_n_3, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.M0_1, 18, 2);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
// -------- BROADCAST ORBIT - 2
|
||||||
|
line.clear();
|
||||||
|
line += std::string(5, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.C_uc_3, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.e_1, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.C_us_3, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.A_1, 18, 2);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// -------- BROADCAST ORBIT - 3
|
||||||
|
line.clear();
|
||||||
|
line += std::string(5, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.t0e_1, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.C_ic_4, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.OMEGA_0_2, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.C_is_4, 18, 2);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// -------- BROADCAST ORBIT - 4
|
||||||
|
line.clear();
|
||||||
|
line += std::string(5, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.i_0_2, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.C_rc_3, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.omega_2, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.OMEGA_dot_3, 18, 2);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// -------- BROADCAST ORBIT - 5
|
||||||
|
line.clear();
|
||||||
|
line += std::string(5, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.iDot_2, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
double zero = 0.0;
|
||||||
|
line += Rinex_Printer::doub2for(zero, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
double Galileo_week_continuous_number = (double)(galileo_ephemeris_iter->second.WN_5);
|
||||||
|
line += Rinex_Printer::doub2for(Galileo_week_continuous_number, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(zero, 18, 2);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
// -------- BROADCAST ORBIT - 6
|
||||||
|
line.clear();
|
||||||
|
line += std::string(5, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(zero, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(zero, 18, 2); //
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(zero, 18, 2); //
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(zero, 18, 2); //
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
// -------- BROADCAST ORBIT - 7
|
||||||
|
line.clear();
|
||||||
|
line += std::string(5, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.TOW_5, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += Rinex_Printer::doub2for(zero, 18, 2);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += std::string(18, ' '); // spare
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += std::string(18, ' '); // spare
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
line.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Rinex_Printer::rinex_obs_header(std::ofstream& out, Gps_Ephemeris eph, double d_TOW_first_observation)
|
void Rinex_Printer::rinex_obs_header(std::ofstream& out, Gps_Ephemeris eph, double d_TOW_first_observation)
|
||||||
{
|
{
|
||||||
@ -957,6 +1243,15 @@ void Rinex_Printer::rinex_obs_header(std::ofstream& out, Gps_Ephemeris eph, doub
|
|||||||
Rinex_Printer::lengthCheck(line);
|
Rinex_Printer::lengthCheck(line);
|
||||||
out << line << std::endl;
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- Line COMMENT
|
||||||
|
line.clear();
|
||||||
|
std::string gnss_sdr_version(GNSS_SDR_VERSION);
|
||||||
|
line += "GNSS-SDR VERSION ";
|
||||||
|
line += Rinex_Printer::leftJustify(gnss_sdr_version, 43);
|
||||||
|
line += Rinex_Printer::leftJustify("COMMENT", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
// -------- Line COMMENT
|
// -------- Line COMMENT
|
||||||
line.clear();
|
line.clear();
|
||||||
line += Rinex_Printer::leftJustify("See http://gnss-sdr.org", 60);
|
line += Rinex_Printer::leftJustify("See http://gnss-sdr.org", 60);
|
||||||
@ -993,7 +1288,8 @@ void Rinex_Printer::rinex_obs_header(std::ofstream& out, Gps_Ephemeris eph, doub
|
|||||||
line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property
|
line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property
|
||||||
line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property
|
line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property
|
||||||
//line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
|
//line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
|
||||||
line += Rinex_Printer::leftJustify("0.1", 20);
|
if(gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' ');
|
||||||
|
line += Rinex_Printer::leftJustify(gnss_sdr_version, 20);
|
||||||
line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20);
|
line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20);
|
||||||
lengthCheck(line);
|
lengthCheck(line);
|
||||||
out << line << std::endl;
|
out << line << std::endl;
|
||||||
@ -1055,14 +1351,24 @@ void Rinex_Printer::rinex_obs_header(std::ofstream& out, Gps_Ephemeris eph, doub
|
|||||||
line.clear();
|
line.clear();
|
||||||
line += satelliteSystem["GPS"];
|
line += satelliteSystem["GPS"];
|
||||||
line += std::string(2, ' ');
|
line += std::string(2, ' ');
|
||||||
//int numberTypesObservations=2; // Count the number of available types of observable in the system
|
|
||||||
std::stringstream strm;
|
std::stringstream strm;
|
||||||
|
numberTypesObservations = 4;
|
||||||
strm << numberTypesObservations;
|
strm << numberTypesObservations;
|
||||||
line += Rinex_Printer::rightJustify(strm.str(), 3);
|
line += Rinex_Printer::rightJustify(strm.str(), 3);
|
||||||
// per type of observation
|
// per type of observation
|
||||||
|
// GPS L1 PSEUDORANGE
|
||||||
line += std::string(1, ' ');
|
line += std::string(1, ' ');
|
||||||
line += observationType["PSEUDORANGE"];
|
line += observationType["PSEUDORANGE"];
|
||||||
line += observationCode["GPS_L1_CA"];
|
line += observationCode["GPS_L1_CA"];
|
||||||
|
// GPS L1 PHASE
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += observationType["CARRIER_PHASE"];
|
||||||
|
line += observationCode["GPS_L1_CA"];
|
||||||
|
// GPS DOPPLER L1
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += observationType["DOPPLER"];
|
||||||
|
line += observationCode["GPS_L1_CA"];
|
||||||
|
// GPS L! CA SIGNAL STRENGTH
|
||||||
line += std::string(1, ' ');
|
line += std::string(1, ' ');
|
||||||
line += observationType["SIGNAL_STRENGTH"];
|
line += observationType["SIGNAL_STRENGTH"];
|
||||||
line += observationCode["GPS_L1_CA"];
|
line += observationCode["GPS_L1_CA"];
|
||||||
@ -1145,6 +1451,199 @@ void Rinex_Printer::rinex_obs_header(std::ofstream& out, Gps_Ephemeris eph, doub
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Rinex_Printer::rinex_obs_header(std::ofstream& out, Galileo_Ephemeris eph, double d_TOW_first_observation)
|
||||||
|
{
|
||||||
|
|
||||||
|
std::string line;
|
||||||
|
version = 3;
|
||||||
|
|
||||||
|
// -------- Line 1
|
||||||
|
line = std::string(5, ' ');
|
||||||
|
line += "3.01";
|
||||||
|
line += std::string(11, ' ');
|
||||||
|
line += Rinex_Printer::leftJustify("OBSERVATION DATA", 20);
|
||||||
|
line += satelliteSystem["Galileo"];
|
||||||
|
line += std::string(19, ' ');
|
||||||
|
line += std::string("RINEX VERSION / TYPE");
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- Line 2
|
||||||
|
line.clear();
|
||||||
|
line += Rinex_Printer::leftJustify("G = GPS R = GLONASS E = GALILEO S = GEO M = MIXED", 60);
|
||||||
|
line += Rinex_Printer::leftJustify("COMMENT", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- Line 3
|
||||||
|
line.clear();
|
||||||
|
line += Rinex_Printer::getLocalTime();
|
||||||
|
line += std::string("PGM / RUN BY / DATE");
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- Line COMMENT
|
||||||
|
line.clear();
|
||||||
|
line += Rinex_Printer::leftJustify("GALILEO OBSERVATION DATA FILE GENERATED BY GNSS-SDR", 60);
|
||||||
|
line += Rinex_Printer::leftJustify("COMMENT", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- Line COMMENT
|
||||||
|
line.clear();
|
||||||
|
std::string gnss_sdr_version(GNSS_SDR_VERSION);
|
||||||
|
line += "GNSS-SDR VERSION ";
|
||||||
|
line += Rinex_Printer::leftJustify(gnss_sdr_version, 43);
|
||||||
|
line += Rinex_Printer::leftJustify("COMMENT", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- Line COMMENT
|
||||||
|
line.clear();
|
||||||
|
line += Rinex_Printer::leftJustify("See http://gnss-sdr.org", 60);
|
||||||
|
line += Rinex_Printer::leftJustify("COMMENT", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- Line MARKER NAME
|
||||||
|
line.clear();
|
||||||
|
line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property,
|
||||||
|
line += Rinex_Printer::leftJustify("MARKER NAME", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- Line MARKER TYPE
|
||||||
|
//line.clear();
|
||||||
|
//line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property
|
||||||
|
//line += std::string(40, ' ');
|
||||||
|
//line += Rinex_Printer::leftJustify("MARKER TYPE", 20);
|
||||||
|
//Rinex_Printer::lengthCheck(line);
|
||||||
|
//out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- Line OBSERVER / AGENCY
|
||||||
|
line.clear();
|
||||||
|
std::string username=getenv("USER");
|
||||||
|
line += leftJustify(username, 20);
|
||||||
|
line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property
|
||||||
|
line += Rinex_Printer::leftJustify("OBSERVER / AGENCY", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- Line REC / TYPE VERS
|
||||||
|
line.clear();
|
||||||
|
line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property
|
||||||
|
line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property
|
||||||
|
//line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
|
||||||
|
if(gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' ');
|
||||||
|
line += Rinex_Printer::leftJustify(gnss_sdr_version, 20);
|
||||||
|
line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20);
|
||||||
|
lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- ANTENNA TYPE
|
||||||
|
line.clear();
|
||||||
|
line += Rinex_Printer::leftJustify("Antenna number", 20); // add flag and property
|
||||||
|
line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property
|
||||||
|
line += std::string(20, ' ');
|
||||||
|
line += Rinex_Printer::leftJustify("ANT # / TYPE", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- APPROX POSITION (optional for moving platforms)
|
||||||
|
// put here real data!
|
||||||
|
double antena_x = 0.0;
|
||||||
|
double antena_y = 0.0;
|
||||||
|
double antena_z = 0.0;
|
||||||
|
line.clear();
|
||||||
|
line += Rinex_Printer::rightJustify(Rinex_Printer::asString(antena_x, 4), 14);
|
||||||
|
line += Rinex_Printer::rightJustify(Rinex_Printer::asString(antena_y, 4), 14);
|
||||||
|
line += Rinex_Printer::rightJustify(Rinex_Printer::asString(antena_z, 4), 14);
|
||||||
|
line += std::string(18, ' ');
|
||||||
|
line += Rinex_Printer::leftJustify("APPROX POSITION XYZ", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- ANTENNA: DELTA H/E/N
|
||||||
|
// put here real data!
|
||||||
|
double antena_h = 0.0;
|
||||||
|
double antena_e = 0.0;
|
||||||
|
double antena_n = 0.0;
|
||||||
|
line.clear();
|
||||||
|
line += Rinex_Printer::rightJustify(Rinex_Printer::asString(antena_h, 4), 14);
|
||||||
|
line += Rinex_Printer::rightJustify(Rinex_Printer::asString(antena_e, 4), 14);
|
||||||
|
line += Rinex_Printer::rightJustify(Rinex_Printer::asString(antena_n, 4), 14);
|
||||||
|
line += std::string(18, ' ');
|
||||||
|
line += Rinex_Printer::leftJustify("ANTENNA: DELTA H/E/N", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- SYS / OBS TYPES
|
||||||
|
// one line per available system
|
||||||
|
line.clear();
|
||||||
|
line += satelliteSystem["Galileo"];
|
||||||
|
line += std::string(2, ' ');
|
||||||
|
line += Rinex_Printer::rightJustify("4", 3);
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += observationType["PSEUDORANGE"];
|
||||||
|
line += observationCode["GALILEO_E1_B"];
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += observationType["CARRIER_PHASE"];
|
||||||
|
line += observationCode["GALILEO_E1_B"];
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += observationType["DOPPLER"];
|
||||||
|
line += observationCode["GALILEO_E1_B"];
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += observationType["SIGNAL_STRENGTH"];
|
||||||
|
line += observationCode["GALILEO_E1_B"];
|
||||||
|
line += std::string(60-line.size(), ' ');
|
||||||
|
line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- Signal Strength units
|
||||||
|
line.clear();
|
||||||
|
line += Rinex_Printer::leftJustify("DBHZ", 20);
|
||||||
|
line += std::string(40, ' ');
|
||||||
|
line += Rinex_Printer::leftJustify("SIGNAL STRENGTH UNIT", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
// -------- TIME OF FIRST OBS
|
||||||
|
line.clear();
|
||||||
|
boost::posix_time::ptime p_galileo_time = Rinex_Printer::compute_Galileo_time(eph, d_TOW_first_observation);
|
||||||
|
std::string timestring=boost::posix_time::to_iso_string(p_galileo_time);
|
||||||
|
std::string year (timestring, 0, 4);
|
||||||
|
std::string month (timestring, 4, 2);
|
||||||
|
std::string day (timestring, 6, 2);
|
||||||
|
std::string hour (timestring, 9, 2);
|
||||||
|
std::string minutes (timestring, 11, 2);
|
||||||
|
double galileo_t = d_TOW_first_observation;
|
||||||
|
double seconds = fmod(galileo_t, 60);
|
||||||
|
line += Rinex_Printer::rightJustify(year, 6);
|
||||||
|
line += Rinex_Printer::rightJustify(month, 6);
|
||||||
|
line += Rinex_Printer::rightJustify(day, 6);
|
||||||
|
line += Rinex_Printer::rightJustify(hour, 6);
|
||||||
|
line += Rinex_Printer::rightJustify(minutes, 6);
|
||||||
|
line += Rinex_Printer::rightJustify(asString(seconds, 7), 13);
|
||||||
|
line += Rinex_Printer::rightJustify(std::string("GAL"), 8);
|
||||||
|
line += std::string(9, ' ');
|
||||||
|
line += Rinex_Printer::leftJustify("TIME OF FIRST OBS", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
// -------- SYS /PHASE SHIFTS
|
||||||
|
|
||||||
|
// -------- end of header
|
||||||
|
line.clear();
|
||||||
|
line += std::string(60, ' ');
|
||||||
|
line += Rinex_Printer::leftJustify("END OF HEADER", 20);
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Rinex_Printer::log_rinex_obs(std::ofstream& out, Gps_Ephemeris eph, double obs_time, std::map<int,Gnss_Synchro> pseudoranges)
|
void Rinex_Printer::log_rinex_obs(std::ofstream& out, Gps_Ephemeris eph, double obs_time, std::map<int,Gnss_Synchro> pseudoranges)
|
||||||
{
|
{
|
||||||
@ -1274,7 +1773,7 @@ void Rinex_Printer::log_rinex_obs(std::ofstream& out, Gps_Ephemeris eph, double
|
|||||||
line += std::string(1, ' ');
|
line += std::string(1, ' ');
|
||||||
double seconds=fmod(gps_t, 60);
|
double seconds=fmod(gps_t, 60);
|
||||||
// Add extra 0 if seconds are < 10
|
// Add extra 0 if seconds are < 10
|
||||||
if (seconds<10)
|
if (seconds < 10)
|
||||||
{
|
{
|
||||||
line +=std::string(1, '0');
|
line +=std::string(1, '0');
|
||||||
}
|
}
|
||||||
@ -1324,15 +1823,16 @@ void Rinex_Printer::log_rinex_obs(std::ofstream& out, Gps_Ephemeris eph, double
|
|||||||
{
|
{
|
||||||
lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<short>(lli), 1);
|
lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<short>(lli), 1);
|
||||||
}
|
}
|
||||||
int ssi=signalStrength(54.0); // TODO: include estimated signal strength
|
|
||||||
if (ssi == 0)
|
// GPS L1 CA PHASE
|
||||||
{
|
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.Carrier_phase_rads/GPS_TWO_PI, 3), 14);
|
||||||
lineObs += std::string(1, ' ');
|
|
||||||
}
|
// GPS L1 CA DOPPLER
|
||||||
else
|
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.Carrier_Doppler_hz, 3), 14);
|
||||||
{
|
|
||||||
lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<short>(ssi), 1);
|
//GPS L1 SIGNAL STRENGTH
|
||||||
}
|
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.CN0_dB_hz, 3), 14);
|
||||||
|
|
||||||
if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' ');
|
if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' ');
|
||||||
out << lineObs << std::endl;
|
out << lineObs << std::endl;
|
||||||
}
|
}
|
||||||
@ -1341,6 +1841,103 @@ void Rinex_Printer::log_rinex_obs(std::ofstream& out, Gps_Ephemeris eph, double
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Rinex_Printer::log_rinex_obs(std::ofstream& out, Galileo_Ephemeris eph, double obs_time, std::map<int,Gnss_Synchro> pseudoranges)
|
||||||
|
{
|
||||||
|
// RINEX observations timestamps are Galileo timestamps.
|
||||||
|
// See http://gage14.upc.es/gLAB/HTML/Observation_Rinex_v3.01.html
|
||||||
|
|
||||||
|
std::string line;
|
||||||
|
|
||||||
|
boost::posix_time::ptime p_galileo_time = Rinex_Printer::compute_Galileo_time(eph, obs_time);
|
||||||
|
std::string timestring = boost::posix_time::to_iso_string(p_galileo_time);
|
||||||
|
//double utc_t = nav_msg.utc_time(nav_msg.sv_clock_correction(obs_time));
|
||||||
|
//double gps_t = eph.sv_clock_correction(obs_time);
|
||||||
|
double galileo_t = obs_time;
|
||||||
|
|
||||||
|
std::string month (timestring, 4, 2);
|
||||||
|
std::string day (timestring, 6, 2);
|
||||||
|
std::string hour (timestring, 9, 2);
|
||||||
|
std::string minutes (timestring, 11, 2);
|
||||||
|
|
||||||
|
|
||||||
|
std::string year (timestring, 0, 4);
|
||||||
|
line += std::string(1, '>');
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += year;
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += month;
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += day;
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += hour;
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
line += minutes;
|
||||||
|
|
||||||
|
line += std::string(1, ' ');
|
||||||
|
double seconds = fmod(galileo_t, 60);
|
||||||
|
// Add extra 0 if seconds are < 10
|
||||||
|
if (seconds < 10)
|
||||||
|
{
|
||||||
|
line +=std::string(1, '0');
|
||||||
|
}
|
||||||
|
line += Rinex_Printer::asString(seconds, 7);
|
||||||
|
line += std::string(2, ' ');
|
||||||
|
// Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event
|
||||||
|
line += std::string(1, '0');
|
||||||
|
|
||||||
|
//Number of satellites observed in current epoch
|
||||||
|
int numSatellitesObserved = 0;
|
||||||
|
std::map<int,Gnss_Synchro>::iterator pseudoranges_iter;
|
||||||
|
for(pseudoranges_iter = pseudoranges.begin();
|
||||||
|
pseudoranges_iter != pseudoranges.end();
|
||||||
|
pseudoranges_iter++)
|
||||||
|
{
|
||||||
|
numSatellitesObserved++;
|
||||||
|
}
|
||||||
|
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(numSatellitesObserved), 3);
|
||||||
|
|
||||||
|
|
||||||
|
// Receiver clock offset (optional)
|
||||||
|
//line += rightJustify(asString(clockOffset, 12), 15);
|
||||||
|
|
||||||
|
line += std::string(80 - line.size(), ' ');
|
||||||
|
Rinex_Printer::lengthCheck(line);
|
||||||
|
out << line << std::endl;
|
||||||
|
|
||||||
|
for(pseudoranges_iter = pseudoranges.begin();
|
||||||
|
pseudoranges_iter != pseudoranges.end();
|
||||||
|
pseudoranges_iter++)
|
||||||
|
{
|
||||||
|
std::string lineObs;
|
||||||
|
lineObs.clear();
|
||||||
|
lineObs += satelliteSystem["Galileo"];
|
||||||
|
if ((int)pseudoranges_iter->first < 10) lineObs += std::string(1, '0');
|
||||||
|
lineObs += boost::lexical_cast<std::string>((int)pseudoranges_iter->first);
|
||||||
|
//lineObs += std::string(2, ' ');
|
||||||
|
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.Pseudorange_m, 3), 14);
|
||||||
|
|
||||||
|
//Loss of lock indicator (LLI)
|
||||||
|
int lli = 0; // Include in the observation!!
|
||||||
|
if (lli == 0)
|
||||||
|
{
|
||||||
|
lineObs += std::string(1, ' ');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<short>(lli), 1);
|
||||||
|
}
|
||||||
|
// Galileo E1B PHASE
|
||||||
|
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.Carrier_phase_rads / (2 * GALILEO_PI), 3), 14);
|
||||||
|
// Galileo E1B DOPPLER
|
||||||
|
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.Carrier_Doppler_hz, 3), 14);
|
||||||
|
// Galileo E1B SIGNAL STRENGTH
|
||||||
|
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.CN0_dB_hz, 3), 14);
|
||||||
|
if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' ');
|
||||||
|
out << lineObs << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// represents GPS time (week, TOW) in the date time format of the Gregorian calendar.
|
// represents GPS time (week, TOW) in the date time format of the Gregorian calendar.
|
||||||
// -> Leap years are considered, but leap seconds not.
|
// -> Leap years are considered, but leap seconds not.
|
||||||
void Rinex_Printer::to_date_time(int gps_week, int gps_tow, int &year, int &month, int &day, int &hour, int &minute, int &second)
|
void Rinex_Printer::to_date_time(int gps_week, int gps_tow, int &year, int &month, int &day, int &hour, int &minute, int &second)
|
||||||
@ -1529,6 +2126,20 @@ boost::posix_time::ptime Rinex_Printer::compute_GPS_time(Gps_Ephemeris eph, doub
|
|||||||
return p_time;
|
return p_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
boost::posix_time::ptime Rinex_Printer::compute_Galileo_time(Galileo_Ephemeris eph, double obs_time)
|
||||||
|
{
|
||||||
|
// The RINEX v2.11 v3.00 format uses GPS time for the observations epoch, not UTC time, thus, no leap seconds needed here.
|
||||||
|
// (see Section 3 in http://igscb.jpl.nasa.gov/igscb/data/format/rinex211.txt)
|
||||||
|
// (see Pag. 17 in http://igscb.jpl.nasa.gov/igscb/data/format/rinex300.pdf)
|
||||||
|
// --??? No time correction here, since it will be done in the RINEX processor
|
||||||
|
double galileo_t = obs_time;
|
||||||
|
boost::posix_time::time_duration t = boost::posix_time::millisec((galileo_t + 604800*(double)(eph.WN_5))*1000);
|
||||||
|
boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t);
|
||||||
|
return p_time;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
enum RINEX_enumMarkerType {
|
enum RINEX_enumMarkerType {
|
||||||
|
@ -57,9 +57,11 @@
|
|||||||
#include <sstream> // for stringstream
|
#include <sstream> // for stringstream
|
||||||
#include <iomanip> // for setprecision
|
#include <iomanip> // for setprecision
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||||
#include "gps_navigation_message.h"
|
#include "gps_navigation_message.h"
|
||||||
#include "boost/date_time/posix_time/posix_time.hpp"
|
#include "galileo_navigation_message.h"
|
||||||
#include "GPS_L1_CA.h"
|
#include "GPS_L1_CA.h"
|
||||||
|
#include "Galileo_E1.h"
|
||||||
#include "gnss_synchro.h"
|
#include "gnss_synchro.h"
|
||||||
|
|
||||||
class Sbas_Raw_Msg;
|
class Sbas_Raw_Msg;
|
||||||
@ -84,18 +86,23 @@ public:
|
|||||||
std::ofstream obsFile ; //<! Output file stream for RINEX observation file
|
std::ofstream obsFile ; //<! Output file stream for RINEX observation file
|
||||||
std::ofstream navFile ; //<! Output file stream for RINEX navigation data file
|
std::ofstream navFile ; //<! Output file stream for RINEX navigation data file
|
||||||
std::ofstream sbsFile ; //<! Output file stream for RINEX SBAS raw data file
|
std::ofstream sbsFile ; //<! Output file stream for RINEX SBAS raw data file
|
||||||
|
std::ofstream navGalFile ; //<! Output file stream for RINEX Galileo navigation data file
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Generates the Navigation Data header
|
* \brief Generates the Navigation Data header
|
||||||
*/
|
*/
|
||||||
void rinex_nav_header(std::ofstream& out, Gps_Iono iono, Gps_Utc_Model utc_model);
|
void rinex_nav_header(std::ofstream& out, Gps_Iono iono, Gps_Utc_Model utc_model);
|
||||||
|
|
||||||
|
void rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Galileo_Utc_Model utc_model);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Generates the Observation data header
|
* \brief Generates the Observation data header
|
||||||
*/
|
*/
|
||||||
void rinex_obs_header(std::ofstream& out, Gps_Ephemeris eph, double d_TOW_first_observation);
|
void rinex_obs_header(std::ofstream& out, Gps_Ephemeris eph, double d_TOW_first_observation);
|
||||||
|
|
||||||
|
void rinex_obs_header(std::ofstream& out, Galileo_Ephemeris eph, double d_TOW_first_observation);
|
||||||
/*!
|
/*!
|
||||||
|
|
||||||
* \brief Generates the SBAS raw data header
|
* \brief Generates the SBAS raw data header
|
||||||
*/
|
*/
|
||||||
void rinex_sbs_header(std::ofstream& out);
|
void rinex_sbs_header(std::ofstream& out);
|
||||||
@ -110,17 +117,21 @@ public:
|
|||||||
*/
|
*/
|
||||||
boost::posix_time::ptime compute_GPS_time(Gps_Ephemeris eph, double obs_time);
|
boost::posix_time::ptime compute_GPS_time(Gps_Ephemeris eph, double obs_time);
|
||||||
|
|
||||||
|
boost::posix_time::ptime compute_Galileo_time(Galileo_Ephemeris eph, double obs_time);
|
||||||
/*!
|
/*!
|
||||||
* \brief Writes data from the navigation message into the RINEX file
|
* \brief Writes data from the navigation message into the RINEX file
|
||||||
*/
|
*/
|
||||||
void log_rinex_nav(std::ofstream& out, std::map<int,Gps_Ephemeris> eph_map);
|
void log_rinex_nav(std::ofstream& out, std::map<int,Gps_Ephemeris> eph_map);
|
||||||
|
|
||||||
|
void log_rinex_nav(std::ofstream& out, std::map<int, Galileo_Ephemeris> eph_map);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Writes observables into the RINEX file
|
* \brief Writes observables into the RINEX file
|
||||||
*/
|
*/
|
||||||
void log_rinex_obs(std::ofstream& out, Gps_Ephemeris eph, double obs_time, std::map<int,Gnss_Synchro> pseudoranges);
|
void log_rinex_obs(std::ofstream& out, Gps_Ephemeris eph, double obs_time, std::map<int,Gnss_Synchro> pseudoranges);
|
||||||
|
|
||||||
|
void log_rinex_obs(std::ofstream& out, Galileo_Ephemeris eph, double obs_time, std::map<int,Gnss_Synchro> pseudoranges);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Represents GPS time in the date time format. Leap years are considered, but leap seconds are not.
|
* \brief Represents GPS time in the date time format. Leap years are considered, but leap seconds are not.
|
||||||
*/
|
*/
|
||||||
@ -165,6 +176,7 @@ private:
|
|||||||
std::string navfilename;
|
std::string navfilename;
|
||||||
std::string obsfilename;
|
std::string obsfilename;
|
||||||
std::string sbsfilename;
|
std::string sbsfilename;
|
||||||
|
std::string navGalfilename;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Generates the data for the PGM / RUN BY / DATE line
|
* Generates the data for the PGM / RUN BY / DATE line
|
||||||
|
@ -267,22 +267,17 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols,int
|
|||||||
Galileo_Almanac almanac=d_nav.get_almanac();
|
Galileo_Almanac almanac=d_nav.get_almanac();
|
||||||
d_almanac_queue->push(almanac);
|
d_almanac_queue->push(almanac);
|
||||||
//debug
|
//debug
|
||||||
std::cout<<"Almanac received!"<<std::endl;
|
std::cout << "Almanac received!" << std::endl;
|
||||||
std::cout<<"GPS_to_Galileo time conversion:"<<std::endl;
|
LOG(INFO) << "GPS_to_Galileo time conversion:";
|
||||||
std::cout<<"A0G="<<almanac.A_0G_10<<std::endl;
|
LOG(INFO) << "A0G=" << almanac.A_0G_10;
|
||||||
std::cout<<"A1G="<<almanac.A_1G_10<<std::endl;
|
LOG(INFO) << "A1G=" << almanac.A_1G_10;
|
||||||
std::cout<<"T0G="<<almanac.t_0G_10<<std::endl;
|
LOG(INFO) << "T0G=" << almanac.t_0G_10;
|
||||||
std::cout<<"WN_0G_10="<<almanac.WN_0G_10<<std::endl;
|
LOG(INFO) << "WN_0G_10=" << almanac.WN_0G_10;
|
||||||
|
LOG(INFO) << "Current parameters:";
|
||||||
std::cout<<"Actual parameters:"<<std::endl;
|
LOG(INFO) << "d_TOW_at_current_symbol="<< d_TOW_at_current_symbol;
|
||||||
std::cout<<"d_TOW_at_current_symbol="<<d_TOW_at_current_symbol<<std::endl;
|
LOG(INFO) << "d_nav.WN_0=" << d_nav.WN_0;
|
||||||
std::cout<<"d_nav.WN_0="<<d_nav.WN_0<<std::endl;
|
delta_t = almanac.A_0G_10 + almanac.A_1G_10 * (d_TOW_at_current_symbol - almanac.t_0G_10 + 604800 * (fmod((d_nav.WN_0 - almanac.WN_0G_10), 64)));
|
||||||
|
LOG(INFO) << "delta_t=" << delta_t << "[s]";
|
||||||
|
|
||||||
delta_t=almanac.A_0G_10+almanac.A_1G_10*(d_TOW_at_current_symbol-almanac.t_0G_10+604800*(fmod((d_nav.WN_0-almanac.WN_0G_10),64)));
|
|
||||||
|
|
||||||
std::cout<<"delta_t="<<delta_t<<"[s]"<<std::endl;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -407,7 +407,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items, gr_ve
|
|||||||
T_prn_samples = T_prn_seconds * (double)d_fs_in;
|
T_prn_samples = T_prn_seconds * (double)d_fs_in;
|
||||||
K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * (double)d_fs_in;
|
K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * (double)d_fs_in;
|
||||||
d_current_prn_length_samples = round(K_blk_samples); //round to a discrete samples
|
d_current_prn_length_samples = round(K_blk_samples); //round to a discrete samples
|
||||||
d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample
|
//d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample
|
||||||
|
|
||||||
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
||||||
if (d_cn0_estimation_counter < CN0_ESTIMATION_SAMPLES)
|
if (d_cn0_estimation_counter < CN0_ESTIMATION_SAMPLES)
|
||||||
@ -453,7 +453,9 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items, gr_ve
|
|||||||
current_synchro_data.Prompt_I = (double)(*d_Prompt).real();
|
current_synchro_data.Prompt_I = (double)(*d_Prompt).real();
|
||||||
current_synchro_data.Prompt_Q = (double)(*d_Prompt).imag();
|
current_synchro_data.Prompt_Q = (double)(*d_Prompt).imag();
|
||||||
// Tracking_timestamp_secs is aligned with the PRN start sample
|
// Tracking_timestamp_secs is aligned with the PRN start sample
|
||||||
current_synchro_data.Tracking_timestamp_secs = ((double)d_sample_counter + (double)d_next_prn_length_samples + (double)d_next_rem_code_phase_samples)/(double)d_fs_in;
|
//current_synchro_data.Tracking_timestamp_secs = ((double)d_sample_counter + (double)d_next_prn_length_samples + (double)d_next_rem_code_phase_samples)/(double)d_fs_in;
|
||||||
|
current_synchro_data.Tracking_timestamp_secs = ((double)d_sample_counter + (double)d_rem_code_phase_samples)/(double)d_fs_in;
|
||||||
|
d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample
|
||||||
// This tracking block aligns the Tracking_timestamp_secs with the start sample of the PRN, thus, Code_phase_secs=0
|
// This tracking block aligns the Tracking_timestamp_secs with the start sample of the PRN, thus, Code_phase_secs=0
|
||||||
current_synchro_data.Code_phase_secs = 0;
|
current_synchro_data.Code_phase_secs = 0;
|
||||||
current_synchro_data.Carrier_phase_rads = (double)d_acc_carrier_phase_rad;
|
current_synchro_data.Carrier_phase_rads = (double)d_acc_carrier_phase_rad;
|
||||||
|
@ -522,13 +522,15 @@ int Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::general_work (int noutput_items, gr_vecto
|
|||||||
|
|
||||||
K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_samples;
|
K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_samples;
|
||||||
d_current_prn_length_samples = round(K_blk_samples); //round to a discrete sample
|
d_current_prn_length_samples = round(K_blk_samples); //round to a discrete sample
|
||||||
d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error
|
//d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error
|
||||||
|
|
||||||
// ########### Output the tracking data to navigation and PVT ##########
|
// ########### Output the tracking data to navigation and PVT ##########
|
||||||
current_synchro_data.Prompt_I = (double)(*d_Prompt).real();
|
current_synchro_data.Prompt_I = (double)(*d_Prompt).real();
|
||||||
current_synchro_data.Prompt_Q = (double)(*d_Prompt).imag();
|
current_synchro_data.Prompt_Q = (double)(*d_Prompt).imag();
|
||||||
// Tracking_timestamp_secs is aligned with the PRN start sample
|
// Tracking_timestamp_secs is aligned with the PRN start sample
|
||||||
current_synchro_data.Tracking_timestamp_secs = ((double)d_sample_counter + (double)d_current_prn_length_samples + (double)d_rem_code_phase_samples) / (double)d_fs_in;
|
//current_synchro_data.Tracking_timestamp_secs = ((double)d_sample_counter + (double)d_current_prn_length_samples + (double)d_rem_code_phase_samples) / (double)d_fs_in;
|
||||||
|
current_synchro_data.Tracking_timestamp_secs = ((double)d_sample_counter + (double)d_rem_code_phase_samples)/(double)d_fs_in;
|
||||||
|
d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample
|
||||||
// This tracking block aligns the Tracking_timestamp_secs with the start sample of the PRN, Code_phase_secs=0
|
// This tracking block aligns the Tracking_timestamp_secs with the start sample of the PRN, Code_phase_secs=0
|
||||||
current_synchro_data.Code_phase_secs = 0;
|
current_synchro_data.Code_phase_secs = 0;
|
||||||
current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad;
|
current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad;
|
||||||
|
@ -424,7 +424,7 @@ int Gps_L1_Ca_Dll_Pll_Optim_Tracking_cc::general_work (int noutput_items, gr_vec
|
|||||||
T_prn_samples = T_prn_seconds * (double)d_fs_in;
|
T_prn_samples = T_prn_seconds * (double)d_fs_in;
|
||||||
K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * (double)d_fs_in;
|
K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * (double)d_fs_in;
|
||||||
d_current_prn_length_samples = round(K_blk_samples); //round to a discrete samples
|
d_current_prn_length_samples = round(K_blk_samples); //round to a discrete samples
|
||||||
d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample
|
//d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample
|
||||||
|
|
||||||
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
// ####### CN0 ESTIMATION AND LOCK DETECTORS ######
|
||||||
if (d_cn0_estimation_counter < CN0_ESTIMATION_SAMPLES)
|
if (d_cn0_estimation_counter < CN0_ESTIMATION_SAMPLES)
|
||||||
@ -466,7 +466,9 @@ int Gps_L1_Ca_Dll_Pll_Optim_Tracking_cc::general_work (int noutput_items, gr_vec
|
|||||||
current_synchro_data.Prompt_I = (double)(*d_Prompt).real();
|
current_synchro_data.Prompt_I = (double)(*d_Prompt).real();
|
||||||
current_synchro_data.Prompt_Q = (double)(*d_Prompt).imag();
|
current_synchro_data.Prompt_Q = (double)(*d_Prompt).imag();
|
||||||
// Tracking_timestamp_secs is aligned with the PRN start sample
|
// Tracking_timestamp_secs is aligned with the PRN start sample
|
||||||
current_synchro_data.Tracking_timestamp_secs = ((double)d_sample_counter + (double)d_current_prn_length_samples + (double)d_rem_code_phase_samples) / (double)d_fs_in;
|
//current_synchro_data.Tracking_timestamp_secs = ((double)d_sample_counter + (double)d_current_prn_length_samples + (double)d_rem_code_phase_samples) / (double)d_fs_in;
|
||||||
|
current_synchro_data.Tracking_timestamp_secs = ((double)d_sample_counter + (double)d_rem_code_phase_samples)/(double)d_fs_in;
|
||||||
|
d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample
|
||||||
// This tracking block aligns the Tracking_timestamp_secs with the start sample of the PRN, thus, Code_phase_secs=0
|
// This tracking block aligns the Tracking_timestamp_secs with the start sample of the PRN, thus, Code_phase_secs=0
|
||||||
current_synchro_data.Code_phase_secs = 0;
|
current_synchro_data.Code_phase_secs = 0;
|
||||||
current_synchro_data.Carrier_phase_rads = (double)d_acc_carrier_phase_rad;
|
current_synchro_data.Carrier_phase_rads = (double)d_acc_carrier_phase_rad;
|
||||||
|
@ -465,7 +465,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items, gr_vec
|
|||||||
T_prn_seconds = T_chip_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS;
|
T_prn_seconds = T_chip_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS;
|
||||||
T_prn_samples = T_prn_seconds * (double)d_fs_in;
|
T_prn_samples = T_prn_seconds * (double)d_fs_in;
|
||||||
d_rem_code_phase_samples = d_next_rem_code_phase_samples;
|
d_rem_code_phase_samples = d_next_rem_code_phase_samples;
|
||||||
K_blk_samples = T_prn_samples + d_rem_code_phase_samples;//-code_error*(double)d_fs_in;
|
//K_blk_samples = T_prn_samples + d_rem_code_phase_samples;//-code_error*(double)d_fs_in;
|
||||||
|
|
||||||
// Update the current PRN delay (code phase in samples)
|
// Update the current PRN delay (code phase in samples)
|
||||||
double T_prn_true_seconds = GPS_L1_CA_CODE_LENGTH_CHIPS / GPS_L1_CA_CODE_RATE_HZ;
|
double T_prn_true_seconds = GPS_L1_CA_CODE_LENGTH_CHIPS / GPS_L1_CA_CODE_RATE_HZ;
|
||||||
@ -523,6 +523,13 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items, gr_vec
|
|||||||
|
|
||||||
current_synchro_data.Prompt_I = (double)(*d_Prompt).real();
|
current_synchro_data.Prompt_I = (double)(*d_Prompt).real();
|
||||||
current_synchro_data.Prompt_Q = (double)(*d_Prompt).imag();
|
current_synchro_data.Prompt_Q = (double)(*d_Prompt).imag();
|
||||||
|
// Tracking_timestamp_secs is aligned with the CURRENT PRN start sample (Hybridization OK!, but some glitches??)
|
||||||
|
current_synchro_data.Tracking_timestamp_secs = ((double)d_sample_counter + (double)d_rem_code_phase_samples)/(double)d_fs_in;
|
||||||
|
//compute remnant code phase samples AFTER the Tracking timestamp
|
||||||
|
d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample
|
||||||
|
|
||||||
|
// This tracking block aligns the Tracking_timestamp_secs with the start sample of the PRN, thus, Code_phase_secs=0
|
||||||
|
current_synchro_data.Code_phase_secs = 0;
|
||||||
current_synchro_data.Tracking_timestamp_secs = d_sample_counter_seconds;
|
current_synchro_data.Tracking_timestamp_secs = d_sample_counter_seconds;
|
||||||
current_synchro_data.Carrier_phase_rads = (double)d_acc_carrier_phase_rad;
|
current_synchro_data.Carrier_phase_rads = (double)d_acc_carrier_phase_rad;
|
||||||
current_synchro_data.Carrier_Doppler_hz = (double)d_carrier_doppler_hz;
|
current_synchro_data.Carrier_Doppler_hz = (double)d_carrier_doppler_hz;
|
||||||
|
Loading…
Reference in New Issue
Block a user