mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-06-05 16:14:09 +00:00
Better fix for bug fix that prevented PVT when disabled rx_clock_correction, issue #343
This commit is contained in:
parent
d387e1bf1a
commit
650d637ee2
@ -195,8 +195,11 @@ void hybrid_observables_gs::msg_handler_pvt_to_observables(const pmt::pmt_t &msg
|
|||||||
double new_rx_clock_offset_s;
|
double new_rx_clock_offset_s;
|
||||||
new_rx_clock_offset_s = boost::any_cast<double>(pmt::any_ref(msg));
|
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));
|
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
|
//align the receiver clock to integer multiple of 20 ms
|
||||||
adjust_next_20ms = 20 - T_rx_TOW_ms % 20;
|
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
|
// d_Rx_clock_buffer.clear(); // Clear all the elements in the buffer
|
||||||
for (uint32_t n = 0; n < d_nchannels_out; n++)
|
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;
|
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
|
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++)
|
for (uint32_t n = 0; n < d_nchannels_out; n++)
|
||||||
{
|
{
|
||||||
Gnss_Synchro interpolated_gnss_synchro{};
|
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()))
|
||||||
if (!interp_trk_obs(interpolated_gnss_synchro, n, d_Rx_clock_buffer.front() + adjust_next_20ms))
|
|
||||||
{
|
{
|
||||||
// Produce an empty observation
|
// Produce an empty observation
|
||||||
interpolated_gnss_synchro = Gnss_Synchro();
|
interpolated_gnss_synchro = Gnss_Synchro();
|
||||||
|
@ -89,7 +89,6 @@ private:
|
|||||||
bool d_dump;
|
bool d_dump;
|
||||||
bool d_dump_mat;
|
bool d_dump_mat;
|
||||||
uint32_t T_rx_TOW_ms;
|
uint32_t T_rx_TOW_ms;
|
||||||
uint32_t adjust_next_20ms;
|
|
||||||
uint32_t T_rx_step_ms;
|
uint32_t T_rx_step_ms;
|
||||||
uint32_t T_status_report_timer_ms;
|
uint32_t T_status_report_timer_ms;
|
||||||
uint32_t d_nchannels_in;
|
uint32_t d_nchannels_in;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user