From c45ca2c0ee1422a617752e3218f2340848bcbd53 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 20 Oct 2018 13:06:43 +0200 Subject: [PATCH 01/13] Add missing include path --- src/tests/system-tests/libs/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/system-tests/libs/CMakeLists.txt b/src/tests/system-tests/libs/CMakeLists.txt index 0fe1d4440..4742e80fc 100644 --- a/src/tests/system-tests/libs/CMakeLists.txt +++ b/src/tests/system-tests/libs/CMakeLists.txt @@ -25,6 +25,7 @@ set(SYSTEM_TESTING_LIB_SOURCES include_directories( ${CMAKE_CURRENT_SOURCE_DIR} + ${Boost_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS} ${MATIO_INCLUDE_DIRS} From 5ea52921661139da23a1e5ce67ce9c0086abfa93 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 20 Oct 2018 14:46:55 +0200 Subject: [PATCH 02/13] Only read XML assistance files if needed --- src/core/receiver/control_thread.cc | 136 +++++++++++++++------------- 1 file changed, 72 insertions(+), 64 deletions(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 98daa01b5..8fd295192 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -209,89 +209,97 @@ bool ControlThread::read_assistance_from_XML() std::string gal_utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_gal_utc_model.xml", gal_utc_default_xml_filename); std::string cnav_utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_cnav_utc_model.xml", cnav_utc_default_xml_filename); - std::cout << "Trying to read GNSS ephemeris from XML file(s)..." - << std::endl; + std::cout << "Trying to read GNSS ephemeris from XML file(s)..." << std::endl; - if (supl_client_ephemeris_.load_ephemeris_xml(eph_xml_filename) == true) + if (configuration_->property("Channels_1C.count", 0) > 0) { - std::map::const_iterator gps_eph_iter; - for (gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.cbegin(); - gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend(); - gps_eph_iter++) + if (supl_client_ephemeris_.load_ephemeris_xml(eph_xml_filename) == true) { - std::cout << "From XML file: Read NAV ephemeris for satellite " << Gnss_Satellite("GPS", gps_eph_iter->second.i_satellite_PRN) << std::endl; - std::shared_ptr tmp_obj = std::make_shared(gps_eph_iter->second); - flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); + std::map::const_iterator gps_eph_iter; + for (gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.cbegin(); + gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend(); + gps_eph_iter++) + { + std::cout << "From XML file: Read NAV ephemeris for satellite " << Gnss_Satellite("GPS", gps_eph_iter->second.i_satellite_PRN) << std::endl; + std::shared_ptr tmp_obj = std::make_shared(gps_eph_iter->second); + flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); + } + ret = true; } - ret = true; - } - if (supl_client_ephemeris_.load_gal_ephemeris_xml(eph_gal_xml_filename) == true) - { - std::map::const_iterator gal_eph_iter; - for (gal_eph_iter = supl_client_ephemeris_.gal_ephemeris_map.cbegin(); - gal_eph_iter != supl_client_ephemeris_.gal_ephemeris_map.cend(); - gal_eph_iter++) + if (supl_client_acquisition_.load_utc_xml(utc_xml_filename) == true) { - std::cout << "From XML file: Read ephemeris for satellite " << Gnss_Satellite("Galileo", gal_eph_iter->second.i_satellite_PRN) << std::endl; - std::shared_ptr tmp_obj = std::make_shared(gal_eph_iter->second); + 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; } - ret = true; - } - if (supl_client_ephemeris_.load_cnav_ephemeris_xml(eph_cnav_xml_filename) == true) - { - std::map::const_iterator gps_cnav_eph_iter; - for (gps_cnav_eph_iter = supl_client_ephemeris_.gps_cnav_ephemeris_map.cbegin(); - gps_cnav_eph_iter != supl_client_ephemeris_.gps_cnav_ephemeris_map.cend(); - gps_cnav_eph_iter++) + if (supl_client_acquisition_.load_iono_xml(iono_xml_filename) == true) { - std::cout << "From XML file: Read CNAV ephemeris for satellite " << Gnss_Satellite("GPS", gps_cnav_eph_iter->second.i_satellite_PRN) << std::endl; - std::shared_ptr tmp_obj = std::make_shared(gps_cnav_eph_iter->second); + 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; } - ret = true; } - if (supl_client_acquisition_.load_utc_xml(utc_xml_filename) == true) + if ((configuration_->property("Channels_1B.count", 0) > 0) or (configuration_->property("Channels_5X.count", 0) > 0)) { - 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_ephemeris_.load_gal_ephemeris_xml(eph_gal_xml_filename) == true) + { + std::map::const_iterator gal_eph_iter; + for (gal_eph_iter = supl_client_ephemeris_.gal_ephemeris_map.cbegin(); + gal_eph_iter != supl_client_ephemeris_.gal_ephemeris_map.cend(); + gal_eph_iter++) + { + std::cout << "From XML file: Read ephemeris for satellite " << Gnss_Satellite("Galileo", gal_eph_iter->second.i_satellite_PRN) << std::endl; + std::shared_ptr tmp_obj = std::make_shared(gal_eph_iter->second); + flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); + } + 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 UTC parameters." << std::endl; + ret = true; + } } - if (supl_client_acquisition_.load_iono_xml(iono_xml_filename) == true) + if ((configuration_->property("Channels_2S.count", 0) > 0) or (configuration_->property("Channels_L5.count", 0) > 0)) { - 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_ephemeris_.load_cnav_ephemeris_xml(eph_cnav_xml_filename) == true) + { + std::map::const_iterator gps_cnav_eph_iter; + for (gps_cnav_eph_iter = supl_client_ephemeris_.gps_cnav_ephemeris_map.cbegin(); + gps_cnav_eph_iter != supl_client_ephemeris_.gps_cnav_ephemeris_map.cend(); + gps_cnav_eph_iter++) + { + std::cout << "From XML file: Read CNAV ephemeris for satellite " << Gnss_Satellite("GPS", gps_cnav_eph_iter->second.i_satellite_PRN) << std::endl; + std::shared_ptr tmp_obj = std::make_shared(gps_cnav_eph_iter->second); + flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); + } + 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 UTC parameters." << std::endl; - ret = true; - } - - if (supl_client_acquisition_.load_cnav_utc_xml(cnav_utc_xml_filename) == true) - { - std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_cnav_utc); - flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); - std::cout << "From XML file: Read GPS CNAV UTC parameters." << std::endl; - ret = true; + if (supl_client_acquisition_.load_cnav_utc_xml(cnav_utc_xml_filename) == true) + { + std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_cnav_utc); + flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); + std::cout << "From XML file: Read GPS CNAV UTC parameters." << std::endl; + ret = true; + } } if (ret == false) From 15c4d62096867350909157bdd2bc22d6da67c320 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 20 Oct 2018 19:30:32 +0200 Subject: [PATCH 03/13] Add Glonass assistance --- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 44 +++++++++ src/core/libs/gnss_sdr_supl_client.cc | 93 +++++++++++++++++++ src/core/libs/gnss_sdr_supl_client.h | 26 ++++++ src/core/receiver/control_thread.cc | 29 ++++++ src/core/receiver/control_thread.h | 2 + 5 files changed, 194 insertions(+) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 13498ee71..d7de9453c 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -548,6 +548,50 @@ rtklib_pvt_cc::~rtklib_pvt_cc() { LOG(INFO) << "Failed to save GPS CNAV UTC model parameters, not valid data"; } + + // save GLONASS GNAV ephemeris to XML file + file_name = "glo_gnav_ephemeris.xml"; + if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false) + { + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_ls_pvt->glonass_gnav_ephemeris_map); + LOG(INFO) << "Saved GLONASS GNAV ephemeris map data"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what(); + } + } + else + { + LOG(INFO) << "Failed to save GLONASS GNAV ephemeris, map is empty"; + } + + // save GLONASS UTC model parameters to XML file + file_name = "glo_utc_model.xml"; + if (d_ls_pvt->glonass_gnav_utc_model.valid) + { + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gnav_utc_model", d_ls_pvt->glonass_gnav_utc_model); + LOG(INFO) << "Saved GLONASS UTC model parameters"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what(); + } + } + else + { + LOG(INFO) << "Failed to save GLONASS GNAV ephemeris, not valid data"; + } } diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index ce4df68f0..022f658fe 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -509,6 +509,53 @@ bool save_cnav_ephemeris_map_xml(const std::string file_name, std::map> boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", this->glonass_gnav_ephemeris_map); + LOG(INFO) << "Loaded GLONASS ephemeris map data with " << this->gps_cnav_ephemeris_map.size() << " satellites"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what() << "File: " << file_name; + return false; + } + return true; +} + + +bool save_gnav_ephemeris_map_xml(const std::string file_name, std::map eph_map) +{ + if (eph_map.empty() == false) + { + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", eph_map); + LOG(INFO) << "Saved GLONASS GNAV ephemeris map data"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what(); + return false; + } + } + else + { + LOG(WARNING) << "Failed to save GLONASS GNAV ephemeris, map is empty"; + return false; + } + return true; +} + + bool gnss_sdr_supl_client::load_utc_xml(const std::string file_name) { std::ifstream ifs; @@ -739,6 +786,52 @@ bool gnss_sdr_supl_client::save_gal_iono_xml(const std::string file_name, Galile } +bool gnss_sdr_supl_client::load_glo_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_glo_utc_model", this->glo_gnav_utc); + LOG(INFO) << "Loaded UTC model data"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what() << "File: " << file_name; + return false; + } + return true; +} + + +bool gnss_sdr_supl_client::save_glo_utc_xml(const std::string file_name, Glonass_Gnav_Utc_Model& utc) +{ + if (utc.valid) + { + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_glo_utc_model", utc); + LOG(INFO) << "Saved Glonass UTC Model data"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what(); + return false; + } + } + else + { + LOG(WARNING) << "Failed to save Glonass UTC model, no valid data"; + return false; + } + return true; +} + + bool gnss_sdr_supl_client::load_ref_time_xml(const std::string file_name) { std::ifstream ifs; diff --git a/src/core/libs/gnss_sdr_supl_client.h b/src/core/libs/gnss_sdr_supl_client.h index 9aea60492..a5554c75f 100644 --- a/src/core/libs/gnss_sdr_supl_client.h +++ b/src/core/libs/gnss_sdr_supl_client.h @@ -51,6 +51,8 @@ extern "C" #include "galileo_ephemeris.h" #include "galileo_utc_model.h" #include "galileo_iono.h" +#include "glonass_gnav_ephemeris.h" +#include "glonass_gnav_utc_model.h" #include #include #include @@ -84,6 +86,8 @@ public: std::map gps_ephemeris_map; std::map gal_ephemeris_map; std::map gps_cnav_ephemeris_map; + std::map glonass_gnav_ephemeris_map; + // almanac map std::map gps_almanac_map; @@ -96,6 +100,7 @@ public: Gps_Utc_Model gps_utc; Galileo_Utc_Model gal_utc; Gps_CNAV_Utc_Model gps_cnav_utc; + Glonass_Gnav_Utc_Model glo_gnav_utc; // reference location Gps_Ref_Location gps_ref_loc; // Acquisition Assistance map @@ -149,6 +154,17 @@ public: bool save_gal_ephemeris_map_xml(const std::string file_name, std::map eph_map); + /*! + * \brief Read GLONASS GNAV ephemeris map from XML file + */ + bool load_gnav_ephemeris_xml(const std::string file_name); + + /*! + * \brief Save GLONASS GNAV ephemeris map to XML file. + */ + bool save_gnav_ephemeris_map_xml(const std::string file_name, + std::map eph_map); + /*! * \brief Read GPS utc model from XML file */ @@ -202,6 +218,16 @@ public: */ bool save_gal_iono_xml(const std::string file_name, Galileo_Iono& iono); + /*! + * \brief Read Glonass utc model from XML file + */ + bool load_glo_utc_xml(const std::string file_name); + + /*! + * \brief Save Glonass UTC model map to XML file + */ + bool save_glo_utc_xml(const std::string file_name, Glonass_Gnav_Utc_Model& utc); + /*! * \brief Read ref time from XML file */ diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 8fd295192..51ebbd9d8 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -47,6 +47,8 @@ #include "gps_iono.h" #include "gps_utc_model.h" #include "gps_almanac.h" +#include "glonass_gnav_ephemeris.h" +#include "glonass_gnav_utc_model.h" #include #include #include @@ -208,6 +210,8 @@ bool ControlThread::read_assistance_from_XML() 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::string cnav_utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_cnav_utc_model.xml", cnav_utc_default_xml_filename); + std::string eph_glo_xml_filename = configuration_->property("GNSS-SDR.SUPL_glo_ephemeris_xml", eph_glo_gnav_default_xml_filename); + std::string glo_utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_glo_utc_model.xml", glo_utc_default_xml_filename); std::cout << "Trying to read GNSS ephemeris from XML file(s)..." << std::endl; @@ -302,6 +306,31 @@ bool ControlThread::read_assistance_from_XML() } } + if ((configuration_->property("Channels_1G.count", 0) > 0) or (configuration_->property("Channels_2G.count", 0) > 0)) + { + if (supl_client_ephemeris_.load_gnav_ephemeris_xml(eph_glo_xml_filename) == true) + { + std::map::const_iterator glo_gnav_eph_iter; + for (glo_gnav_eph_iter = supl_client_ephemeris_.glonass_gnav_ephemeris_map.cbegin(); + glo_gnav_eph_iter != supl_client_ephemeris_.glonass_gnav_ephemeris_map.cend(); + glo_gnav_eph_iter++) + { + std::cout << "From XML file: Read GLONASS GNAV ephemeris for satellite " << Gnss_Satellite("GLONASS", glo_gnav_eph_iter->second.i_satellite_PRN) << std::endl; + std::shared_ptr tmp_obj = std::make_shared(glo_gnav_eph_iter->second); + flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); + } + ret = true; + } + + if (supl_client_acquisition_.load_glo_utc_xml(glo_utc_xml_filename) == true) + { + std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.glo_gnav_utc); + flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); + std::cout << "From XML file: Read GLONASS UTC parameters." << std::endl; + ret = true; + } + } + if (ret == false) { std::cout << "ERROR: SUPL client error reading XML" << std::endl; diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h index 534fc968e..7335d0547 100644 --- a/src/core/receiver/control_thread.h +++ b/src/core/receiver/control_thread.h @@ -172,6 +172,8 @@ private: const std::string gal_iono_default_xml_filename = "./gal_iono.xml"; const std::string gal_utc_default_xml_filename = "./gal_utc_model.xml"; const std::string cnav_utc_default_xml_filename = "./gps_cnav_utc_model.xml"; + const std::string eph_glo_gnav_default_xml_filename = "./glo_gnav_ephemeris.xml"; + const std::string glo_utc_default_xml_filename = "./glo_utc_model.xml"; }; #endif /*GNSS_SDR_CONTROL_THREAD_H_*/ From 64d9e63b18347f621b1296872c3623222752aa81 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 20 Oct 2018 19:31:10 +0200 Subject: [PATCH 04/13] Add missing include path --- .../unit-tests/signal-processing-blocks/libs/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt index 332f0e583..7d15075f2 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt +++ b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt @@ -29,6 +29,7 @@ set(SIGNAL_PROCESSING_TESTING_LIB_SOURCES include_directories( ${CMAKE_CURRENT_SOURCE_DIR} + ${Boost_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS} ${MATIO_INCLUDE_DIRS} From e750ee94d7c0d7d972d4720e0f42dd5f06813401 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 20 Oct 2018 19:39:14 +0200 Subject: [PATCH 05/13] Update googletest and Mac OS Mojave info --- README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f2fe4a607..6624d618d 100644 --- a/README.md +++ b/README.md @@ -64,10 +64,10 @@ $ sudo apt-get install build-essential cmake git libboost-dev libboost-date-time libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev \ libboost-serialization-dev liblog4cpp5-dev libuhd-dev gnuradio-dev gr-osmosdr \ libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev \ - libgnutls-openssl-dev libpcap-dev python-mako python-six libmatio-dev googletest + libgnutls-openssl-dev libpcap-dev python-mako python-six libmatio-dev libgtest-dev ~~~~~~ -Please note that `googletest` was named `libgtest-dev` in distributions older than Debian 9 "stretch" and Ubuntu 17.04 "zesty". +Please note that the required files from `libgtest-dev` were moved to `googletest` in Debian 9 "stretch" and Ubuntu 18.04 "bionic", and moved back again to `libgtest-dev` in Debian 10 "buster" and Ubuntu 18.10 "cosmic". **Note for Ubuntu 14.04 LTS "trusty" users:** you will need to build from source and install GNU Radio manually, as explained below, since GNSS-SDR requires `gnuradio-dev` >= 3.7.3, and Ubuntu 14.04 came with 3.7.2. Install all the packages above BUT EXCEPT `libuhd-dev`, `gnuradio-dev` and `gr-osmosdr` (and remove them if they are already installed in your machine), and install those dependencies using PyBOMBS. The same applies to `libmatio-dev`: Ubuntu 14.04 came with 1.5.2 and the minimum required version is 1.5.3. Please do not install the `libmatio-dev` package and install `libtool`, `automake` and `libhdf5-dev` instead. A recent version of the library will be downloaded and built automatically if CMake does not find it installed. @@ -516,10 +516,7 @@ More details can be found in our tutorial about [GNSS-SDR configuration options macOS and Mac OS X --------- - -### macOS 10.13 (High Sierra) and 10.12 (Sierra), Mac OS X 10.11 (El Capitan), 10.10 (Yosemite) and 10.9 (Mavericks). - -If you still have not installed [Xcode](https://developer.apple.com/xcode/ "Xcode"), do it now from the App Store (it's free). You will also need the Xcode Command Line Tools. Launch the Terminal, found in /Applications/Utilities/, and type: +GNSS-SDR can be built on MacOS or Mac OS X, starting from 10.9 (Mavericks) and including 10.14 (Mojave). If you still have not installed [Xcode](https://developer.apple.com/xcode/ "Xcode"), do it now from the App Store (it's free). You will also need the Xcode Command Line Tools. Launch the Terminal, found in /Applications/Utilities/, and type: ~~~~~~ $ xcode-select --install @@ -558,7 +555,7 @@ You also might need to activate a Python installation. The list of installed ver $ port select list python ~~~~~~ -and you can activate a certain version (2.7 works well) by typing: +and you can activate a certain version by typing: ~~~~~~ $ sudo port select --set python python27 From 7b5caca9f8eaf86264c040c025c84a006c804064 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 20 Oct 2018 19:49:07 +0200 Subject: [PATCH 06/13] Detect MacOS Mojave --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b4a2cb33..670977ab9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -229,6 +229,12 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(OS_IS_MACOSX TRUE) exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION) string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION}) + if(${DARWIN_VERSION} MATCHES "18") + set(MACOS_MOJAVE TRUE) + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") + message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on macOS Mojave 10.14") + endif(${DARWIN_VERSION} MATCHES "18") if(${DARWIN_VERSION} MATCHES "17") set(MACOS_HIGH_SIERRA TRUE) set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14") From c6e3dbb929b9ef98e3d21d3fce4d2d1c1af37784 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 21 Oct 2018 11:06:36 +0200 Subject: [PATCH 07/13] Replace the deprecated exec_program by execute_process --- CMakeLists.txt | 2 +- cmake/cmake_uninstall.cmake.in | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 670977ab9..4a209fcaf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -227,7 +227,7 @@ endif(NOT LINUX_DISTRIBUTION) if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(OperatingSystem "Mac OS X") set(OS_IS_MACOSX TRUE) - exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION) + execute_process(COMMAND uname -v OUTPUT_VARIABLE DARWIN_VERSION) string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION}) if(${DARWIN_VERSION} MATCHES "18") set(MACOS_MOJAVE TRUE) diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in index 5d4ab76f7..9b3887185 100644 --- a/cmake/cmake_uninstall.cmake.in +++ b/cmake/cmake_uninstall.cmake.in @@ -24,10 +24,10 @@ string(REGEX REPLACE "\n" ";" files "${files}") foreach(file ${files}) message(STATUS "Uninstalling $ENV{DESTDIR}${file}") if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - exec_program( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + execute_process( + COMMAND @CMAKE_COMMAND@ -E remove \"$ENV{DESTDIR}${file}\" OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval + RESULT_VARIABLE rm_retval ) if(NOT "${rm_retval}" STREQUAL 0) message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") From ec50cda69290c37683492d476893bb0bfe04515e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 21 Oct 2018 11:28:47 +0200 Subject: [PATCH 08/13] Replace the deprecated exec_program by execute_process --- .../volk_gnsssdr/cmake/cmake_uninstall.cmake.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/cmake_uninstall.cmake.in b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/cmake_uninstall.cmake.in index a6191a104..d026a667a 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/cmake_uninstall.cmake.in +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/cmake_uninstall.cmake.in @@ -25,10 +25,10 @@ string(REGEX REPLACE "\n" ";" files "${files}") foreach(file ${files}) message(STATUS "Uninstalling $ENV{DESTDIR}${file}") if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - exec_program( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + execute_process( + COMMAND @CMAKE_COMMAND@ -E remove \"$ENV{DESTDIR}${file}\" OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval + RESULT_VARIABLE rm_retval ) if(NOT "${rm_retval}" STREQUAL 0) message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") From 337cafb31aff36b1cde0892e5c267fe74c197619 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 21 Oct 2018 12:16:45 +0200 Subject: [PATCH 09/13] Remove unused function --- src/algorithms/PVT/adapters/rtklib_pvt.cc | 43 ----------------------- src/algorithms/PVT/adapters/rtklib_pvt.h | 4 +-- src/core/libs/gnss_sdr_supl_client.h | 4 +-- 3 files changed, 2 insertions(+), 49 deletions(-) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 509d07886..3e63a19a6 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -133,18 +133,6 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, { rtcm_msg_rate_ms[k] = rtcm_MT1097_rate_ms; } - // getting names from the config file, if available - // default filename for assistance data - const std::string eph_default_xml_filename = "./gps_ephemeris.xml"; - const std::string utc_default_xml_filename = "./gps_utc_model.xml"; - const std::string iono_default_xml_filename = "./gps_iono.xml"; - const std::string ref_time_default_xml_filename = "./gps_ref_time.xml"; - const std::string ref_location_default_xml_filename = "./gps_ref_location.xml"; - 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 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); // Infer the type of receiver /* @@ -499,40 +487,9 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, } -bool RtklibPvt::save_assistance_to_XML() -{ - LOG(INFO) << "SUPL: Try to save GPS ephemeris to XML file " << eph_xml_filename_; - std::map eph_map = pvt_->get_GPS_L1_ephemeris_map(); - - if (eph_map.empty() == false) - { - std::ofstream ofs; - try - { - ofs.open(eph_xml_filename_.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", eph_map); - LOG(INFO) << "Saved GPS L1 Ephemeris map data"; - } - catch (const std::exception& e) - { - LOG(WARNING) << e.what(); - return false; - } - } - else - { - LOG(WARNING) << "Failed to save Ephemeris, map is empty"; - return false; - } - return true; // return variable (true == succeeded) -} - - RtklibPvt::~RtklibPvt() { rtkfree(&rtk); - save_assistance_to_XML(); } diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.h b/src/algorithms/PVT/adapters/rtklib_pvt.h index 936fd1632..c79519581 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.h +++ b/src/algorithms/PVT/adapters/rtklib_pvt.h @@ -40,7 +40,7 @@ class ConfigurationInterface; /*! - * \brief This class implements a PvtInterface for Galileo E1 + * \brief This class implements a PvtInterface for the RTKLIB PVT block */ class RtklibPvt : public PvtInterface { @@ -87,8 +87,6 @@ private: std::string role_; unsigned int in_streams_; unsigned int out_streams_; - std::string eph_xml_filename_; - bool save_assistance_to_XML(); }; #endif diff --git a/src/core/libs/gnss_sdr_supl_client.h b/src/core/libs/gnss_sdr_supl_client.h index a5554c75f..465e552f3 100644 --- a/src/core/libs/gnss_sdr_supl_client.h +++ b/src/core/libs/gnss_sdr_supl_client.h @@ -172,7 +172,6 @@ public: /*! * \brief Save UTC model map to XML file - * To be called by ControlThread::gps_utc_model_data_write_to_XML() */ bool save_utc_xml(const std::string file_name, Gps_Utc_Model& utc); @@ -183,7 +182,6 @@ public: /*! * \brief Save CNAV UTC model map to XML file - * To be called by ControlThread::gps_utc_model_data_write_to_XML() */ bool save_cnav_utc_xml(const std::string file_name, Gps_CNAV_Utc_Model& utc); @@ -194,7 +192,6 @@ public: /*! * \brief Save Galileo UTC model map to XML file - * To be called by ControlThread::gal_utc_model_data_write_to_XML() */ bool save_gal_utc_xml(const std::string file_name, Galileo_Utc_Model& utc); @@ -254,6 +251,7 @@ public: * Prints SUPL data to std::cout. Use it for debug purposes only. */ void print_assistance(); + gnss_sdr_supl_client(); ~gnss_sdr_supl_client(); }; From 0e454cb76e1ffc68c551b2176bc02ba7c72059de Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 21 Oct 2018 13:58:29 +0200 Subject: [PATCH 10/13] More consistent naming for AGNSS configuration parameters, backward-compatible with SUPL --- src/core/receiver/control_thread.cc | 69 +++++++++++++++++++++++------ 1 file changed, 56 insertions(+), 13 deletions(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 51ebbd9d8..6e04d72f0 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -213,6 +213,22 @@ bool ControlThread::read_assistance_from_XML() std::string eph_glo_xml_filename = configuration_->property("GNSS-SDR.SUPL_glo_ephemeris_xml", eph_glo_gnav_default_xml_filename); std::string glo_utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_glo_utc_model.xml", glo_utc_default_xml_filename); + if (configuration_->property("GNSS-SDR.AGNSS_XML_enabled", false) == true) + { + eph_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gps_ephemeris_xml", eph_default_xml_filename); + utc_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gps_utc_model.xml", utc_default_xml_filename); + iono_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gps_iono_xml", iono_default_xml_filename); + gal_iono_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gal_iono_xml", gal_iono_default_xml_filename); + ref_time_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gps_ref_time_xml", ref_time_default_xml_filename); + ref_location_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gps_ref_location_xml", ref_location_default_xml_filename); + eph_gal_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gal_ephemeris_xml", eph_gal_default_xml_filename); + eph_cnav_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gps_cnav_ephemeris_xml", eph_cnav_default_xml_filename); + gal_utc_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gal_utc_model.xml", gal_utc_default_xml_filename); + cnav_utc_xml_filename = configuration_->property("GNSS-SDR.AGNSS_cnav_utc_model.xml", cnav_utc_default_xml_filename); + eph_glo_xml_filename = configuration_->property("GNSS-SDR.AGNSS_glo_ephemeris_xml", eph_glo_gnav_default_xml_filename); + glo_utc_xml_filename = configuration_->property("GNSS-SDR.AGNSS_glo_utc_model.xml", glo_utc_default_xml_filename); + } + std::cout << "Trying to read GNSS ephemeris from XML file(s)..." << std::endl; if (configuration_->property("Channels_1C.count", 0) > 0) @@ -333,8 +349,8 @@ bool ControlThread::read_assistance_from_XML() if (ret == false) { - std::cout << "ERROR: SUPL client error reading XML" << std::endl; - std::cout << "Disabling SUPL assistance..." << std::endl; + std::cout << "Error reading XML files" << std::endl; + std::cout << "Disabling GNSS assistance..." << std::endl; } // Only look for {ref time, ref location} if SUPL is enabled @@ -375,11 +391,11 @@ void ControlThread::assist_GNSS() //######### GNSS Assistance ################################# // GNSS Assistance configuration bool enable_gps_supl_assistance = configuration_->property("GNSS-SDR.SUPL_gps_enabled", false); - if (enable_gps_supl_assistance == true) - //SUPL SERVER TEST. Not operational yet! + bool enable_xml_agnss_enabled = configuration_->property("GNSS-SDR.AGNSS_XML_enabled", false); + if ((enable_gps_supl_assistance == true) and (enable_xml_agnss_enabled == false)) { std::cout << "SUPL RRLP GPS assistance enabled!" << std::endl; - std::string default_acq_server = "supl.nokia.com"; + std::string default_acq_server = "supl.google.com"; std::string default_eph_server = "supl.google.com"; supl_client_ephemeris_.server_name = configuration_->property("GNSS-SDR.SUPL_gps_ephemeris_server", default_acq_server); supl_client_acquisition_.server_name = configuration_->property("GNSS-SDR.SUPL_gps_acquisition_server", default_eph_server); @@ -431,11 +447,11 @@ void ControlThread::assist_GNSS() gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend(); gps_eph_iter++) { - std::cout << "SUPL: Received Ephemeris for GPS SV " << gps_eph_iter->first << std::endl; + std::cout << "SUPL: Received Ephemeris for GPS satellite " << Gnss_Satellite("GPS", gps_eph_iter->second.i_satellite_PRN) << std::endl; std::shared_ptr tmp_obj = std::make_shared(gps_eph_iter->second); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } - //Save ephemeris to XML file + // Save ephemeris to XML file std::string eph_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_ephemeris_xml", eph_default_xml_filename); if (supl_client_ephemeris_.save_ephemeris_map_xml(eph_xml_filename, supl_client_ephemeris_.gps_ephemeris_map) == true) { @@ -449,7 +465,7 @@ void ControlThread::assist_GNSS() else { std::cout << "ERROR: SUPL client for Ephemeris returned " << error << std::endl; - std::cout << "Please check internet connection and SUPL server configuration" << error << std::endl; + std::cout << "Please check internet connection and SUPL server configuration" << std::endl; std::cout << "Trying to read ephemeris from XML file" << std::endl; if (read_assistance_from_XML() == false) { @@ -457,7 +473,7 @@ void ControlThread::assist_GNSS() } } - // Request almanac , IONO and UTC Model + // Request almanac, IONO and UTC Model data supl_client_ephemeris_.request = 0; std::cout << "SUPL: Try read Almanac, Iono, Utc Model, Ref Time and Ref Location from SUPL server..." << std::endl; error = supl_client_ephemeris_.get_assistance(supl_mcc, supl_mns, supl_lac, supl_ci); @@ -468,7 +484,7 @@ void ControlThread::assist_GNSS() gps_alm_iter != supl_client_ephemeris_.gps_almanac_map.cend(); gps_alm_iter++) { - std::cout << "SUPL: Received Almanac for GPS SV " << gps_alm_iter->first << std::endl; + std::cout << "SUPL: Received Almanac for GPS satellite " << Gnss_Satellite("GPS", gps_alm_iter->second.i_satellite_PRN) << std::endl; std::shared_ptr tmp_obj = std::make_shared(gps_alm_iter->second); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } @@ -484,11 +500,30 @@ void ControlThread::assist_GNSS() std::shared_ptr tmp_obj = std::make_shared(supl_client_ephemeris_.gps_utc); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } + // Save iono and UTC model data to xml file + std::string iono_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_iono_xml", iono_default_xml_filename); + if (supl_client_ephemeris_.save_iono_xml(iono_xml_filename, supl_client_ephemeris_.gps_iono) == true) + { + std::cout << "SUPL: Iono data file created" << std::endl; + } + else + { + std::cout << "SUPL: Failed to create Iono data file" << std::endl; + } + std::string utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_utc_model.xml", utc_default_xml_filename); + if (supl_client_ephemeris_.save_utc_xml(utc_xml_filename, supl_client_ephemeris_.gps_utc) == true) + { + std::cout << "SUPL: UTC model file created" << std::endl; + } + else + { + std::cout << "SUPL: Failed to create XML UTC model file" << std::endl; + } } else { std::cout << "ERROR: SUPL client for Almanac returned " << error << std::endl; - std::cout << "Please check internet connection and SUPL server configuration" << error << std::endl; + std::cout << "Please check internet connection and SUPL server configuration" << std::endl; std::cout << "Disabling SUPL assistance." << std::endl; } @@ -503,7 +538,7 @@ void ControlThread::assist_GNSS() gps_acq_iter != supl_client_acquisition_.gps_acq_map.cend(); gps_acq_iter++) { - std::cout << "SUPL: Received Acquisition assistance for GPS SV " << gps_acq_iter->first << std::endl; + std::cout << "SUPL: Received Acquisition assistance for GPS satellite " << Gnss_Satellite("GPS", gps_acq_iter->second.i_satellite_PRN) << std::endl; global_gps_acq_assist_map.write(gps_acq_iter->second.i_satellite_PRN, gps_acq_iter->second); } if (supl_client_acquisition_.gps_ref_loc.valid == true) @@ -522,11 +557,19 @@ void ControlThread::assist_GNSS() else { std::cout << "ERROR: SUPL client for Acquisition assistance returned " << error << std::endl; - std::cout << "Please check internet connection and SUPL server configuration" << error << std::endl; + std::cout << "Please check internet connection and SUPL server configuration" << std::endl; std::cout << "Disabling SUPL assistance.." << std::endl; } } } + if ((enable_gps_supl_assistance == false) and (enable_xml_agnss_enabled == true)) + { + // read assistance from file + if (read_assistance_from_XML()) + { + std::cout << "GNSS assistance data loaded from local XML file(s)." << std::endl; + } + } } From 7cad0bac742bdb1d4dbd423148601ab9dc1c5720 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 21 Oct 2018 14:15:41 +0200 Subject: [PATCH 11/13] Improve wording in SUPL terminal output --- src/core/receiver/control_thread.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 6e04d72f0..3fd122d5a 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -447,7 +447,7 @@ void ControlThread::assist_GNSS() gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend(); gps_eph_iter++) { - std::cout << "SUPL: Received Ephemeris for GPS satellite " << Gnss_Satellite("GPS", gps_eph_iter->second.i_satellite_PRN) << std::endl; + std::cout << "SUPL: Received Ephemeris for satellite " << Gnss_Satellite("GPS", gps_eph_iter->second.i_satellite_PRN) << std::endl; std::shared_ptr tmp_obj = std::make_shared(gps_eph_iter->second); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } @@ -484,7 +484,7 @@ void ControlThread::assist_GNSS() gps_alm_iter != supl_client_ephemeris_.gps_almanac_map.cend(); gps_alm_iter++) { - std::cout << "SUPL: Received Almanac for GPS satellite " << Gnss_Satellite("GPS", gps_alm_iter->second.i_satellite_PRN) << std::endl; + std::cout << "SUPL: Received Almanac for satellite " << Gnss_Satellite("GPS", gps_alm_iter->second.i_satellite_PRN) << std::endl; std::shared_ptr tmp_obj = std::make_shared(gps_alm_iter->second); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } @@ -538,7 +538,7 @@ void ControlThread::assist_GNSS() gps_acq_iter != supl_client_acquisition_.gps_acq_map.cend(); gps_acq_iter++) { - std::cout << "SUPL: Received Acquisition assistance for GPS satellite " << Gnss_Satellite("GPS", gps_acq_iter->second.i_satellite_PRN) << std::endl; + std::cout << "SUPL: Received Acquisition assistance for satellite " << Gnss_Satellite("GPS", gps_acq_iter->second.i_satellite_PRN) << std::endl; global_gps_acq_assist_map.write(gps_acq_iter->second.i_satellite_PRN, gps_acq_iter->second); } if (supl_client_acquisition_.gps_ref_loc.valid == true) From 239efe245853e8eeeedbde8ee598366d9c0d2055 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 21 Oct 2018 17:55:06 +0200 Subject: [PATCH 12/13] Improve wording in SUPL terminal output --- src/core/receiver/control_thread.cc | 71 +++++++++++++++-------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 3fd122d5a..dbc433241 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -251,7 +251,7 @@ bool ControlThread::read_assistance_from_XML() { 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; + std::cout << "From XML file: Read GPS UTC model parameters." << std::endl; ret = true; } @@ -259,7 +259,7 @@ bool ControlThread::read_assistance_from_XML() { 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; + std::cout << "From XML file: Read GPS ionosphere model parameters." << std::endl; ret = true; } } @@ -284,7 +284,7 @@ bool ControlThread::read_assistance_from_XML() { 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; + std::cout << "From XML file: Read Galileo ionosphere model parameters." << std::endl; ret = true; } @@ -292,7 +292,7 @@ bool ControlThread::read_assistance_from_XML() { 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 UTC parameters." << std::endl; + std::cout << "From XML file: Read Galileo UTC model parameters." << std::endl; ret = true; } } @@ -317,7 +317,7 @@ bool ControlThread::read_assistance_from_XML() { std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_cnav_utc); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); - std::cout << "From XML file: Read GPS CNAV UTC parameters." << std::endl; + std::cout << "From XML file: Read GPS CNAV UTC model parameters." << std::endl; ret = true; } } @@ -342,7 +342,7 @@ bool ControlThread::read_assistance_from_XML() { std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.glo_gnav_utc); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); - std::cout << "From XML file: Read GLONASS UTC parameters." << std::endl; + std::cout << "From XML file: Read GLONASS UTC model parameters." << std::endl; ret = true; } } @@ -366,7 +366,7 @@ bool ControlThread::read_assistance_from_XML() } else { - LOG(INFO) << "SUPL: couldn't read Ref Time XML"; + LOG(INFO) << "SUPL: could not read Ref Time XML"; } // Try to read Ref Location from XML @@ -378,7 +378,7 @@ bool ControlThread::read_assistance_from_XML() } else { - LOG(INFO) << "SUPL: couldn't read Ref Location XML"; + LOG(INFO) << "SUPL: could not read Ref Location XML"; } } @@ -391,8 +391,8 @@ void ControlThread::assist_GNSS() //######### GNSS Assistance ################################# // GNSS Assistance configuration bool enable_gps_supl_assistance = configuration_->property("GNSS-SDR.SUPL_gps_enabled", false); - bool enable_xml_agnss_enabled = configuration_->property("GNSS-SDR.AGNSS_XML_enabled", false); - if ((enable_gps_supl_assistance == true) and (enable_xml_agnss_enabled == false)) + bool enable_agnss_xml = configuration_->property("GNSS-SDR.AGNSS_XML_enabled", false); + if ((enable_gps_supl_assistance == true) and (enable_agnss_xml == false)) { std::cout << "SUPL RRLP GPS assistance enabled!" << std::endl; std::string default_acq_server = "supl.google.com"; @@ -431,6 +431,7 @@ void ControlThread::assist_GNSS() if (read_assistance_from_XML()) { std::cout << "GNSS assistance data loaded from local XML file(s)." << std::endl; + std::cout << "No SUPL request has been performed." << std::endl; } } else @@ -438,7 +439,7 @@ void ControlThread::assist_GNSS() // Request ephemeris from SUPL server int error; supl_client_ephemeris_.request = 1; - std::cout << "SUPL: Try to read GPS ephemeris from SUPL server..." << std::endl; + std::cout << "SUPL: Try to read GPS ephemeris data from SUPL server..." << std::endl; error = supl_client_ephemeris_.get_assistance(supl_mcc, supl_mns, supl_lac, supl_ci); if (error == 0) { @@ -447,7 +448,7 @@ void ControlThread::assist_GNSS() gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend(); gps_eph_iter++) { - std::cout << "SUPL: Received Ephemeris for satellite " << Gnss_Satellite("GPS", gps_eph_iter->second.i_satellite_PRN) << std::endl; + std::cout << "SUPL: Received ephemeris data for satellite " << Gnss_Satellite("GPS", gps_eph_iter->second.i_satellite_PRN) << std::endl; std::shared_ptr tmp_obj = std::make_shared(gps_eph_iter->second); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } @@ -455,27 +456,27 @@ void ControlThread::assist_GNSS() std::string eph_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_ephemeris_xml", eph_default_xml_filename); if (supl_client_ephemeris_.save_ephemeris_map_xml(eph_xml_filename, supl_client_ephemeris_.gps_ephemeris_map) == true) { - std::cout << "SUPL: XML Ephemeris file created" << std::endl; + std::cout << "SUPL: XML ephemeris data file created" << std::endl; } else { - std::cout << "SUPL: Failed to create XML Ephemeris file" << std::endl; + std::cout << "SUPL: Failed to create XML ephemeris data file" << std::endl; } } else { - std::cout << "ERROR: SUPL client for Ephemeris returned " << error << std::endl; - std::cout << "Please check internet connection and SUPL server configuration" << std::endl; - std::cout << "Trying to read ephemeris from XML file" << std::endl; + std::cout << "ERROR: SUPL client request for ephemeris data returned " << error << std::endl; + std::cout << "Please check your network connectivity and SUPL server configuration" << std::endl; + std::cout << "Trying to read AGNSS data from local XML file(s)..." << std::endl; if (read_assistance_from_XML() == false) { - std::cout << "ERROR: Could not read Ephemeris file: Disabling SUPL assistance." << std::endl; + std::cout << "ERROR: Could not read XML files: Disabling SUPL assistance." << std::endl; } } // Request almanac, IONO and UTC Model data supl_client_ephemeris_.request = 0; - std::cout << "SUPL: Try read Almanac, Iono, Utc Model, Ref Time and Ref Location from SUPL server..." << std::endl; + std::cout << "SUPL: Try to read Almanac, Iono, Utc Model, Ref Time and Ref Location data from SUPL server..." << std::endl; error = supl_client_ephemeris_.get_assistance(supl_mcc, supl_mns, supl_lac, supl_ci); if (error == 0) { @@ -484,19 +485,19 @@ void ControlThread::assist_GNSS() gps_alm_iter != supl_client_ephemeris_.gps_almanac_map.cend(); gps_alm_iter++) { - std::cout << "SUPL: Received Almanac for satellite " << Gnss_Satellite("GPS", gps_alm_iter->second.i_satellite_PRN) << std::endl; + std::cout << "SUPL: Received almanac data for satellite " << Gnss_Satellite("GPS", gps_alm_iter->second.i_satellite_PRN) << std::endl; std::shared_ptr tmp_obj = std::make_shared(gps_alm_iter->second); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } if (supl_client_ephemeris_.gps_iono.valid == true) { - std::cout << "SUPL: Received GPS Iono" << std::endl; + std::cout << "SUPL: Received GPS Ionosphere model parameters" << std::endl; std::shared_ptr tmp_obj = std::make_shared(supl_client_ephemeris_.gps_iono); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } if (supl_client_ephemeris_.gps_utc.valid == true) { - std::cout << "SUPL: Received GPS UTC Model" << std::endl; + std::cout << "SUPL: Received GPS UTC model parameters" << std::endl; std::shared_ptr tmp_obj = std::make_shared(supl_client_ephemeris_.gps_utc); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } @@ -513,23 +514,22 @@ void ControlThread::assist_GNSS() std::string utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_utc_model.xml", utc_default_xml_filename); if (supl_client_ephemeris_.save_utc_xml(utc_xml_filename, supl_client_ephemeris_.gps_utc) == true) { - std::cout << "SUPL: UTC model file created" << std::endl; + std::cout << "SUPL: UTC model data file created" << std::endl; } else { - std::cout << "SUPL: Failed to create XML UTC model file" << std::endl; + std::cout << "SUPL: Failed to create UTC model data file" << std::endl; } } else { - std::cout << "ERROR: SUPL client for Almanac returned " << error << std::endl; - std::cout << "Please check internet connection and SUPL server configuration" << std::endl; - std::cout << "Disabling SUPL assistance." << std::endl; + std::cout << "ERROR: SUPL client for almanac data returned " << error << std::endl; + std::cout << "Please check your network connectivity and SUPL server configuration" << std::endl; } // Request acquisition assistance supl_client_acquisition_.request = 2; - std::cout << "SUPL: Try read Acquisition assistance from SUPL server..." << std::endl; + std::cout << "SUPL: Try to read acquisition assistance data from SUPL server..." << std::endl; error = supl_client_acquisition_.get_assistance(supl_mcc, supl_mns, supl_lac, supl_ci); if (error == 0) { @@ -538,31 +538,32 @@ void ControlThread::assist_GNSS() gps_acq_iter != supl_client_acquisition_.gps_acq_map.cend(); gps_acq_iter++) { - std::cout << "SUPL: Received Acquisition assistance for satellite " << Gnss_Satellite("GPS", gps_acq_iter->second.i_satellite_PRN) << std::endl; + std::cout << "SUPL: Received acquisition assistance data for satellite " << Gnss_Satellite("GPS", gps_acq_iter->second.i_satellite_PRN) << std::endl; global_gps_acq_assist_map.write(gps_acq_iter->second.i_satellite_PRN, gps_acq_iter->second); } if (supl_client_acquisition_.gps_ref_loc.valid == true) { - std::cout << "SUPL: Received Ref Location (Acquisition Assistance)" << std::endl; + std::cout << "SUPL: Received Ref Location data (Acquisition Assistance)" << std::endl; std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_ref_loc); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } if (supl_client_acquisition_.gps_time.valid == true) { - std::cout << "SUPL: Received Ref Time (Acquisition Assistance)" << std::endl; + std::cout << "SUPL: Received Ref Time data (Acquisition Assistance)" << std::endl; std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_time); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } } else { - std::cout << "ERROR: SUPL client for Acquisition assistance returned " << error << std::endl; - std::cout << "Please check internet connection and SUPL server configuration" << std::endl; - std::cout << "Disabling SUPL assistance.." << std::endl; + std::cout << "ERROR: SUPL client for acquisition assistance returned " << error << std::endl; + std::cout << "Please check your network connectivity and SUPL server configuration" << std::endl; + std::cout << "Disabling SUPL acquisition assistance." << std::endl; } } } - if ((enable_gps_supl_assistance == false) and (enable_xml_agnss_enabled == true)) + + if ((enable_gps_supl_assistance == false) and (enable_agnss_xml == true)) { // read assistance from file if (read_assistance_from_XML()) From 7d681a7e19868e2059bbf97512e680750401fb63 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 21 Oct 2018 18:27:23 +0200 Subject: [PATCH 13/13] Fix typos --- src/core/receiver/control_thread.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index dbc433241..12da99748 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -201,32 +201,32 @@ bool ControlThread::read_assistance_from_XML() bool ret = false; // getting names from the config file, if available 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 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::string cnav_utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_cnav_utc_model.xml", cnav_utc_default_xml_filename); + std::string gal_utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_gal_utc_model_xml", gal_utc_default_xml_filename); + std::string cnav_utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_cnav_utc_model_xml", cnav_utc_default_xml_filename); std::string eph_glo_xml_filename = configuration_->property("GNSS-SDR.SUPL_glo_ephemeris_xml", eph_glo_gnav_default_xml_filename); - std::string glo_utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_glo_utc_model.xml", glo_utc_default_xml_filename); + std::string glo_utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_glo_utc_model_xml", glo_utc_default_xml_filename); if (configuration_->property("GNSS-SDR.AGNSS_XML_enabled", false) == true) { eph_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gps_ephemeris_xml", eph_default_xml_filename); - utc_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gps_utc_model.xml", utc_default_xml_filename); + utc_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gps_utc_model_xml", utc_default_xml_filename); iono_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gps_iono_xml", iono_default_xml_filename); gal_iono_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gal_iono_xml", gal_iono_default_xml_filename); ref_time_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gps_ref_time_xml", ref_time_default_xml_filename); ref_location_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gps_ref_location_xml", ref_location_default_xml_filename); eph_gal_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gal_ephemeris_xml", eph_gal_default_xml_filename); eph_cnav_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gps_cnav_ephemeris_xml", eph_cnav_default_xml_filename); - gal_utc_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gal_utc_model.xml", gal_utc_default_xml_filename); - cnav_utc_xml_filename = configuration_->property("GNSS-SDR.AGNSS_cnav_utc_model.xml", cnav_utc_default_xml_filename); + gal_utc_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gal_utc_model_xml", gal_utc_default_xml_filename); + cnav_utc_xml_filename = configuration_->property("GNSS-SDR.AGNSS_cnav_utc_model_xml", cnav_utc_default_xml_filename); eph_glo_xml_filename = configuration_->property("GNSS-SDR.AGNSS_glo_ephemeris_xml", eph_glo_gnav_default_xml_filename); - glo_utc_xml_filename = configuration_->property("GNSS-SDR.AGNSS_glo_utc_model.xml", glo_utc_default_xml_filename); + glo_utc_xml_filename = configuration_->property("GNSS-SDR.AGNSS_glo_utc_model_xml", glo_utc_default_xml_filename); } std::cout << "Trying to read GNSS ephemeris from XML file(s)..." << std::endl; @@ -511,7 +511,7 @@ void ControlThread::assist_GNSS() { std::cout << "SUPL: Failed to create Iono data file" << std::endl; } - std::string utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_utc_model.xml", utc_default_xml_filename); + std::string utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_utc_model_xml", utc_default_xml_filename); if (supl_client_ephemeris_.save_utc_xml(utc_xml_filename, supl_client_ephemeris_.gps_utc) == true) { std::cout << "SUPL: UTC model data file created" << std::endl;