From afd0ef8beeee700ed1935aa7cad971649def6ed2 Mon Sep 17 00:00:00 2001 From: Javier Date: Thu, 18 Oct 2018 10:11:07 +0200 Subject: [PATCH 1/3] Adding new position system test flags to set error thresholds --- src/tests/system-tests/libs/position_test_flags.h | 7 ++++++- src/tests/system-tests/position_test.cc | 12 ++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/tests/system-tests/libs/position_test_flags.h b/src/tests/system-tests/libs/position_test_flags.h index e911fb892..f6575c6d3 100644 --- a/src/tests/system-tests/libs/position_test_flags.h +++ b/src/tests/system-tests/libs/position_test_flags.h @@ -42,5 +42,10 @@ DEFINE_bool(use_ref_motion_file, false, "Enable or disable the use of a referenc DEFINE_int32(ref_motion_file_type, 1, "Type of reference motion file: 1- Spirent CSV motion file"); DEFINE_string(ref_motion_filename, std::string("motion.csv"), "Path and filename for the reference motion file"); DEFINE_string(pvt_solver_dump_filename, std::string("PVT_pvt.dat"), "Path and filename for the PVT solver binary dump file"); - +DEFINE_double(static_2D_error_m, 2.0, "Static scenario 2D (East, North) positioning error threshold [meters]"); +DEFINE_double(static_3D_error_m, 5.0, "Static scenario 3D (East, North, Up) positioning error threshold [meters]"); +DEFINE_double(accuracy_CEP, 2.0, "Static scenario 2D (East, North) accuracy Circular Error Position (CEP) threshold [meters]"); +DEFINE_double(precision_SEP, 10.0, "Static scenario 3D (East, North, Up) precision Spherical Error Position (SEP) threshold [meters]"); +DEFINE_double(dynamic_3D_position_RMSE, 10.0, "Dynamic scenario 3D (ECEF) accuracy RMSE threshold [meters]"); +DEFINE_double(dynamic_3D_velocity_RMSE, 5.0, "Dynamic scenario 3D (ECEF) accuracy RMSE threshold [meters/second]"); #endif diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index d6a46f3db..8cda047ed 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -634,10 +634,10 @@ void PositionSystemTest::check_results() double accuracy_CEP = 0.62 * sqrt(sigma_N_2_accuracy) + 0.56 * sqrt(sigma_E_2_accuracy); double precision_SEP = 0.51 * (sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision); - EXPECT_LT(static_2D_error_m, 2.0); - EXPECT_LT(static_2D_error_m, 5.0); - ASSERT_LT(accuracy_CEP, 2.0); - ASSERT_LT(precision_SEP, 5.0); + EXPECT_LT(static_2D_error_m, FLAGS_static_2D_error_m); + EXPECT_LT(static_2D_error_m, FLAGS_static_2D_error_m); + ASSERT_LT(accuracy_CEP, FLAGS_accuracy_CEP); + ASSERT_LT(precision_SEP, FLAGS_precision_SEP); if (FLAGS_plot_position_test == true) { @@ -841,8 +841,8 @@ void PositionSystemTest::check_results() //ERROR CHECK //todo: reduce the error tolerance or enable the option to pass the error tolerance by parameter - EXPECT_LT(rmse_R_eb_e, 10.0); //3D RMS positioning error less than 10 meters - EXPECT_LT(rmse_V_eb_e, 5.0); //3D RMS speed error less than 5 meters/s (18 km/h) + EXPECT_LT(rmse_R_eb_e, FLAGS_dynamic_3D_position_RMSE); //3D RMS positioning error less than 10 meters + EXPECT_LT(rmse_V_eb_e, FLAGS_dynamic_3D_velocity_RMSE); //3D RMS speed error less than 5 meters/s (18 km/h) } } From 5181c640a3a2e365f26cf049d88c2a5b327cbadb Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 18 Oct 2018 15:15:15 +0200 Subject: [PATCH 2/3] Add extraction of Galileo UTC and Galileo iono parameters from RINEX header --- src/core/system_parameters/galileo_iono.h | 25 ++++++ .../system_parameters/galileo_utc_model.h | 23 +++++ src/utils/rinex2assist/CMakeLists.txt | 3 +- src/utils/rinex2assist/main.cc | 89 ++++++++++++++++--- 4 files changed, 129 insertions(+), 11 deletions(-) diff --git a/src/core/system_parameters/galileo_iono.h b/src/core/system_parameters/galileo_iono.h index cc8af7392..90c861c12 100644 --- a/src/core/system_parameters/galileo_iono.h +++ b/src/core/system_parameters/galileo_iono.h @@ -32,6 +32,7 @@ #ifndef GNSS_SDR_GALILEO_IONO_H_ #define GNSS_SDR_GALILEO_IONO_H_ +#include /*! * \brief This class is a storage for the GALILEO IONOSPHERIC data as described in Galileo ICD paragraph 5.1.6 @@ -61,6 +62,30 @@ public: * Default constructor */ Galileo_Iono(); + + template + + /*! + * \brief Serialize is a boost standard method to be called by the boost XML serialization. + Here is used to save the iono data on disk file. + */ + inline void serialize(Archive& archive, const unsigned int version) + { + using boost::serialization::make_nvp; + if (version) + { + }; + archive& make_nvp("ai0_5", ai0_5); + archive& make_nvp("ai1_5", ai1_5); + archive& make_nvp("ai2_5", ai2_5); + archive& make_nvp("Region1_flag_5", Region1_flag_5); + archive& make_nvp("Region2_flag_5", Region2_flag_5); + archive& make_nvp("Region3_flag_5", Region3_flag_5); + archive& make_nvp("Region4_flag_5", Region4_flag_5); + archive& make_nvp("Region5_flag_5", Region5_flag_5); + archive& make_nvp("TOW_5", TOW_5); + archive& make_nvp("WN_5", WN_5); + } }; #endif diff --git a/src/core/system_parameters/galileo_utc_model.h b/src/core/system_parameters/galileo_utc_model.h index cc72d78e2..a4448ab19 100644 --- a/src/core/system_parameters/galileo_utc_model.h +++ b/src/core/system_parameters/galileo_utc_model.h @@ -33,6 +33,7 @@ #ifndef GNSS_SDR_GALILEO_UTC_MODEL_H_ #define GNSS_SDR_GALILEO_UTC_MODEL_H_ +#include /*! * \brief This class is a storage for the GALILEO UTC MODEL data as described in Galileo ICD @@ -58,6 +59,28 @@ public: * Default constructor */ Galileo_Utc_Model(); + + template + + /*! + * \brief Serialize is a boost standard method to be called by the boost XML serialization. + Here is used to save the UTC data on disk file. + */ + inline void serialize(Archive& archive, const unsigned int version) + { + using boost::serialization::make_nvp; + if (version) + { + }; + archive& make_nvp("A0_6", A0_6); + archive& make_nvp("A1_6", A1_6); + archive& make_nvp("Delta_tLS_6", Delta_tLS_6); + archive& make_nvp("t0t_6", t0t_6); + archive& make_nvp("WNot_6", WNot_6); + archive& make_nvp("WN_LSF_6", WN_LSF_6); + archive& make_nvp("DN_6", DN_6); + archive& make_nvp("Delta_tLSF_6", Delta_tLSF_6); + } }; #endif diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index 8bf5fb3a6..b7db9e90f 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -32,6 +32,8 @@ include_directories( ${GPSTK_INCLUDE_DIR} ) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") + add_executable(rinex2assist ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) target_link_libraries(rinex2assist @@ -45,7 +47,6 @@ if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}) endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) - add_custom_command(TARGET rinex2assist POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}/install/$) diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index 11792d040..b0d786e6c 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -32,6 +32,8 @@ #include "gps_ephemeris.h" #include "galileo_ephemeris.h" +#include "gps_utc_model.h" +#include "gps_iono.h" #include #include #include @@ -49,30 +51,29 @@ int main(int argc, char** argv) "This program comes with ABSOLUTELY NO WARRANTY;\n" + "See COPYING file to see a copy of the General Public License.\n \n" + "Usage: \n" + - " rinex2assist []"); + " rinex2assist "); google::SetUsageMessage(intro_help); google::SetVersionString("1.0"); google::ParseCommandLineFlags(&argc, &argv, true); - if ((argc < 2) or (argc > 3)) + if ((argc != 2)) { std::cerr << "Usage:" << std::endl; std::cerr << " " << argv[0] - << " []" + << " " << std::endl; google::ShutDownCommandLineFlags(); return 1; } std::string xml_filename; - if (argc == 3) - { - xml_filename = argv[2]; - } std::map eph_map; std::map eph_gal_map; + Gps_Utc_Model gps_utc_model; + Gps_Iono gps_iono; + int i = 0; int j = 0; try @@ -93,6 +94,31 @@ int main(int argc, char** argv) return 1; } + // Collect UTC parameters from RINEX header + if (hdr.fileSys.compare("G: (GPS)") == 0 || hdr.fileSys.compare("MIXED") == 0) + { + gps_utc_model.valid = (hdr.valid > 2147483648) ? true : false; + gps_utc_model.d_A1 = hdr.mapTimeCorr["GPUT"].A0; + gps_utc_model.d_A0 = hdr.mapTimeCorr["GPUT"].A1; + gps_utc_model.d_t_OT = hdr.mapTimeCorr["GPUT"].refSOW; + gps_utc_model.i_WN_T = hdr.mapTimeCorr["GPUT"].refWeek; + gps_utc_model.d_DeltaT_LS = hdr.leapSeconds; + gps_utc_model.i_WN_LSF = hdr.leapWeek; + gps_utc_model.i_DN = hdr.leapDay; + gps_utc_model.d_DeltaT_LSF = hdr.leapDelta; + + // Collect iono parameters from RINEX header + gps_iono.valid = (hdr.mapIonoCorr["GPSA"].param[0] == 0) ? false : true; + gps_iono.d_alpha0 = hdr.mapIonoCorr["GPSA"].param[0]; + gps_iono.d_alpha1 = hdr.mapIonoCorr["GPSA"].param[1]; + gps_iono.d_alpha2 = hdr.mapIonoCorr["GPSA"].param[2]; + gps_iono.d_alpha3 = hdr.mapIonoCorr["GPSA"].param[3]; + gps_iono.d_beta0 = hdr.mapIonoCorr["GPSB"].param[0]; + gps_iono.d_beta1 = hdr.mapIonoCorr["GPSB"].param[1]; + gps_iono.d_beta2 = hdr.mapIonoCorr["GPSB"].param[2]; + gps_iono.d_beta3 = hdr.mapIonoCorr["GPSB"].param[3]; + } + // Read navigation data while (rnffs >> rne) { @@ -185,7 +211,7 @@ int main(int argc, char** argv) return 1; } - // Write XML + // Write XML ephemeris if (i != 0) { std::ofstream ofs; @@ -201,10 +227,11 @@ int main(int argc, char** argv) } catch (std::exception& e) { - std::cerr << "Problem creating the XML file: " << e.what() << std::endl; + std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << std::endl; google::ShutDownCommandLineFlags(); return 1; } + std::cout << "Generated file: " << xml_filename << std::endl; } if (j != 0) { @@ -218,11 +245,53 @@ int main(int argc, char** argv) } catch (std::exception& e) { - std::cerr << "Problem creating the XML file: " << e.what() << std::endl; + std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << std::endl; google::ShutDownCommandLineFlags(); return 1; } + std::cout << "Generated file: " << xml_filename << std::endl; } + + // Write XML UTC + if (gps_utc_model.valid) + { + std::ofstream ofs3; + xml_filename = "gps_UTC.xml"; + try + { + ofs3.open(xml_filename.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs3); + xml << boost::serialization::make_nvp("GNSS-SDR_gps_utc", gps_utc_model); + } + catch (std::exception& e) + { + std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << std::endl; + google::ShutDownCommandLineFlags(); + return 1; + } + std::cout << "Generated file: " << xml_filename << std::endl; + } + + // Write XML iono + if (gps_iono.valid) + { + std::ofstream ofs4; + xml_filename = "gps_iono.xml"; + try + { + ofs4.open(xml_filename.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs4); + xml << boost::serialization::make_nvp("GNSS-SDR_gps_iono", gps_iono); + } + catch (std::exception& e) + { + std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << std::endl; + google::ShutDownCommandLineFlags(); + return 1; + } + std::cout << "Generated file: " << xml_filename << std::endl; + } + google::ShutDownCommandLineFlags(); return 0; } From aca2b28a4d0b2cbe5c13a6c131868aaf9b170326 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 18 Oct 2018 15:46:48 +0200 Subject: [PATCH 3/3] Add Galileo UTC and iono model parameters to the assistance system --- src/core/libs/gnss_sdr_supl_client.cc | 38 ++++++++++++++++ src/core/libs/gnss_sdr_supl_client.h | 16 ++++++- src/core/receiver/control_thread.cc | 62 ++++++++++++++++----------- src/core/receiver/control_thread.h | 2 + src/utils/rinex2assist/main.cc | 61 ++++++++++++++++++++++++++ 5 files changed, 153 insertions(+), 26 deletions(-) diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index 2e43e9708..b571baefe 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -474,6 +474,25 @@ bool gnss_sdr_supl_client::load_utc_xml(const std::string file_name) } +bool gnss_sdr_supl_client::load_gal_utc_xml(const std::string file_name) +{ + std::ifstream ifs; + try + { + ifs.open(file_name.c_str(), std::ifstream::binary | std::ifstream::in); + boost::archive::xml_iarchive xml(ifs); + xml >> boost::serialization::make_nvp("GNSS-SDR_gal_utc_map", this->gal_utc); + LOG(INFO) << "Loaded Galileo UTC model data"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what() << "File: " << file_name; + return false; + } + return true; +} + + bool gnss_sdr_supl_client::save_utc_map_xml(const std::string file_name, std::map utc_map) { if (utc_map.empty() == false) @@ -520,6 +539,25 @@ bool gnss_sdr_supl_client::load_iono_xml(const std::string file_name) } +bool gnss_sdr_supl_client::load_gal_iono_xml(const std::string file_name) +{ + std::ifstream ifs; + try + { + ifs.open(file_name.c_str(), std::ifstream::binary | std::ifstream::in); + boost::archive::xml_iarchive xml(ifs); + xml >> boost::serialization::make_nvp("GNSS-SDR_iono_gal_map", this->gal_iono); + LOG(INFO) << "Loaded Galileo IONO model data"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what() << "File: " << file_name; + return false; + } + return true; +} + + bool gnss_sdr_supl_client::save_iono_map_xml(const std::string file_name, std::map iono_map) { if (iono_map.empty() == false) diff --git a/src/core/libs/gnss_sdr_supl_client.h b/src/core/libs/gnss_sdr_supl_client.h index eaa594390..14aa4fdc2 100644 --- a/src/core/libs/gnss_sdr_supl_client.h +++ b/src/core/libs/gnss_sdr_supl_client.h @@ -48,6 +48,8 @@ extern "C" #include "gps_ref_location.h" #include "gps_cnav_ephemeris.h" #include "galileo_ephemeris.h" +#include "galileo_utc_model.h" +#include "galileo_iono.h" #include #include #include @@ -86,10 +88,12 @@ public: // ionospheric model Gps_Iono gps_iono; + Galileo_Iono gal_iono; // reference time Gps_Ref_Time gps_time; // UTC model Gps_Utc_Model gps_utc; + Galileo_Utc_Model gal_utc; // reference location Gps_Ref_Location gps_ref_loc; // Acquisition Assistance map @@ -132,10 +136,15 @@ public: std::map eph_map); /*! - * \brief Read utc model from XML file + * \brief Read GPS utc model from XML file */ bool load_utc_xml(const std::string file_name); + /*! + * \brief Read Galileo utc model from XML file + */ + bool load_gal_utc_xml(const std::string file_name); + /*! * \brief Save utc model map to XML file * To be called by ControlThread::gps_utc_model_data_write_to_XML() @@ -148,6 +157,11 @@ public: */ bool load_iono_xml(const std::string file_name); + /*! + * \brief Read Galileo iono from XML file + */ + bool load_gal_iono_xml(const std::string file_name); + /*! * \brief Save iono map to XML file */ diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index d92a846b1..13e81fc35 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -201,10 +201,12 @@ bool ControlThread::read_assistance_from_XML() std::string eph_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_ephemeris_xml", eph_default_xml_filename); std::string utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_utc_model.xml", utc_default_xml_filename); std::string iono_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_iono_xml", iono_default_xml_filename); + std::string gal_iono_xml_filename = configuration_->property("GNSS-SDR.SUPL_gal_iono_xml", gal_iono_default_xml_filename); std::string ref_time_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_ref_time_xml", ref_time_default_xml_filename); std::string ref_location_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_ref_location_xml", ref_location_default_xml_filename); std::string eph_gal_xml_filename = configuration_->property("GNSS-SDR.SUPL_gal_ephemeris_xml", eph_gal_default_xml_filename); std::string eph_cnav_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_cnav_ephemeris_xml", eph_cnav_default_xml_filename); + std::string gal_utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_gal_utc_model.xml", gal_utc_default_xml_filename); std::cout << "Trying to read GNSS ephemeris from XML file(s): " << ((eph_xml_filename.compare(eph_default_xml_filename) != 0) ? eph_xml_filename + " " : "") @@ -253,39 +255,49 @@ bool ControlThread::read_assistance_from_XML() } ret = true; } + + if (supl_client_acquisition_.load_utc_xml(utc_xml_filename) == true) + { + std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_utc); + flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); + std::cout << "From XML file: Read GPS UTC parameters." << std::endl; + ret = true; + } + + if (supl_client_acquisition_.load_iono_xml(iono_xml_filename) == true) + { + std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_iono); + flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); + std::cout << "From XML file: Read GPS iono parameters." << std::endl; + ret = true; + } + + if (supl_client_acquisition_.load_gal_iono_xml(gal_iono_xml_filename) == true) + { + std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gal_iono); + flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); + std::cout << "From XML file: Read Galileo iono parameters." << std::endl; + ret = true; + } + + if (supl_client_acquisition_.load_gal_utc_xml(gal_utc_xml_filename) == true) + { + std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gal_utc); + flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); + std::cout << "From XML file: Read Galileo iono parameters." << std::endl; + ret = true; + } + if (ret == false) { std::cout << "ERROR: SUPL client error reading XML" << std::endl; std::cout << "Disabling SUPL assistance..." << std::endl; } - // Only look for {utc, iono, ref time, ref location} if SUPL is enabled + + // Only look for {ref time, ref location} if SUPL is enabled bool enable_gps_supl_assistance = configuration_->property("GNSS-SDR.SUPL_gps_enabled", false); if (enable_gps_supl_assistance == true) { - // Try to read UTC model from XML - if (supl_client_acquisition_.load_utc_xml(utc_xml_filename) == true) - { - LOG(INFO) << "SUPL: Read XML UTC model"; - std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_utc); - flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); - } - else - { - LOG(INFO) << "SUPL: couldn't read UTC model XML"; - } - - // Try to read Iono model from XML - if (supl_client_acquisition_.load_iono_xml(iono_xml_filename) == true) - { - LOG(INFO) << "SUPL: Read XML IONO model"; - std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_iono); - flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); - } - else - { - LOG(INFO) << "SUPL: couldn't read IONO model XML"; - } - // Try to read Ref Time from XML if (supl_client_acquisition_.load_ref_time_xml(ref_time_xml_filename) == true) { diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h index d4f1dccf3..b978b7757 100644 --- a/src/core/receiver/control_thread.h +++ b/src/core/receiver/control_thread.h @@ -169,6 +169,8 @@ private: const std::string ref_location_default_xml_filename = "./gps_ref_location.xml"; const std::string eph_gal_default_xml_filename = "./gal_ephemeris.xml"; const std::string eph_cnav_default_xml_filename = "./gps_cnav_ephemeris.xml"; + const std::string gal_iono_default_xml_filename = "./gal_iono.xml"; + const std::string gal_utc_default_xml_filename = "./gal_utc_model.xml"; }; #endif /*GNSS_SDR_CONTROL_THREAD_H_*/ diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index b0d786e6c..0ad37ab5e 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -34,6 +34,8 @@ #include "galileo_ephemeris.h" #include "gps_utc_model.h" #include "gps_iono.h" +#include "galileo_utc_model.h" +#include "galileo_iono.h" #include #include #include @@ -73,6 +75,8 @@ int main(int argc, char** argv) Gps_Utc_Model gps_utc_model; Gps_Iono gps_iono; + Galileo_Utc_Model gal_utc_model; + Galileo_Iono gal_iono; int i = 0; int j = 0; @@ -118,6 +122,27 @@ int main(int argc, char** argv) gps_iono.d_beta2 = hdr.mapIonoCorr["GPSB"].param[2]; gps_iono.d_beta3 = hdr.mapIonoCorr["GPSB"].param[3]; } + if (hdr.fileSys.compare("E: (GAL)") == 0 || hdr.fileSys.compare("MIXED") == 0) + { + gal_utc_model.A0_6 = hdr.mapTimeCorr["GAUT"].A0; + gal_utc_model.A1_6 = hdr.mapTimeCorr["GAUT"].A1; + gal_utc_model.Delta_tLS_6 = hdr.leapSeconds; + gal_utc_model.t0t_6 = hdr.mapTimeCorr["GAUT"].refSOW; + gal_utc_model.WNot_6 = hdr.mapTimeCorr["GAUT"].refWeek; + gal_utc_model.WN_LSF_6 = hdr.leapWeek; + gal_utc_model.DN_6 = hdr.leapDay; + gal_utc_model.Delta_tLSF_6 = hdr.leapDelta; + gal_iono.ai0_5 = hdr.mapIonoCorr["GAL"].param[0]; + gal_iono.ai1_5 = hdr.mapIonoCorr["GAL"].param[1]; + gal_iono.ai2_5 = hdr.mapIonoCorr["GAL"].param[2]; + gal_iono.Region1_flag_5 = false; + gal_iono.Region2_flag_5 = false; + gal_iono.Region3_flag_5 = false; + gal_iono.Region4_flag_5 = false; + gal_iono.Region5_flag_5 = false; + gal_iono.TOW_5 = 0.0; + gal_iono.WN_5 = 0.0; + } // Read navigation data while (rnffs >> rne) @@ -292,6 +317,42 @@ int main(int argc, char** argv) std::cout << "Generated file: " << xml_filename << std::endl; } + if (gal_utc_model.A0_6 != 0) + { + std::ofstream ofs5; + xml_filename = "gal_utc.xml"; + try + { + ofs5.open(xml_filename.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs5); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_utc", gal_utc_model); + } + catch (std::exception& e) + { + std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << std::endl; + google::ShutDownCommandLineFlags(); + return 1; + } + std::cout << "Generated file: " << xml_filename << std::endl; + } + if (gal_iono.ai0_5 != 0) + { + std::ofstream ofs7; + xml_filename = "gal_iono.xml"; + try + { + ofs7.open(xml_filename.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs7); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_iono", gal_iono); + } + catch (std::exception& e) + { + std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << std::endl; + google::ShutDownCommandLineFlags(); + return 1; + } + std::cout << "Generated file: " << xml_filename << std::endl; + } google::ShutDownCommandLineFlags(); return 0; }