From 4bb1872e17a310e591ce32ed26031c12e3872582 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 29 Apr 2019 17:23:09 +0200 Subject: [PATCH 1/6] Fix date in RINEX annotations beyond the rollover --- src/algorithms/PVT/libs/rinex_printer.cc | 37 ++++++++++++++++++++---- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index b9b2c2223..69d678d06 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -11082,8 +11082,16 @@ boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Gps_Navigation_Me //: idea resolve the ambiguity with the leap second http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm const double utc_t = nav_msg.utc_time(nav_msg.d_TOW); boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast((utc_t + 604800 * static_cast(nav_msg.i_GPS_week)) * 1000)); - boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); - return p_time; + if (nav_msg.i_GPS_week > 512) + { + boost::posix_time::ptime p_time(boost::gregorian::date(2019, 4, 7), t); + return p_time; + } + else + { + boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); + return p_time; + } } @@ -11108,8 +11116,16 @@ boost::posix_time::ptime Rinex_Printer::compute_GPS_time(const Gps_Ephemeris& ep // --??? No time correction here, since it will be done in the RINEX processor const double gps_t = obs_time; boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast((gps_t + 604800 * static_cast(eph.i_GPS_week % 1024)) * 1000)); - boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); - return p_time; + if (eph.i_GPS_week > 512) + { + boost::posix_time::ptime p_time(boost::gregorian::date(2019, 4, 7), t); + return p_time; + } + else + { + boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); + return p_time; + } } @@ -11121,8 +11137,16 @@ boost::posix_time::ptime Rinex_Printer::compute_GPS_time(const Gps_CNAV_Ephemeri // --??? No time correction here, since it will be done in the RINEX processor const double gps_t = obs_time; boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast((gps_t + 604800 * static_cast(eph.i_GPS_week % 1024)) * 1000)); - boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); - return p_time; + if (eph.i_GPS_week > 512) + { + boost::posix_time::ptime p_time(boost::gregorian::date(2019, 4, 7), t); + return p_time; + } + else + { + boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); + return p_time; + } } @@ -11178,6 +11202,7 @@ boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Glonass_Gnav_Ephe return utc_time; } + double Rinex_Printer::get_leap_second(const Glonass_Gnav_Ephemeris& eph, const double gps_obs_time) { double tod = 0.0; From 16f9e623c11187b1f7c61df9e25a61997aefb601 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 29 Apr 2019 19:04:07 +0200 Subject: [PATCH 2/6] Fix wrong comparison --- src/algorithms/PVT/libs/rinex_printer.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 69d678d06..52f764282 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -11082,7 +11082,7 @@ boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Gps_Navigation_Me //: idea resolve the ambiguity with the leap second http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm const double utc_t = nav_msg.utc_time(nav_msg.d_TOW); boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast((utc_t + 604800 * static_cast(nav_msg.i_GPS_week)) * 1000)); - if (nav_msg.i_GPS_week > 512) + if (nav_msg.i_GPS_week < 512) { boost::posix_time::ptime p_time(boost::gregorian::date(2019, 4, 7), t); return p_time; @@ -11116,7 +11116,7 @@ boost::posix_time::ptime Rinex_Printer::compute_GPS_time(const Gps_Ephemeris& ep // --??? No time correction here, since it will be done in the RINEX processor const double gps_t = obs_time; boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast((gps_t + 604800 * static_cast(eph.i_GPS_week % 1024)) * 1000)); - if (eph.i_GPS_week > 512) + if (eph.i_GPS_week < 512) { boost::posix_time::ptime p_time(boost::gregorian::date(2019, 4, 7), t); return p_time; @@ -11137,7 +11137,7 @@ boost::posix_time::ptime Rinex_Printer::compute_GPS_time(const Gps_CNAV_Ephemeri // --??? No time correction here, since it will be done in the RINEX processor const double gps_t = obs_time; boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast((gps_t + 604800 * static_cast(eph.i_GPS_week % 1024)) * 1000)); - if (eph.i_GPS_week > 512) + if (eph.i_GPS_week < 512) { boost::posix_time::ptime p_time(boost::gregorian::date(2019, 4, 7), t); return p_time; From 01ea7ed83149fc65bb537ec93e97b346a32c5cb3 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Apr 2019 20:22:10 +0200 Subject: [PATCH 3/6] Improve detecton of Protocol Buffers compiler when cross-compiling --- CMakeLists.txt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b43465dcb..4beca52e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1871,19 +1871,22 @@ if(Protobuf_FOUND AND CMAKE_VERSION VERSION_LESS 3.9) endif() endif() if(Protobuf_FOUND AND CMAKE_CROSSCOMPILING) - find_program(PROTOC_EXECUTABLE protoc - HINTS - /usr/local/bin/ - /usr/bin/ - NO_SYSTEM_ENVIRONMENT_PATH - ) + find_program(PROTOC_EXECUTABLE protoc) + if(NOT PROTOC_EXECUTABLE) + find_program(PROTOC_EXECUTABLE protoc + HINTS + /usr/bin/ + /usr/local/bin/ + ) + endif() if(PROTOC_EXECUTABLE) set_target_properties(protobuf::protoc PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" IMPORTED_LOCATION ${PROTOC_EXECUTABLE} ) + set(Protobuf_PROTOC_EXECUTABLE ${PROTOC_EXECUTABLE}) else() - message(FATAL ERROR "Please install the Protocol Buffers compiter v${Protobuf_VERSION} in the host machine") + message(FATAL_ERROR "Please install the Protocol Buffers compiler v${Protobuf_VERSION} in the host machine") endif() endif() if((NOT Protobuf_FOUND) OR (NOT Protobuf_PROTOC_EXECUTABLE) OR (${Protobuf_VERSION} VERSION_LESS ${GNSSSDR_PROTOBUF_MIN_VERSION})) From 2b4d1a871f44fe887ee09a670632ee2a93bff27e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 1 May 2019 10:18:57 +0200 Subject: [PATCH 4/6] Update package list for Fedora and OpenSUSE --- README.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fe1501404..1bbf0551f 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ $ sudo apt-get install build-essential cmake git libboost-dev libboost-date-time libgtest-dev libprotobuf-dev protobuf-compiler ~~~~~~ -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". +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" (and above). **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. @@ -120,7 +120,7 @@ $ sudo yum install make automake gcc gcc-c++ kernel-devel cmake git boost-devel boost-serialization log4cpp-devel gnuradio-devel gr-osmosdr-devel \ blas-devel lapack-devel matio-devel armadillo-devel gflags-devel \ glog-devel openssl-devel libpcap-devel python-mako python-six \ - pugixml-devel protobuf-devel + pugixml-devel protobuf-devel protobuf-compiler ~~~~~~ Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux). @@ -130,13 +130,24 @@ Once you have installed these packages, you can jump directly to [download the s If you are using openSUSE Leap: +~~~~~~ +zypper install cmake git gcc-c++ boost-devel libboost_atomic-devel \ + libboost_system-devel libboost_filesystem-devel libboost_chrono-devel \ + libboost_thread-devel libboost_serialization-devel log4cpp-devel \ + gnuradio-devel pugixml-devel libpcap-devel armadillo-devel libtool \ + automake hdf5-devel openssl-devel python-Mako python-six protobuf-devel +~~~~~~ + +If you are using openSUSE Tumbleweed: + ~~~~~~ zypper install cmake git gcc-c++ boost-devel libboost_atomic-devel \ libboost_system-devel libboost_filesystem-devel libboost_date_time-devel \ libboost_thread-devel libboost_chrono-devel libboost_serialization-devel \ log4cpp-devel gtest gnuradio-devel pugixml-devel libpcap-devel \ - armadillo-devel libtool automake hdf5-devel libopenssl-devel python-Mako \ - python-six protobuf-devel + armadillo-devel libtool automake hdf5-devel libopenssl-devel \ + python3-Mako python3-six protobuf-devel + ~~~~~~ Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux). From f65051ec31298026709c4704f9dae155a9f711c5 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 1 May 2019 11:00:55 +0200 Subject: [PATCH 5/6] Delete blank line --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 1bbf0551f..54d8a3f47 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,6 @@ zypper install cmake git gcc-c++ boost-devel libboost_atomic-devel \ log4cpp-devel gtest gnuradio-devel pugixml-devel libpcap-devel \ armadillo-devel libtool automake hdf5-devel libopenssl-devel \ python3-Mako python3-six protobuf-devel - ~~~~~~ Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux). From cd0e7adaf466f4fa3355acf01cf202a648eb859a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 1 May 2019 14:44:12 +0200 Subject: [PATCH 6/6] Correct comments. Fixes: #269 --- .../tracking/libs/tracking_2nd_PLL_filter.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc b/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc index bf0b0841b..e2da9d943 100644 --- a/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc +++ b/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc @@ -49,7 +49,7 @@ void Tracking_2nd_PLL_filter::calculate_lopp_coef(float* tau1, float* tau2, floa void Tracking_2nd_PLL_filter::set_PLL_BW(float pll_bw_hz) { - //Calculate filter coefficient values + // Calculate filter coefficient values d_pllnoisebandwidth = pll_bw_hz; calculate_lopp_coef(&d_tau1_carr, &d_tau2_carr, d_pllnoisebandwidth, d_plldampingratio, 0.25); // Calculate filter coefficient values } @@ -64,14 +64,13 @@ void Tracking_2nd_PLL_filter::initialize() /* - * PLL second order FIR filter + * PLL second order IIR filter * Req Input in [Hz/Ti] * The output is in [Hz/s]. */ float Tracking_2nd_PLL_filter::get_carrier_nco(float PLL_discriminator) { float carr_nco = d_old_carr_nco + (d_tau2_carr / d_tau1_carr) * (PLL_discriminator - d_old_carr_error) + (PLL_discriminator + d_old_carr_error) * (d_pdi_carr / (2.0 * d_tau1_carr)); - //carr_nco = d_old_carr_nco + (d_tau2_carr/d_tau1_carr)*(PLL_discriminator - d_old_carr_error) + PLL_discriminator * (d_pdi_carr/d_tau1_carr); d_old_carr_nco = carr_nco; d_old_carr_error = PLL_discriminator; return carr_nco; @@ -80,16 +79,15 @@ float Tracking_2nd_PLL_filter::get_carrier_nco(float PLL_discriminator) Tracking_2nd_PLL_filter::Tracking_2nd_PLL_filter(float pdi_carr) { - //--- PLL variables -------------------------------------------------------- + // PLL variables d_pdi_carr = pdi_carr; // Summation interval for carrier - //d_plldampingratio = 0.65; d_plldampingratio = 0.7; } Tracking_2nd_PLL_filter::Tracking_2nd_PLL_filter() { - //--- PLL variables -------------------------------------------------------- + // PLL variables d_pdi_carr = 0.001; // Summation interval for carrier d_plldampingratio = 0.7; }