From 8b55e9ffd2f915ddc49b57779cfce879e049afb6 Mon Sep 17 00:00:00 2001 From: Damian Miralles Date: Tue, 27 Feb 2018 20:51:24 -0700 Subject: [PATCH 1/8] bugfix: Fix log time in RINEX Observation Data for GLONASS Fixes issue with time being logged to the observation file in GLONASS. The code was not accounting for the leap seconds when logging the observation timeS --- ...nss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf | 6 +++--- conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf | 10 +++++----- src/algorithms/PVT/libs/rinex_printer.cc | 20 +++++++++---------- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/conf/gnss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf b/conf/gnss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf index aa37222fd..050e145a9 100644 --- a/conf/gnss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf +++ b/conf/gnss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf @@ -6,7 +6,7 @@ Receiver.sources_count=2 ;######### SIGNAL_SOURCE CONFIG ############ SignalSource0.implementation=File_Signal_Source -SignalSource0.filename=/archive/NT1065_L1_20160923_fs6625e6_if60e3_schar.bin ; <- PUT YOUR FILE HERE +SignalSource0.filename=/media/dmiralles/Seagate Backup Plus Drive/GNSS Data/NT1065_L1_20160923_fs6625e6_if60e3_schar.bin ; <- PUT YOUR FILE HERE SignalSource0.item_type=ibyte SignalSource0.sampling_frequency=6625000 SignalSource0.samples=0 @@ -14,7 +14,7 @@ SignalSource0.dump=false; SignalSource0.dump_filename=/archive/signal_glonass.bin SignalSource1.implementation=File_Signal_Source -SignalSource1.filename=/archive/NT1065_GLONASS_L1_20160923_fs6625e6_if0e3_schar.bin ; <- PUT YOUR FILE HERE +SignalSource1.filename=/media/dmiralles/Seagate Backup Plus Drive/GNSS Data/NT1065_GLONASS_L1_20160923_fs6625e6_if0e3_schar.bin ; <- PUT YOUR FILE HERE SignalSource1.item_type=ibyte SignalSource1.sampling_frequency=6625000 SignalSource1.samples=0 @@ -138,4 +138,4 @@ PVT.rtcm_MT1019_rate_ms=5000 PVT.rtcm_MT1045_rate_ms=5000 PVT.rtcm_MT1097_rate_ms=1000 PVT.rtcm_MT1077_rate_ms=1000 -PVT.rinex_version=3 +PVT.rinex_version=2 diff --git a/conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf b/conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf index a256bd370..1541f1126 100644 --- a/conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf +++ b/conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf @@ -5,7 +5,7 @@ GNSS-SDR.internal_fs_sps=6625000 ;######### SIGNAL_SOURCE CONFIG ############ SignalSource.implementation=File_Signal_Source -SignalSource.filename=/archive/NT1065_GLONASS_L1_20160923_fs6625e6_if0e3_schar.bin ; <- PUT YOUR FILE HERE +SignalSource.filename=/media/dmiralles/Seagate Backup Plus Drive/GNSS Data/NT1065_GLONASS_L1_20160924_fs6625e6_if0e3_schar.bin ; <- PUT YOUR FILE HERE SignalSource.item_type=ibyte SignalSource.sampling_frequency=6625000 SignalSource.samples=0 @@ -39,7 +39,7 @@ Acquisition_1G.pfa=0.0001 Acquisition_1G.if=0 Acquisition_1G.doppler_max=10000 Acquisition_1G.doppler_step=250 -Acquisition_1G.dump=false; +Acquisition_1G.dump=true; Acquisition_1G.dump_filename=/archive/glo_acquisition.dat ;Acquisition_1G.coherent_integration_time_ms=1 ;Acquisition_1G.max_dwells = 5 @@ -51,7 +51,7 @@ Tracking_1G.if=0 Tracking_1G.early_late_space_chips=0.5 Tracking_1G.pll_bw_hz=25.0; Tracking_1G.dll_bw_hz=3.0; -Tracking_1G.dump=false; +Tracking_1G.dump=true; Tracking_1G.dump_filename=/archive/glo_tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ @@ -59,7 +59,7 @@ TelemetryDecoder_1G.implementation=GLONASS_L1_CA_Telemetry_Decoder ;######### OBSERVABLES CONFIG ############ Observables.implementation=Hybrid_Observables -Observables.dump=false; +Observables.dump=true; Observables.dump_filename=/archive/glo_observables.dat ;######### PVT CONFIG ############ @@ -76,4 +76,4 @@ PVT.rtcm_MT1019_rate_ms=5000 PVT.rtcm_MT1045_rate_ms=5000 PVT.rtcm_MT1097_rate_ms=1000 PVT.rtcm_MT1077_rate_ms=1000 -PVT.rinex_version=3 +PVT.rinex_version=2 diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 0eabf724f..58ce9f0d1 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -6019,6 +6019,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri { // RINEX observations timestamps are GPS timestamps. std::string line; + double int_sec = 0; // Avoid compiler warning if(glonass_band.size()){} @@ -6027,12 +6028,12 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri std::string timestring = boost::posix_time::to_iso_string(p_glonass_time); //double utc_t = nav_msg.utc_time(nav_msg.sv_clock_correction(obs_time)); //double gps_t = eph.sv_clock_correction(obs_time); - double glonass_t = obs_time; std::string month (timestring, 4, 2); std::string day (timestring, 6, 2); std::string hour (timestring, 9, 2); std::string minutes (timestring, 11, 2); + double utc_sec = modf (obs_time , &int_sec) + p_glonass_time.time_of_day().seconds() ; if (version == 2) { @@ -6065,12 +6066,11 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri line += std::string(1, ' '); line += minutes; line += std::string(1, ' '); - double second_ = fmod(glonass_t, 60); - if (second_ < 10) + if (utc_sec < 10) { line += std::string(1, ' '); } - line += Rinex_Printer::asString(second_, 7); + line += Rinex_Printer::asString(utc_sec, 7); line += std::string(2, ' '); // Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event line += std::string(1, '0'); @@ -6168,13 +6168,12 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri line += minutes; line += std::string(1, ' '); - double seconds = fmod(glonass_t, 60); // Add extra 0 if seconds are < 10 - if (seconds < 10) + if (utc_sec < 10) { line += std::string(1, '0'); } - line += Rinex_Printer::asString(seconds, 7); + line += Rinex_Printer::asString(utc_sec, 7); line += std::string(2, ' '); // Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event line += std::string(1, '0'); @@ -8338,12 +8337,11 @@ boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Glonass_Gnav_Ephe boost::posix_time::ptime ls_time(d3, t3); if (utc_time >= ls_time) { - // We subtract the leap second when going from gpst to utc - utc_time = utc_time - boost::posix_time::time_duration(0,0,fabs(GLONASS_LEAP_SECONDS[i][6])); + // We subtract the leap second when going from gpst to utc, values store as negatives + utc_time = utc_time + boost::posix_time::time_duration(0,0,GLONASS_LEAP_SECONDS[i][6]); break; } } - return utc_time; } @@ -8351,7 +8349,7 @@ double Rinex_Printer::get_leap_second(const Glonass_Gnav_Ephemeris& eph, const d { double tod = 0.0; double glot2utc = 3*3600; - double obs_time_utc = 0.0, obs_time_glot = 0.0; + double obs_time_glot = 0.0; int i = 0; double leap_second = 0; From 75baef3110aa4fc92b8e466038748786e9d3dda6 Mon Sep 17 00:00:00 2001 From: Antonio Ramos Date: Tue, 6 Mar 2018 17:10:34 +0100 Subject: [PATCH 2/8] Fix clang format problems in Eclipse --- .clang-format | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.clang-format b/.clang-format index 2c827e4ef..b1e46057f 100644 --- a/.clang-format +++ b/.clang-format @@ -37,8 +37,6 @@ BreakBeforeBinaryOperators: None BreakBeforeBraces: GNU BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: false -BreakAfterJavaFieldAnnotations: false -BreakStringLiterals: true ColumnLimit: 0 CommentPragmas: '^ IWYU pragma:' ConstructorInitializerAllOnOneLineOrOnePerLine: true @@ -56,12 +54,9 @@ IncludeCategories: Priority: 2 - Regex: '.*' Priority: 3 -IncludeIsMainRegex: '([-_](test|unittest))?$' IndentCaseLabels: false IndentWidth: 4 IndentWrappedFunctionNames: false -JavaScriptQuotes: Leave -JavaScriptWrapImports: true KeepEmptyLinesAtTheStartOfBlocks: false MacroBlockBegin: '' MacroBlockEnd: '' @@ -80,7 +75,6 @@ PointerAlignment: Left ReflowComments: true SortIncludes: false SpaceAfterCStyleCast: false -SpaceAfterTemplateKeyword: true SpaceBeforeAssignmentOperators: true SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: false From 65fd1e7e45a37d3640976715ef1f9251eb5f037c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 10 Mar 2018 10:58:09 +0100 Subject: [PATCH 3/8] Find googletest in OpenSUSE (gtest package) --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1dcd4d375..09cf1a452 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -449,7 +449,7 @@ if(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) endif(LIBGTEST_DEV_DIR) find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS ${GTEST_DIR}/include) else(GTEST_DIR) - find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS /usr/src/googletest/googletest /usr/src/gtest /opt/local/src/gtest-1.7.0 ) + find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS /usr/src/googletest/googletest /usr/src/gtest /usr/include/gtest /opt/local/src/gtest-1.7.0 ) find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS /usr/include /opt/local/src/gtest-1.7.0/include) if(LIBGTEST_DEV_DIR) message (STATUS "Googletest package has been found.") @@ -1131,7 +1131,7 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") message(FATAL_ERROR "aclocal is required to build matio from source") endif(EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - endif(OS_IS_LINUX) + endif(OS_IS_LINUX) find_package(HDF5) if(HDF5_FOUND) list(GET HDF5_LIBRARIES 0 HDF5_FIRST_DIR) From e648f38f6fe952403557071bb48aefa9c884c247 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 10 Mar 2018 12:56:30 +0100 Subject: [PATCH 4/8] Fix some merging problems --- ...nss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf | 4 +- conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf | 2 +- src/algorithms/PVT/libs/rinex_printer.cc | 206 +++++++++--------- 3 files changed, 105 insertions(+), 107 deletions(-) diff --git a/conf/gnss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf b/conf/gnss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf index 050e145a9..53d903ba3 100644 --- a/conf/gnss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf +++ b/conf/gnss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf @@ -6,7 +6,7 @@ Receiver.sources_count=2 ;######### SIGNAL_SOURCE CONFIG ############ SignalSource0.implementation=File_Signal_Source -SignalSource0.filename=/media/dmiralles/Seagate Backup Plus Drive/GNSS Data/NT1065_L1_20160923_fs6625e6_if60e3_schar.bin ; <- PUT YOUR FILE HERE +SignalSource0.filename=/archive/NT1065_L1_20160923_fs6625e6_if60e3_schar.bin ; <- PUT YOUR FILE HERE SignalSource0.item_type=ibyte SignalSource0.sampling_frequency=6625000 SignalSource0.samples=0 @@ -14,7 +14,7 @@ SignalSource0.dump=false; SignalSource0.dump_filename=/archive/signal_glonass.bin SignalSource1.implementation=File_Signal_Source -SignalSource1.filename=/media/dmiralles/Seagate Backup Plus Drive/GNSS Data/NT1065_GLONASS_L1_20160923_fs6625e6_if0e3_schar.bin ; <- PUT YOUR FILE HERE +SignalSource1.filename=/archive/NT1065_GLONASS_L1_20160923_fs6625e6_if0e3_schar.bin ; <- PUT YOUR FILE HERE SignalSource1.item_type=ibyte SignalSource1.sampling_frequency=6625000 SignalSource1.samples=0 diff --git a/conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf b/conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf index 1541f1126..fe8f57080 100644 --- a/conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf +++ b/conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf @@ -5,7 +5,7 @@ GNSS-SDR.internal_fs_sps=6625000 ;######### SIGNAL_SOURCE CONFIG ############ SignalSource.implementation=File_Signal_Source -SignalSource.filename=/media/dmiralles/Seagate Backup Plus Drive/GNSS Data/NT1065_GLONASS_L1_20160924_fs6625e6_if0e3_schar.bin ; <- PUT YOUR FILE HERE +SignalSource.filename=/archive/NT1065_GLONASS_L1_20160924_fs6625e6_if0e3_schar.bin ; <- PUT YOUR FILE HERE SignalSource.item_type=ibyte SignalSource.sampling_frequency=6625000 SignalSource.samples=0 diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 1b409a8e7..718393f3f 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -47,8 +47,6 @@ using google::LogMessage; -DEFINE_string(RINEX_version, "3.02", "Specifies the RINEX version (2.11 or 3.02)"); - Rinex_Printer::Rinex_Printer(int conf_version) { @@ -3960,31 +3958,31 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris out << line << std::endl; // -------- Line MARKER NAME - line.clear(); - line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, - line += Rinex_Printer::leftJustify("MARKER NAME", 20); - Rinex_Printer::lengthCheck(line); - out << line << std::endl; + line.clear(); + line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, + line += Rinex_Printer::leftJustify("MARKER NAME", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; // -------- Line MARKER NUMBER / TYPE if (version == 2) - { - line.clear(); - line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property - line += std::string(40, ' '); - line += Rinex_Printer::leftJustify("MARKER NUMBER", 20); - Rinex_Printer::lengthCheck(line); - out << line << std::endl; - } - if (version == 3) - { - line.clear(); - line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property - line += std::string(40, ' '); - line += Rinex_Printer::leftJustify("MARKER TYPE", 20); - Rinex_Printer::lengthCheck(line); - out << line << std::endl; - } + { + line.clear(); + line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property + line += std::string(40, ' '); + line += Rinex_Printer::leftJustify("MARKER NUMBER", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + } + if (version == 3) + { + line.clear(); + line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property + line += std::string(40, ' '); + line += Rinex_Printer::leftJustify("MARKER TYPE", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + } // -------- Line OBSERVER / AGENCY line.clear(); @@ -4279,7 +4277,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& // -------- Line MARKER NAME line.clear(); - line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, + line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, line += Rinex_Printer::leftJustify("MARKER NAME", 20); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -6011,20 +6009,20 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri //double utc_t = nav_msg.utc_time(nav_msg.sv_clock_correction(obs_time)); //double gps_t = eph.sv_clock_correction(obs_time); - std::string month (timestring, 4, 2); - std::string day (timestring, 6, 2); - std::string hour (timestring, 9, 2); - std::string minutes (timestring, 11, 2); - double utc_sec = modf (obs_time , &int_sec) + p_glonass_time.time_of_day().seconds() ; + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); + double utc_sec = modf(obs_time, &int_sec) + p_glonass_time.time_of_day().seconds(); if (version == 2) { line.clear(); - std::string year (timestring, 2, 2); + std::string year(timestring, 2, 2); line += std::string(1, ' '); line += year; line += std::string(1, ' '); - if (month.compare(0, 1 , "0") == 0) + if (month.compare(0, 1, "0") == 0) { line += std::string(1, ' '); line += month.substr(1, 1); @@ -6034,7 +6032,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri line += month; } line += std::string(1, ' '); - if (day.compare(0, 1 , "0") == 0) + if (day.compare(0, 1, "0") == 0) { line += std::string(1, ' '); line += day.substr(1, 1); @@ -6152,9 +6150,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri line += std::string(1, ' '); // Add extra 0 if seconds are < 10 if (utc_sec < 10) - { - line += std::string(1, '0'); - } + { + line += std::string(1, '0'); + } line += Rinex_Printer::asString(utc_sec, 7); line += std::string(2, ' '); // Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event @@ -8121,10 +8119,10 @@ void Rinex_Printer::to_date_time(int gps_week, int gps_tow, int& year, int& mont } // find month - for (int m = 1; true ; m++) + for (int m = 1; true; m++) { - int secs_in_month_m = days_per_month[m-1]*secs_per_day; - if (is_leap_year && m == 2 ) // consider February of leap year + int secs_in_month_m = days_per_month[m - 1] * secs_per_day; + if (is_leap_year && m == 2) // consider February of leap year { secs_in_month_m += secs_per_day; } @@ -8142,14 +8140,14 @@ void Rinex_Printer::to_date_time(int gps_week, int gps_tow, int& year, int& mont //std::cout << "month: m=" << m << " secs_in_month_m="<< secs_in_month_m << " remaining_secs="<< remaining_secs << std::endl; } - day = remaining_secs/secs_per_day+1; - remaining_secs = remaining_secs%secs_per_day; + day = remaining_secs / secs_per_day + 1; + remaining_secs = remaining_secs % secs_per_day; - hour = remaining_secs/(60*60); - remaining_secs = remaining_secs%(60*60); + hour = remaining_secs / (60 * 60); + remaining_secs = remaining_secs % (60 * 60); - minute = remaining_secs/60; - second = remaining_secs%60; + minute = remaining_secs / 60; + second = remaining_secs % 60; } @@ -8296,82 +8294,82 @@ boost::posix_time::ptime Rinex_Printer::compute_Galileo_time(const Galileo_Ephem boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Glonass_Gnav_Ephemeris& eph, const double obs_time) { double tod = 0.0; - double glot2utc = 3*3600; - double obs_time_utc = 0.0, obs_time_glot = 0.0; - int i = 0; + double glot2utc = 3 * 3600; + double obs_time_utc = 0.0, obs_time_glot = 0.0; + int i = 0; - // Get observation time in nearly GLONASS time. Correction for leap seconds done at the end - obs_time_glot = obs_time + glot2utc; + // Get observation time in nearly GLONASS time. Correction for leap seconds done at the end + obs_time_glot = obs_time + glot2utc; - // Get seconds of day in glonass time - tod = fmod (obs_time_glot, 86400); + // Get seconds of day in glonass time + tod = fmod(obs_time_glot, 86400); - // Form date and time duration types - boost::posix_time::time_duration t1(0, 0, tod); - boost::gregorian::date d1(eph.d_yr, 1, 1); - boost::gregorian::days d2(eph.d_N_T-1); - boost::posix_time::ptime glo_time(d1 + d2, t1); + // Form date and time duration types + boost::posix_time::time_duration t1(0, 0, tod); + boost::gregorian::date d1(eph.d_yr, 1, 1); + boost::gregorian::days d2(eph.d_N_T - 1); + boost::posix_time::ptime glo_time(d1 + d2, t1); - // Convert to utc - boost::posix_time::time_duration t2(0, 0, glot2utc); - boost::posix_time::ptime utc_time = glo_time - t2; + // Convert to utc + boost::posix_time::time_duration t2(0, 0, glot2utc); + boost::posix_time::ptime utc_time = glo_time - t2; - // Adjust for leap second correction - for (i = 0; GLONASS_LEAP_SECONDS[i][0]>0; i++) - { - boost::posix_time::time_duration t3(GLONASS_LEAP_SECONDS[i][3], GLONASS_LEAP_SECONDS[i][4], GLONASS_LEAP_SECONDS[i][5]); - boost::gregorian::date d3(GLONASS_LEAP_SECONDS[i][0], GLONASS_LEAP_SECONDS[i][1], GLONASS_LEAP_SECONDS[i][2]); - boost::posix_time::ptime ls_time(d3, t3); - if (utc_time >= ls_time) - { - // We subtract the leap second when going from gpst to utc, values store as negatives - utc_time = utc_time + boost::posix_time::time_duration(0,0,GLONASS_LEAP_SECONDS[i][6]); - break; - } - } + // Adjust for leap second correction + for (i = 0; GLONASS_LEAP_SECONDS[i][0] > 0; i++) + { + boost::posix_time::time_duration t3(GLONASS_LEAP_SECONDS[i][3], GLONASS_LEAP_SECONDS[i][4], GLONASS_LEAP_SECONDS[i][5]); + boost::gregorian::date d3(GLONASS_LEAP_SECONDS[i][0], GLONASS_LEAP_SECONDS[i][1], GLONASS_LEAP_SECONDS[i][2]); + boost::posix_time::ptime ls_time(d3, t3); + if (utc_time >= ls_time) + { + // We subtract the leap second when going from gpst to utc, values store as negatives + utc_time = utc_time + boost::posix_time::time_duration(0, 0, GLONASS_LEAP_SECONDS[i][6]); + break; + } + } - return utc_time; + return utc_time; } double Rinex_Printer::get_leap_second(const Glonass_Gnav_Ephemeris& eph, const double gps_obs_time) { double tod = 0.0; - double glot2utc = 3*3600; - double obs_time_glot = 0.0; - int i = 0; - double leap_second = 0; + double glot2utc = 3 * 3600; + double obs_time_glot = 0.0; + int i = 0; + double leap_second = 0; - // Get observation time in nearly GLONASS time. Correction for leap seconds done at the end - obs_time_glot = gps_obs_time + glot2utc; + // Get observation time in nearly GLONASS time. Correction for leap seconds done at the end + obs_time_glot = gps_obs_time + glot2utc; - // Get seconds of day in glonass time - tod = fmod (obs_time_glot, 86400); + // Get seconds of day in glonass time + tod = fmod(obs_time_glot, 86400); - // Form date and time duration types - boost::posix_time::time_duration t1(0, 0, tod); - boost::gregorian::date d1(eph.d_yr, 1, 1); - boost::gregorian::days d2(eph.d_N_T-1); - boost::posix_time::ptime glo_time(d1 + d2, t1); + // Form date and time duration types + boost::posix_time::time_duration t1(0, 0, tod); + boost::gregorian::date d1(eph.d_yr, 1, 1); + boost::gregorian::days d2(eph.d_N_T - 1); + boost::posix_time::ptime glo_time(d1 + d2, t1); - // Convert to utc - boost::posix_time::time_duration t2(0, 0, glot2utc); - boost::posix_time::ptime utc_time = glo_time - t2; + // Convert to utc + boost::posix_time::time_duration t2(0, 0, glot2utc); + boost::posix_time::ptime utc_time = glo_time - t2; - // Adjust for leap second correction - for (i = 0; GLONASS_LEAP_SECONDS[i][0]>0; i++) - { - boost::posix_time::time_duration t3(GLONASS_LEAP_SECONDS[i][3], GLONASS_LEAP_SECONDS[i][4], GLONASS_LEAP_SECONDS[i][5]); - boost::gregorian::date d3(GLONASS_LEAP_SECONDS[i][0], GLONASS_LEAP_SECONDS[i][1], GLONASS_LEAP_SECONDS[i][2]); - boost::posix_time::ptime ls_time(d3, t3); - if (utc_time >= ls_time) - { - // We subtract the leap second when going from gpst to utc - leap_second = fabs(GLONASS_LEAP_SECONDS[i][6]); - break; - } - } + // Adjust for leap second correction + for (i = 0; GLONASS_LEAP_SECONDS[i][0] > 0; i++) + { + boost::posix_time::time_duration t3(GLONASS_LEAP_SECONDS[i][3], GLONASS_LEAP_SECONDS[i][4], GLONASS_LEAP_SECONDS[i][5]); + boost::gregorian::date d3(GLONASS_LEAP_SECONDS[i][0], GLONASS_LEAP_SECONDS[i][1], GLONASS_LEAP_SECONDS[i][2]); + boost::posix_time::ptime ls_time(d3, t3); + if (utc_time >= ls_time) + { + // We subtract the leap second when going from gpst to utc + leap_second = fabs(GLONASS_LEAP_SECONDS[i][6]); + break; + } + } - return leap_second; + return leap_second; } From d74f00c39a38eb79f7444fd928f134e3808f106c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 10 Mar 2018 13:30:11 +0100 Subject: [PATCH 5/8] Remove unused variable --- src/algorithms/PVT/libs/rinex_printer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 718393f3f..fa6b1296c 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -8295,7 +8295,7 @@ boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Glonass_Gnav_Ephe { double tod = 0.0; double glot2utc = 3 * 3600; - double obs_time_utc = 0.0, obs_time_glot = 0.0; + double obs_time_glot = 0.0; int i = 0; // Get observation time in nearly GLONASS time. Correction for leap seconds done at the end From 6a79018d2c4d56b122be4988bda4dc06c0560022 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 10 Mar 2018 23:00:09 +0100 Subject: [PATCH 6/8] Add more verbose messages --- CMakeLists.txt | 12 ++++++------ src/tests/CMakeLists.txt | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09cf1a452..2e90646f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -330,7 +330,7 @@ set(GNSSSDR_ARMADILLO_LOCAL_VERSION "unstable") set(GNSSSDR_GTEST_LOCAL_VERSION "1.8.0") set(GNSSSDR_GNSS_SIM_LOCAL_VERSION "master") set(GNSSSDR_GPSTK_LOCAL_VERSION "2.10") -set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.11") +set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.12") @@ -455,7 +455,7 @@ if(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) message (STATUS "Googletest package has been found.") else(LIBGTEST_DEV_DIR) message (STATUS " Googletest has not been found.") - message (STATUS " Googletest will be downloaded and built automatically ") + message (STATUS " Googletest v${GNSSSDR_GTEST_LOCAL_VERSION} will be downloaded and built automatically ") message (STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ") endif(LIBGTEST_DEV_DIR) endif(GTEST_DIR) @@ -699,7 +699,7 @@ set(LOCAL_GFLAGS false) find_package(GFlags) if (NOT GFlags_FOUND) message (STATUS " gflags library has not been found.") - message (STATUS " gflags will be downloaded and built automatically ") + message (STATUS " gflags v${GNSSSDR_GFLAGS_LOCAL_VERSION} will be downloaded and built automatically ") message (STATUS " when doing 'make'. ") if(CMAKE_VERSION VERSION_LESS 3.2) @@ -767,7 +767,7 @@ if (NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) if(NOT GFlags_FOUND) message(STATUS " or it is likely not linked to gflags.") endif(NOT GFlags_FOUND) - message (STATUS " glog will be downloaded and built automatically ") + message (STATUS " glog v${GNSSSDR_GLOG_LOCAL_VERSION} will be downloaded and built automatically ") message (STATUS " when doing 'make'. ") if(NOT ${LOCAL_GFLAGS}) add_library(gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} UNKNOWN IMPORTED) @@ -956,7 +956,7 @@ endif(ARMADILLO_FOUND) if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) message(STATUS " Armadillo has not been found.") - message(STATUS " Armadillo will be downloaded and built automatically") + message(STATUS " Armadillo ${GNSSSDR_ARMADILLO_LOCAL_VERSION} will be downloaded and built automatically") message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ") set(armadillo_BRANCH ${GNSSSDR_ARMADILLO_LOCAL_VERSION}) set(armadillo_RELEASE ${armadillo_BRANCH}) @@ -1099,7 +1099,7 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS if(MATIO_FOUND) message(STATUS " Matio installed version (${MATIO_VERSION_STRING}) is too old (>= ${GNSSSDR_MATIO_MIN_VERSION} is required).") endif(MATIO_FOUND) - message(STATUS " Matio will be downloaded and built automatically") + message(STATUS " Matio v${GNSSSDR_MATIO_LOCAL_VERSION} will be downloaded and built automatically") message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ") find_package(ZLIB) if(ZLIB_FOUND) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 85853b429..6090235b4 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -209,6 +209,7 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) ################################################################################ find_package(GPSTK) if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) + message(STATUS "GPSTk v${GNSSSDR_GPSTK_LOCAL_VERSION} will be automatically donwloaded and built when doing 'make'.") if(NOT ENABLE_FPGA) if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add( From 986487ba26fefa8752924ac6e278c61c8fb479cc Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 10 Mar 2018 23:01:12 +0100 Subject: [PATCH 7/8] Fix circle color --- src/utils/reproducibility/ieee-access18/plot_dump.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/reproducibility/ieee-access18/plot_dump.m b/src/utils/reproducibility/ieee-access18/plot_dump.m index 6bbb388c5..efc06e649 100644 --- a/src/utils/reproducibility/ieee-access18/plot_dump.m +++ b/src/utils/reproducibility/ieee-access18/plot_dump.m @@ -186,7 +186,7 @@ plot(0,0,'k*'); [x,y,z] = cylinder([TWO_DRMS TWO_DRMS],200); -plot(x(1,:),y(1,:),[0 0.6 0],'Color',[0 0.6 0]); +plot(x(1,:),y(1,:),'Color',[0 0.6 0]); str = strcat('2DRMS=',num2str(TWO_DRMS), ' m'); text(cosd(65)*TWO_DRMS,sind(65)*TWO_DRMS,str,'Color',[0 0.6 0]); From df1a3a13df7047f82854a37238c46bb3a99c60f0 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 11 Mar 2018 20:09:49 +0100 Subject: [PATCH 8/8] Fix satellite --- .../reproducibility/ieee-access18/L2-access18.conf | 9 +++++++-- src/utils/reproducibility/ieee-access18/plot_dump.m | 10 ++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/utils/reproducibility/ieee-access18/L2-access18.conf b/src/utils/reproducibility/ieee-access18/L2-access18.conf index fff74d193..57e1af0a3 100644 --- a/src/utils/reproducibility/ieee-access18/L2-access18.conf +++ b/src/utils/reproducibility/ieee-access18/L2-access18.conf @@ -69,6 +69,9 @@ Channel7.signal=2S Channel8.signal=2S Channel9.signal=2S +;######### SPECIFIC CHANNELS CONFIG ###### + +Channel0.satellite=19 ;######### ACQUISITION GLOBAL CONFIG ############ @@ -89,14 +92,13 @@ Acquisition_2S.blocking=true ;######### TRACKING GLOBAL CONFIG ############ - Tracking_2S.implementation=GPS_L2_M_DLL_PLL_Tracking Tracking_2S.item_type=gr_complex Tracking_2S.pll_bw_hz=4.0; -Tracking_2S.dll_bw_hz=0.75; +Tracking_2S.dll_bw_hz=1; Tracking_2S.early_late_space_chips=0.5; @@ -104,14 +106,17 @@ Tracking_2S.dump=true Tracking_2S.dump_filename=./data/track_ch_ + ;######### TELEMETRY DECODER CONFIG ############ TelemetryDecoder_2S.implementation=GPS_L2C_Telemetry_Decoder + ;######### OBSERVABLES CONFIG ############ Observables.implementation=Hybrid_Observables + ;######### PVT CONFIG ############ PVT.implementation=RTKLIB_PVT diff --git a/src/utils/reproducibility/ieee-access18/plot_dump.m b/src/utils/reproducibility/ieee-access18/plot_dump.m index efc06e649..09941acf9 100644 --- a/src/utils/reproducibility/ieee-access18/plot_dump.m +++ b/src/utils/reproducibility/ieee-access18/plot_dump.m @@ -227,11 +227,13 @@ hSurface=surf(MRSE*x,MRSE*y,MRSE*z); % sphere centered at origin set(hSurface,'facecolor','none','edgecolor',[0 0.6 0],'edgealpha',1,'facealpha',1); %axis equal; -xlabel('North [m]','fontname','Times','fontsize', fontsize) -ylabel('East [m]','fontname','Times','fontsize', fontsize) -zlabel('Up [m]','fontname','Times','fontsize', fontsize) -str = strcat('MRSE=',num2str(MRSE), ' m'); +xlabel('North [m]','fontname','Times','fontsize', fontsize-2) +ylabel('East [m]','fontname','Times','fontsize', fontsize-2) +zlabel('Up [m]','fontname','Times','fontsize', fontsize-2) +str = strcat('MRSE=',num2str(MRSE), ' m') text(cosd(45)*MRSE,sind(45)*MRSE,20,str,'Color',[0 0.6 0]); +a=gca; +set(a,'fontsize',fontsize-6) hh=findall(hf,'-property','FontName'); set(hh,'FontName','Times');