Bug fix that prevented PVT when disabled rx_clock_correction, issue #343

This commit is contained in:
Javier 2020-01-22 11:24:07 +01:00
parent 99368616ec
commit d387e1bf1a
2 changed files with 5 additions and 1 deletions

View File

@ -195,6 +195,8 @@ 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;
// d_Rx_clock_buffer.clear(); // Clear all the elements in the buffer
for (uint32_t n = 0; n < d_nchannels_out; n++)
{
@ -574,7 +576,8 @@ 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{};
if (!interp_trk_obs(interpolated_gnss_synchro, n, d_Rx_clock_buffer.front()))
//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))
{
// Produce an empty observation
interpolated_gnss_synchro = Gnss_Synchro();

View File

@ -89,6 +89,7 @@ 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;