diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 7ef4c8c36..5365a3a08 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -1000,12 +1000,6 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ // gtime_t rtklib_utc_time = gpst2utc(pvt_sol.time); //Corrected RX Time (Non integer multiply of 1 ms of granularity) // Uncorrected RX Time (integer multiply of 1 ms and the same observables time reported in RTCM and RINEX) gtime_t rtklib_time = timeadd(pvt_sol.time, rx_position_and_time(3)); //uncorrected rx time - if (gnss_observables_map.begin()->second.RX_time < 18000.0) - { - //p_time += boost::posix_time::seconds(604800); - rtklib_time = timeadd(rtklib_time, 604800); - } - gtime_t rtklib_utc_time = gpst2utc(rtklib_time); p_time = boost::posix_time::from_time_t(rtklib_utc_time.time); p_time += boost::posix_time::microseconds(static_cast(round(rtklib_utc_time.sec * 1e6))); // NOLINT(google-runtime-int) diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.cc b/src/algorithms/libs/rtklib/rtklib_conversions.cc index 463a63598..a07abb5b6 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.cc +++ b/src/algorithms/libs/rtklib/rtklib_conversions.cc @@ -119,6 +119,13 @@ obsd_t insert_obs_to_rtklib(obsd_t& rtklib_obs, const Gnss_Synchro& gnss_synchro // } // rtklib_obs.time = gpst2time(adjgpsweek(week), gnss_synchro.RX_time); + //account for the TOW crossover transitory in the first 18 seconds where the week is not yet updated! + if (gnss_synchro.RX_time < 18.0) + { + //p_time += boost::posix_time::seconds(604800); + rtklib_obs.time = timeadd(rtklib_obs.time, 604800); + } + rtklib_obs.rcv = 1; return rtklib_obs; }