From 5c867e084e4a22e6f07fff4b2e7f940750fe41e8 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 2 Sep 2014 19:04:03 +0200 Subject: [PATCH 1/6] Added Galileo almanac management (credits to Javier Arribas) --- .../PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc | 6 ++++++ src/algorithms/PVT/libs/galileo_e1_ls_pvt.h | 1 + src/core/receiver/control_thread.cc | 15 +++++++++++++++ src/core/receiver/control_thread.h | 6 ++++++ 4 files changed, 28 insertions(+) diff --git a/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc index ee4bb40c7..d7fa8e706 100644 --- a/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc @@ -48,6 +48,7 @@ using google::LogMessage; extern concurrent_map global_galileo_ephemeris_map; extern concurrent_map global_galileo_iono_map; extern concurrent_map global_galileo_utc_model_map; +extern concurrent_map global_galileo_almanac_map; galileo_e1_pvt_cc_sptr galileo_e1_make_pvt_cc(unsigned int nchannels, boost::shared_ptr queue, bool dump, std::string dump_filename, int averaging_depth, bool flag_averaging, int output_rate_ms, int display_rate_ms, bool flag_nmea_tty_port, std::string nmea_dump_filename, std::string nmea_dump_devname) @@ -163,6 +164,11 @@ int galileo_e1_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_it global_galileo_iono_map.read(0, d_ls_pvt->galileo_iono); } + if (global_galileo_almanac_map.size() > 0) + { + // Almanac data is shared for all the Galileo satellites. Read always at ID=0 + global_galileo_almanac_map.read(0, d_ls_pvt->galileo_almanac); + } // ############ 2 COMPUTE THE PVT ################################ if (gnss_pseudoranges_map.size() > 0 and d_ls_pvt->galileo_ephemeris_map.size() > 0) { diff --git a/src/algorithms/PVT/libs/galileo_e1_ls_pvt.h b/src/algorithms/PVT/libs/galileo_e1_ls_pvt.h index 277e3b3cb..a185c4ab1 100644 --- a/src/algorithms/PVT/libs/galileo_e1_ls_pvt.h +++ b/src/algorithms/PVT/libs/galileo_e1_ls_pvt.h @@ -77,6 +77,7 @@ public: std::map galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris Galileo_Utc_Model galileo_utc_model; Galileo_Iono galileo_iono; + Galileo_Almanac galileo_almanac; double d_galileo_current_time; boost::posix_time::ptime d_position_UTC_time; diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 88674d052..29c3814b5 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -162,6 +162,7 @@ void ControlThread::run() galileo_ephemeris_data_collector_thread_ = boost::thread(&ControlThread::galileo_ephemeris_data_collector, this); galileo_iono_data_collector_thread_ = boost::thread(&ControlThread::galileo_iono_data_collector, this); + galileo_almanac_data_collector_thread_ = boost::thread(&ControlThread::galileo_almanac_data_collector, this); galileo_utc_model_data_collector_thread_ = boost::thread(&ControlThread::galileo_utc_model_data_collector, this); // Main loop to read and process the control messages while (flowgraph_->running() && !stop_) @@ -729,6 +730,20 @@ void ControlThread::gps_iono_data_collector() } +void ControlThread::galileo_almanac_data_collector() +{ + // ############ 1.bis READ ALMANAC QUEUE #################### + Galileo_Almanac galileo_almanac; + while(stop_ == false) + { + global_galileo_almanac_queue.wait_and_pop(galileo_almanac); + + LOG(INFO) << "New galileo_almanac record has arrived "; + // there is no timestamp for the galileo_almanac data, new entries must always be added + global_galileo_almanac_map.write(0, galileo_almanac); + } +} + void ControlThread::galileo_iono_data_collector() { Galileo_Iono galileo_iono; diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h index df8c25ac2..c83032c8f 100644 --- a/src/core/receiver/control_thread.h +++ b/src/core/receiver/control_thread.h @@ -178,6 +178,11 @@ private: */ void galileo_iono_data_collector(); + /* + * Blocking function that reads the galileo_almanac queue and updates the shared map, accessible from the PVT block + */ + void galileo_almanac_data_collector(); + void apply_action(unsigned int what); std::shared_ptr flowgraph_; std::shared_ptr configuration_; @@ -200,6 +205,7 @@ private: boost::thread galileo_ephemeris_data_collector_thread_; boost::thread galileo_utc_model_data_collector_thread_; boost::thread galileo_iono_data_collector_thread_; + boost::thread galileo_almanac_data_collector_thread_; void keyboard_listener(); // default filename for assistance data From f81164070591474e053b801cdfd4d52d5d648fd3 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 2 Sep 2014 20:21:05 +0200 Subject: [PATCH 2/6] Adding galileo_almanac missing thread --- src/core/receiver/control_thread.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 29c3814b5..113c68db8 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -185,6 +185,7 @@ void ControlThread::run() //Join Galileo threads galileo_ephemeris_data_collector_thread_.timed_join(boost::posix_time::seconds(1)); galileo_iono_data_collector_thread_.timed_join(boost::posix_time::seconds(1)); + galileo_almanac_data_collector_thread_.timed_join(boost::posix_time::seconds(1)); galileo_utc_model_data_collector_thread_.timed_join(boost::posix_time::seconds(1)); //Join keyboard threads From 358f29f3052444d7ac30530706b097597c9c382a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 3 Sep 2014 07:58:57 +0200 Subject: [PATCH 3/6] Some fixes in the RINEX 3.01 printer --- .../PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc | 4 ++-- src/algorithms/PVT/libs/rinex_printer.cc | 23 +++++++++---------- src/algorithms/PVT/libs/rinex_printer.h | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc index d7fa8e706..4162e6876 100644 --- a/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc @@ -166,7 +166,7 @@ int galileo_e1_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_it if (global_galileo_almanac_map.size() > 0) { - // Almanac data is shared for all the Galileo satellites. Read always at ID=0 + // Almanac data global_galileo_almanac_map.read(0, d_ls_pvt->galileo_almanac); } // ############ 2 COMPUTE THE PVT ################################ @@ -192,7 +192,7 @@ int galileo_e1_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_it if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) { rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); b_rinex_header_writen = true; // do not write header anymore } } diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 189267b7d..8b1a37eb1 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -356,9 +356,8 @@ std::string Rinex_Printer::getLocalTime() } -void Rinex_Printer::rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Galileo_Utc_Model utc_model) +void Rinex_Printer::rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Galileo_Utc_Model utc_model, Galileo_Almanac galileo_almanac) { - std::string line; stringVersion = "3.01"; version = 3; @@ -435,25 +434,25 @@ void Rinex_Printer::rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Gali out << line << std::endl; // -------- Line system time correction 2 - /* line.clear(); + 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(utc_model.XXX), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.XXX), 5); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_almanac.A_0G_10, 16, 2), 18); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_almanac.A_1G_10, 15, 2), 16); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.t0t_6), 7); + line += Rinex_Printer::rightJustify(boost::lexical_cast(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;*/ + 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(static_cast(utc_model.Delta_tLS_6)), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(static_cast(utc_model.Delta_tLSF_6)), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(static_cast(utc_model.WN_LSF_6)), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(static_cast(utc_model.DN_6)), 6); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.Delta_tLS_6), 6); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.Delta_tLSF_6), 6); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.WN_LSF_6), 6); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.DN_6), 6); line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h index 52a0e0340..94fc616bb 100644 --- a/src/algorithms/PVT/libs/rinex_printer.h +++ b/src/algorithms/PVT/libs/rinex_printer.h @@ -97,7 +97,7 @@ public: /*! * \brief Generates the Galileo Navigation Data header */ - void rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Galileo_Utc_Model utc_model); + void rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Galileo_Utc_Model utc_model, Galileo_Almanac galileo_almanac); /*! * \brief Generates the GPS Observation data header From 90b2b25b5c457e0deace0ad3a6586ab6e0a60b2c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 3 Sep 2014 18:57:37 +0200 Subject: [PATCH 4/6] Improvements in the Galileo RINEX printer --- src/algorithms/PVT/libs/rinex_printer.cc | 46 +++++++++++++------ src/algorithms/PVT/libs/rinex_printer.h | 20 +++++++- .../system_parameters/galileo_ephemeris.cc | 8 ++++ .../system_parameters/galileo_ephemeris.h | 10 ++++ .../galileo_navigation_message.cc | 10 ++++ 5 files changed, 80 insertions(+), 14 deletions(-) diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 8b1a37eb1..9d52df333 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -438,8 +438,8 @@ void Rinex_Printer::rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Gal line += std::string("GPGA"); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_almanac.A_0G_10, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_almanac.A_1G_10, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.t0t_6), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.WNot_6), 5); + line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_almanac.t_0G_10), 7); + line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_almanac.WN_0G_10), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -1147,12 +1147,17 @@ void Rinex_Printer::log_rinex_nav(std::ofstream& out, std::mapsecond.iDot_2, 18, 2); line += std::string(1, ' '); - double zero = 0.0; - line += Rinex_Printer::doub2for(zero, 18, 2); + //double one = 1.0; // INAV E1-B + std::string iNAVE1B("1000000001"); + int data_source_INAV = Rinex_Printer::toInt(iNAVE1B, 10); + line += Rinex_Printer::doub2for(static_cast(data_source_INAV), 18, 2); line += std::string(1, ' '); - double Galileo_week_continuous_number = (double)(galileo_ephemeris_iter->second.WN_5); + double GST_week = (double)(galileo_ephemeris_iter->second.WN_5); + double num_GST_rollovers = floor((GST_week + 1024.0) / 4096.0 ); + double Galileo_week_continuous_number = GST_week + 1024.0 + num_GST_rollovers * 4096.0; line += Rinex_Printer::doub2for(Galileo_week_continuous_number, 18, 2); line += std::string(1, ' '); + double zero = 0.0; line += Rinex_Printer::doub2for(zero, 18, 2); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -1161,13 +1166,29 @@ void Rinex_Printer::log_rinex_nav(std::ofstream& out, std::mapsecond.SISA_3, 18, 2); // Not read by eph! + //double minusone = -1.0; // Unknown + //line += Rinex_Printer::doub2for(minusone, 18, 2); line += std::string(1, ' '); - line += Rinex_Printer::doub2for(zero, 18, 2); // + std::string E1B_HS, E5B_HS; + if (galileo_ephemeris_iter->second.E1B_HS_5 == 0) E1B_HS = "00"; + if (galileo_ephemeris_iter->second.E1B_HS_5 == 1) E1B_HS = "01"; + if (galileo_ephemeris_iter->second.E1B_HS_5 == 2) E1B_HS = "10"; + if (galileo_ephemeris_iter->second.E1B_HS_5 == 3) E1B_HS = "11"; + if (galileo_ephemeris_iter->second.E5b_HS_5 == 0) E5B_HS = "00"; + if (galileo_ephemeris_iter->second.E5b_HS_5 == 1) E5B_HS = "01"; + if (galileo_ephemeris_iter->second.E5b_HS_5 == 2) E5B_HS = "10"; + if (galileo_ephemeris_iter->second.E5b_HS_5 == 3) E5B_HS = "11"; + std::string SVhealth_str = boost::lexical_cast(galileo_ephemeris_iter->second.E1B_DVS_5) + + E1B_HS + boost::lexical_cast(galileo_ephemeris_iter->second.E1B_DVS_5) + + "1" + "11" + boost::lexical_cast(galileo_ephemeris_iter->second.E5b_DVS_5) + + E5B_HS; + int SVhealth = Rinex_Printer::toInt(SVhealth_str, 9); + line += Rinex_Printer::doub2for(static_cast(SVhealth), 18, 2); // line += std::string(1, ' '); - line += Rinex_Printer::doub2for(zero, 18, 2); // + line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.BGD_E1E5a_5, 18, 2); // line += std::string(1, ' '); - line += Rinex_Printer::doub2for(zero, 18, 2); // + line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.BGD_E1E5b_5, 18, 2); // Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -1360,7 +1381,7 @@ void Rinex_Printer::rinex_obs_header(std::ofstream& out, Gps_Ephemeris eph, doub line += std::string(1, ' '); line += observationType["DOPPLER"]; line += observationCode["GPS_L1_CA"]; - // GPS L! CA SIGNAL STRENGTH + // GPS L1 CA SIGNAL STRENGTH line += std::string(1, ' '); line += observationType["SIGNAL_STRENGTH"]; line += observationCode["GPS_L1_CA"]; @@ -2115,9 +2136,8 @@ boost::posix_time::ptime Rinex_Printer::compute_GPS_time(Gps_Ephemeris eph, doub 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) + // The RINEX v2.11 v3.00 format uses Galileo time for the observations epoch, not UTC time, thus, no leap seconds needed here. + // (see Pag. 17 in http://igscb.jpl.nasa.gov/igscb/data/format/rinex301.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); // diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h index 94fc616bb..ca5c1ec7f 100644 --- a/src/algorithms/PVT/libs/rinex_printer.h +++ b/src/algorithms/PVT/libs/rinex_printer.h @@ -333,6 +333,9 @@ private: inline double asDouble(const std::string& s) { return strtod(s.c_str(), 0); } + + inline int toInt(std::string bitString, int sLength); + /* * Convert a string to an integer. * @param s string containing a number. @@ -342,7 +345,6 @@ private: { return strtol(s.c_str(), 0, 10); } - /* * Convert a double to a string in fixed notation. * @param x double. @@ -580,6 +582,22 @@ inline std::string Rinex_Printer::asFixWidthString(const int x, const int width, return ss.str().substr(ss.str().size() - width); } +inline long asInt(const std::string& s) + { return strtol(s.c_str(), 0, 10); } + + +inline int Rinex_Printer::toInt(std::string bitString, int sLength) +{ + int tempInt; + int num = 0; + for(int i=0; i < sLength; i++) + { + tempInt = bitString[i]-'0'; + num |= (1 << (sLength-1-i)) * tempInt; + } + return num; +} + template inline std::string Rinex_Printer::asString(const X x) diff --git a/src/core/system_parameters/galileo_ephemeris.cc b/src/core/system_parameters/galileo_ephemeris.cc index 1fa53edbc..5b9be9681 100644 --- a/src/core/system_parameters/galileo_ephemeris.cc +++ b/src/core/system_parameters/galileo_ephemeris.cc @@ -61,6 +61,14 @@ Galileo_Ephemeris::Galileo_Ephemeris() /*GST*/ WN_5 = 0; TOW_5 = 0; + // SV status + SISA_3 = 0; + E5b_HS_5 = 0; + E1B_HS_5 = 0; + E5b_DVS_5 = 0; + E1B_DVS_5 = 0; + BGD_E1E5a_5 = 0; //!< E1-E5a Broadcast Group Delay [s] + BGD_E1E5b_5 = 0; //!< E1-E5b Broadcast Group Delay [s] } diff --git a/src/core/system_parameters/galileo_ephemeris.h b/src/core/system_parameters/galileo_ephemeris.h index 62d3c032b..64d2f12d4 100644 --- a/src/core/system_parameters/galileo_ephemeris.h +++ b/src/core/system_parameters/galileo_ephemeris.h @@ -83,6 +83,16 @@ public: double Galileo_satClkDrift; double Galileo_dtr; //!< relativistic clock correction term + // SV status + double SISA_3; + double E5b_HS_5; //!< E5b Signal Health Status + double E1B_HS_5; //!< E1B Signal Health Status + double E5b_DVS_5; //!< E5b Data Validity Status + double E1B_DVS_5; //!< E1B Data Validity Status + + double BGD_E1E5a_5; //!< E1-E5a Broadcast Group Delay [s] + double BGD_E1E5b_5; //!< E1-E5b Broadcast Group Delay [s] + // satellite positions double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index b9d014924..3e703fbc8 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -545,6 +545,16 @@ Galileo_Ephemeris Galileo_Navigation_Message::get_ephemeris() /*GST*/ ephemeris.WN_5 = WN_5; // Week number ephemeris.TOW_5 = TOW_5; // Time of Week + + ephemeris.SISA_3 = SISA_3; + ephemeris.E5b_HS_5 = E5b_HS_5; // E5b Signal Health Status + ephemeris.E1B_HS_5 = E1B_HS_5; // E1B Signal Health Status + ephemeris.E5b_DVS_5 = E5b_DVS_5; // E5b Data Validity Status + ephemeris.E1B_DVS_5 = E1B_DVS_5; // E1B Data Validity Status + + ephemeris.BGD_E1E5a_5 = BGD_E1E5a_5; // E1-E5a Broadcast Group Delay [s] + ephemeris.BGD_E1E5b_5 = BGD_E1E5b_5; // E1-E5b Broadcast Group Delay [s] + return ephemeris; } From fe8ed5f45a788ebb3c1bd3bfec5e7d91760517f1 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 3 Sep 2014 21:55:09 +0200 Subject: [PATCH 5/6] Working on the RINEX printer for Galileo --- src/algorithms/PVT/libs/rinex_printer.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 9d52df333..ff63aede7 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -1170,7 +1170,8 @@ void Rinex_Printer::log_rinex_nav(std::ofstream& out, std::mapsecond.E1B_HS_5 == 0) E1B_HS = "00"; if (galileo_ephemeris_iter->second.E1B_HS_5 == 1) E1B_HS = "01"; if (galileo_ephemeris_iter->second.E1B_HS_5 == 2) E1B_HS = "10"; @@ -1179,10 +1180,12 @@ void Rinex_Printer::log_rinex_nav(std::ofstream& out, std::mapsecond.E5b_HS_5 == 1) E5B_HS = "01"; if (galileo_ephemeris_iter->second.E5b_HS_5 == 2) E5B_HS = "10"; if (galileo_ephemeris_iter->second.E5b_HS_5 == 3) E5B_HS = "11"; - std::string SVhealth_str = boost::lexical_cast(galileo_ephemeris_iter->second.E1B_DVS_5) + /* std::string SVhealth_str = boost::lexical_cast(galileo_ephemeris_iter->second.E1B_DVS_5) + E1B_HS + boost::lexical_cast(galileo_ephemeris_iter->second.E1B_DVS_5) + "1" + "11" + boost::lexical_cast(galileo_ephemeris_iter->second.E5b_DVS_5) - + E5B_HS; + + E5B_HS;*/ + std::string SVhealth_str = E5B_HS + boost::lexical_cast(galileo_ephemeris_iter->second.E5b_DVS_5) + "11" + "1" + boost::lexical_cast(galileo_ephemeris_iter->second.E1B_DVS_5) + E1B_HS + boost::lexical_cast(galileo_ephemeris_iter->second.E1B_DVS_5); + int SVhealth = Rinex_Printer::toInt(SVhealth_str, 9); line += Rinex_Printer::doub2for(static_cast(SVhealth), 18, 2); // line += std::string(1, ' '); From b3f60fd4c882c16fe5ad7c6415f9b8eebbb76305 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 4 Sep 2014 01:40:46 +0200 Subject: [PATCH 6/6] The RINEX printer now produces Galileo files that can be processed by RTKLIB --- src/algorithms/PVT/libs/rinex_printer.cc | 45 ++++++++++++++---------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index ff63aede7..50ff35900 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -1166,32 +1166,39 @@ void Rinex_Printer::log_rinex_nav(std::ofstream& out, std::mapsecond.SISA_3, 18, 2); // Not read by eph! - //double minusone = -1.0; // Unknown - //line += Rinex_Printer::doub2for(minusone, 18, 2); + //line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.SISA_3, 18, 2); + line += Rinex_Printer::doub2for(zero, 18, 2); // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID line += std::string(1, ' '); std::string E1B_HS; std::string E5B_HS; - if (galileo_ephemeris_iter->second.E1B_HS_5 == 0) E1B_HS = "00"; - if (galileo_ephemeris_iter->second.E1B_HS_5 == 1) E1B_HS = "01"; - if (galileo_ephemeris_iter->second.E1B_HS_5 == 2) E1B_HS = "10"; - if (galileo_ephemeris_iter->second.E1B_HS_5 == 3) E1B_HS = "11"; - if (galileo_ephemeris_iter->second.E5b_HS_5 == 0) E5B_HS = "00"; - if (galileo_ephemeris_iter->second.E5b_HS_5 == 1) E5B_HS = "01"; - if (galileo_ephemeris_iter->second.E5b_HS_5 == 2) E5B_HS = "10"; - if (galileo_ephemeris_iter->second.E5b_HS_5 == 3) E5B_HS = "11"; - /* std::string SVhealth_str = boost::lexical_cast(galileo_ephemeris_iter->second.E1B_DVS_5) - + E1B_HS + boost::lexical_cast(galileo_ephemeris_iter->second.E1B_DVS_5) - + "1" + "11" + boost::lexical_cast(galileo_ephemeris_iter->second.E5b_DVS_5) - + E5B_HS;*/ - std::string SVhealth_str = E5B_HS + boost::lexical_cast(galileo_ephemeris_iter->second.E5b_DVS_5) + "11" + "1" + boost::lexical_cast(galileo_ephemeris_iter->second.E1B_DVS_5) + E1B_HS + boost::lexical_cast(galileo_ephemeris_iter->second.E1B_DVS_5); + if(galileo_ephemeris_iter->second.E1B_HS_5 == 0) E1B_HS = "00"; + if(galileo_ephemeris_iter->second.E1B_HS_5 == 1) E1B_HS = "01"; + if(galileo_ephemeris_iter->second.E1B_HS_5 == 2) E1B_HS = "10"; + if(galileo_ephemeris_iter->second.E1B_HS_5 == 3) E1B_HS = "11"; + if(galileo_ephemeris_iter->second.E5b_HS_5 == 0) E5B_HS = "00"; + if(galileo_ephemeris_iter->second.E5b_HS_5 == 1) E5B_HS = "01"; + if(galileo_ephemeris_iter->second.E5b_HS_5 == 2) E5B_HS = "10"; + if(galileo_ephemeris_iter->second.E5b_HS_5 == 3) E5B_HS = "11"; + if(E1B_HS == "11") LOG(WARNING) << "Signal Component currently in Test"; + if(E1B_HS == "10") LOG(WARNING) << "Signal will be out of service"; + if(E1B_HS == "01") LOG(WARNING) << "Signal out of service"; + E1B_HS = "00"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID + + std::string E1B_DVS = boost::lexical_cast(galileo_ephemeris_iter->second.E1B_DVS_5); + if(E1B_DVS == "1") LOG(WARNING) << "Navigation data without guarantee"; + E1B_DVS = "0"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID + + std::string SVhealth_str = E5B_HS + boost::lexical_cast(galileo_ephemeris_iter->second.E5b_DVS_5) + + "11" + "1" + E1B_DVS + E1B_HS + + boost::lexical_cast(galileo_ephemeris_iter->second.E1B_DVS_5); + SVhealth_str = "000000000"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID int SVhealth = Rinex_Printer::toInt(SVhealth_str, 9); - line += Rinex_Printer::doub2for(static_cast(SVhealth), 18, 2); // + line += Rinex_Printer::doub2for(static_cast(SVhealth), 18, 2); line += std::string(1, ' '); - line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.BGD_E1E5a_5, 18, 2); // + line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.BGD_E1E5a_5, 18, 2); line += std::string(1, ' '); - line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.BGD_E1E5b_5, 18, 2); // + line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.BGD_E1E5b_5, 18, 2); Rinex_Printer::lengthCheck(line); out << line << std::endl;