1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-04-09 04:06:45 +00:00

Better fix for bug fix that prevented PVT when disabled rx_clock_correction, issue #343

This commit is contained in:
Javier 2020-01-22 12:16:48 +01:00
parent d387e1bf1a
commit 650d637ee2
2 changed files with 11 additions and 5 deletions

View File

@ -195,8 +195,11 @@ void hybrid_observables_gs::msg_handler_pvt_to_observables(const pmt::pmt_t &msg
double new_rx_clock_offset_s;
new_rx_clock_offset_s = boost::any_cast<double>(pmt::any_ref(msg));
T_rx_TOW_ms = T_rx_TOW_ms - static_cast<int>(round(new_rx_clock_offset_s * 1000.0));
//compute the required T_rx_TOW adjustment to match integer multiple of 20 ms
adjust_next_20ms = 20 - T_rx_TOW_ms % 20;
//align the receiver clock to integer multiple of 20 ms
if (T_rx_TOW_ms % 20)
{
T_rx_TOW_ms += 20 - T_rx_TOW_ms % 20;
}
// d_Rx_clock_buffer.clear(); // Clear all the elements in the buffer
for (uint32_t n = 0; n < d_nchannels_out; n++)
{
@ -485,6 +488,11 @@ void hybrid_observables_gs::update_TOW(const std::vector<Gnss_Synchro> &data)
}
}
T_rx_TOW_ms = TOW_ref;
//align the receiver clock to integer multiple of 20 ms
if (T_rx_TOW_ms % 20)
{
T_rx_TOW_ms += 20 - T_rx_TOW_ms % 20;
}
}
else
{
@ -576,8 +584,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused)
for (uint32_t n = 0; n < d_nchannels_out; n++)
{
Gnss_Synchro interpolated_gnss_synchro{};
//align the receiver clock to integer multiple of 20 ms and interpolate observables at current receiver clock
if (!interp_trk_obs(interpolated_gnss_synchro, n, d_Rx_clock_buffer.front() + adjust_next_20ms))
if (!interp_trk_obs(interpolated_gnss_synchro, n, d_Rx_clock_buffer.front()))
{
// Produce an empty observation
interpolated_gnss_synchro = Gnss_Synchro();

View File

@ -89,7 +89,6 @@ private:
bool d_dump;
bool d_dump_mat;
uint32_t T_rx_TOW_ms;
uint32_t adjust_next_20ms;
uint32_t T_rx_step_ms;
uint32_t T_status_report_timer_ms;
uint32_t d_nchannels_in;