mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-31 11:19:18 +00:00
Parameterize the observables processing rate with the global configuration parameter GNSS-SDR.observable_interval_ms, set to 20 by default
This commit is contained in:
parent
ac84750f60
commit
0b5920338f
@ -58,7 +58,9 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration,
|
|||||||
pvt_output_parameters.pre_2009_file = configuration->property("GNSS-SDR.pre_2009_file", false);
|
pvt_output_parameters.pre_2009_file = configuration->property("GNSS-SDR.pre_2009_file", false);
|
||||||
|
|
||||||
// output rate
|
// output rate
|
||||||
pvt_output_parameters.output_rate_ms = bc::lcm(20, configuration->property(role + ".output_rate_ms", 500));
|
pvt_output_parameters.observable_interval_ms = configuration->property("GNSS-SDR.observable_interval_ms", pvt_output_parameters.observable_interval_ms);
|
||||||
|
|
||||||
|
pvt_output_parameters.output_rate_ms = bc::lcm(static_cast<int>(pvt_output_parameters.observable_interval_ms), configuration->property(role + ".output_rate_ms", 500));
|
||||||
|
|
||||||
// display rate
|
// display rate
|
||||||
pvt_output_parameters.display_rate_ms = bc::lcm(pvt_output_parameters.output_rate_ms, configuration->property(role + ".display_rate_ms", 500));
|
pvt_output_parameters.display_rate_ms = bc::lcm(pvt_output_parameters.output_rate_ms, configuration->property(role + ".display_rate_ms", 500));
|
||||||
|
@ -173,6 +173,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels,
|
|||||||
d_nchannels = nchannels;
|
d_nchannels = nchannels;
|
||||||
|
|
||||||
d_type_of_rx = conf_.type_of_receiver;
|
d_type_of_rx = conf_.type_of_receiver;
|
||||||
|
d_observable_interval_ms = conf_.observable_interval_ms;
|
||||||
|
|
||||||
// GPS Ephemeris data message port in
|
// GPS Ephemeris data message port in
|
||||||
this->message_port_register_in(pmt::mp("telemetry"));
|
this->message_port_register_in(pmt::mp("telemetry"));
|
||||||
@ -2003,8 +2004,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
|
|||||||
if (!d_gnss_observables_map_t0.empty())
|
if (!d_gnss_observables_map_t0.empty())
|
||||||
{
|
{
|
||||||
const auto t0_int_ms = static_cast<uint32_t>(d_gnss_observables_map_t0.cbegin()->second.RX_time * 1000.0);
|
const auto t0_int_ms = static_cast<uint32_t>(d_gnss_observables_map_t0.cbegin()->second.RX_time * 1000.0);
|
||||||
const uint32_t adjust_next_20ms = 20 - t0_int_ms % 20;
|
const uint32_t adjust_next_obs_interval_ms = d_observable_interval_ms - t0_int_ms % d_observable_interval_ms;
|
||||||
current_RX_time_ms = t0_int_ms + adjust_next_20ms;
|
current_RX_time_ms = t0_int_ms + adjust_next_obs_interval_ms;
|
||||||
|
|
||||||
if (current_RX_time_ms % d_output_rate_ms == 0)
|
if (current_RX_time_ms % d_output_rate_ms == 0)
|
||||||
{
|
{
|
||||||
|
@ -254,6 +254,7 @@ private:
|
|||||||
|
|
||||||
uint32_t d_nchannels;
|
uint32_t d_nchannels;
|
||||||
uint32_t d_type_of_rx;
|
uint32_t d_type_of_rx;
|
||||||
|
uint32_t d_observable_interval_ms;
|
||||||
|
|
||||||
bool d_dump;
|
bool d_dump;
|
||||||
bool d_dump_mat;
|
bool d_dump_mat;
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
Pvt_Conf::Pvt_Conf()
|
Pvt_Conf::Pvt_Conf()
|
||||||
{
|
{
|
||||||
type_of_receiver = 0U;
|
type_of_receiver = 0U;
|
||||||
|
observable_interval_ms = 20U;
|
||||||
output_rate_ms = 0;
|
output_rate_ms = 0;
|
||||||
display_rate_ms = 0;
|
display_rate_ms = 0;
|
||||||
kml_rate_ms = 1000;
|
kml_rate_ms = 1000;
|
||||||
|
@ -51,6 +51,8 @@ public:
|
|||||||
std::string udp_eph_addresses;
|
std::string udp_eph_addresses;
|
||||||
|
|
||||||
uint32_t type_of_receiver;
|
uint32_t type_of_receiver;
|
||||||
|
uint32_t observable_interval_ms;
|
||||||
|
|
||||||
int32_t output_rate_ms;
|
int32_t output_rate_ms;
|
||||||
int32_t display_rate_ms;
|
int32_t display_rate_ms;
|
||||||
int32_t kml_rate_ms;
|
int32_t kml_rate_ms;
|
||||||
|
@ -31,13 +31,14 @@ HybridObservables::HybridObservables(const ConfigurationInterface* configuration
|
|||||||
dump_mat_ = configuration->property(role + ".dump_mat", true);
|
dump_mat_ = configuration->property(role + ".dump_mat", true);
|
||||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||||
|
|
||||||
Obs_Conf conf;
|
Obs_Conf conf{};
|
||||||
|
|
||||||
conf.dump = dump_;
|
conf.dump = dump_;
|
||||||
conf.dump_mat = dump_mat_;
|
conf.dump_mat = dump_mat_;
|
||||||
conf.dump_filename = dump_filename_;
|
conf.dump_filename = dump_filename_;
|
||||||
conf.nchannels_in = in_streams_;
|
conf.nchannels_in = in_streams_;
|
||||||
conf.nchannels_out = out_streams_;
|
conf.nchannels_out = out_streams_;
|
||||||
|
conf.observable_interval_ms = configuration->property("GNSS-SDR.observable_interval_ms", conf.observable_interval_ms);
|
||||||
conf.enable_carrier_smoothing = configuration->property(role + ".enable_carrier_smoothing", conf.enable_carrier_smoothing);
|
conf.enable_carrier_smoothing = configuration->property(role + ".enable_carrier_smoothing", conf.enable_carrier_smoothing);
|
||||||
|
|
||||||
if (FLAGS_carrier_smoothing_factor == DEFAULT_CARRIER_SMOOTHING_FACTOR)
|
if (FLAGS_carrier_smoothing_factor == DEFAULT_CARRIER_SMOOTHING_FACTOR)
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/io_signature.h>
|
#include <gnuradio/io_signature.h>
|
||||||
#include <matio.h>
|
#include <matio.h>
|
||||||
|
#include <algorithm> // for std::min
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cmath> // for round
|
#include <cmath> // for round
|
||||||
#include <cstdlib> // for size_t, llabs
|
#include <cstdlib> // for size_t, llabs
|
||||||
@ -117,12 +118,11 @@ hybrid_observables_gs::hybrid_observables_gs(const Obs_Conf &conf_) : gr::block(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
d_T_rx_TOW_ms = 0U;
|
d_T_rx_TOW_ms = 0U;
|
||||||
d_T_rx_step_ms = 20; // read from config at the adapter GNSS-SDR.observable_interval_ms!!
|
d_T_rx_step_ms = conf_.observable_interval_ms;
|
||||||
d_T_rx_TOW_set = false;
|
d_T_rx_TOW_set = false;
|
||||||
d_T_status_report_timer_ms = 0;
|
d_T_status_report_timer_ms = 0;
|
||||||
// rework
|
d_Rx_clock_buffer.set_capacity(std::min(std::max(200U / d_T_rx_step_ms, 3U), 10U));
|
||||||
d_Rx_clock_buffer.set_capacity(10); // 10*20 ms = 200 ms of data in buffer
|
d_Rx_clock_buffer.clear();
|
||||||
d_Rx_clock_buffer.clear(); // Clear all the elements in the buffer
|
|
||||||
|
|
||||||
d_channel_last_pll_lock = std::vector<bool>(d_nchannels_out, false);
|
d_channel_last_pll_lock = std::vector<bool>(d_nchannels_out, false);
|
||||||
d_channel_last_pseudorange_smooth = std::vector<double>(d_nchannels_out, 0.0);
|
d_channel_last_pseudorange_smooth = std::vector<double>(d_nchannels_out, 0.0);
|
||||||
@ -191,10 +191,10 @@ void hybrid_observables_gs::msg_handler_pvt_to_observables(const pmt::pmt_t &msg
|
|||||||
{
|
{
|
||||||
const auto new_rx_clock_offset_s = boost::any_cast<double>(pmt::any_ref(msg));
|
const auto new_rx_clock_offset_s = boost::any_cast<double>(pmt::any_ref(msg));
|
||||||
d_T_rx_TOW_ms = d_T_rx_TOW_ms - static_cast<int>(round(new_rx_clock_offset_s * 1000.0));
|
d_T_rx_TOW_ms = d_T_rx_TOW_ms - static_cast<int>(round(new_rx_clock_offset_s * 1000.0));
|
||||||
// align the receiver clock to integer multiple of 20 ms
|
// align the receiver clock to integer multiple of d_T_rx_step_ms
|
||||||
if (d_T_rx_TOW_ms % 20)
|
if (d_T_rx_TOW_ms % d_T_rx_step_ms)
|
||||||
{
|
{
|
||||||
d_T_rx_TOW_ms += 20 - d_T_rx_TOW_ms % 20;
|
d_T_rx_TOW_ms += d_T_rx_step_ms - d_T_rx_TOW_ms % d_T_rx_step_ms;
|
||||||
}
|
}
|
||||||
// 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++)
|
||||||
@ -371,7 +371,7 @@ bool hybrid_observables_gs::interp_trk_obs(Gnss_Synchro &interpolated_obs, uint3
|
|||||||
|
|
||||||
if (nearest_element != -1 and nearest_element != static_cast<int32_t>(d_gnss_synchro_history->size(ch)))
|
if (nearest_element != -1 and nearest_element != static_cast<int32_t>(d_gnss_synchro_history->size(ch)))
|
||||||
{
|
{
|
||||||
if ((static_cast<double>(old_abs_diff) / static_cast<double>(d_gnss_synchro_history->get(ch, nearest_element).fs)) < 0.02)
|
if ((static_cast<double>(old_abs_diff) / static_cast<double>(d_gnss_synchro_history->get(ch, nearest_element).fs)) < static_cast<double>(d_T_rx_step_ms) / 1000.0)
|
||||||
{
|
{
|
||||||
int32_t neighbor_element;
|
int32_t neighbor_element;
|
||||||
if (rx_clock > d_gnss_synchro_history->get(ch, nearest_element).Tracking_sample_counter)
|
if (rx_clock > d_gnss_synchro_history->get(ch, nearest_element).Tracking_sample_counter)
|
||||||
@ -483,10 +483,10 @@ void hybrid_observables_gs::update_TOW(const std::vector<Gnss_Synchro> &data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
d_T_rx_TOW_ms = TOW_ref;
|
d_T_rx_TOW_ms = TOW_ref;
|
||||||
// align the receiver clock to integer multiple of 20 ms
|
// align the receiver clock to integer multiple of d_T_rx_step_ms
|
||||||
if (d_T_rx_TOW_ms % 20)
|
if (d_T_rx_TOW_ms % d_T_rx_step_ms)
|
||||||
{
|
{
|
||||||
d_T_rx_TOW_ms += 20 - d_T_rx_TOW_ms % 20;
|
d_T_rx_TOW_ms += d_T_rx_step_ms - d_T_rx_TOW_ms % d_T_rx_step_ms;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -22,8 +22,9 @@ Obs_Conf::Obs_Conf()
|
|||||||
{
|
{
|
||||||
dump_filename = std::string("obs_dump.dat");
|
dump_filename = std::string("obs_dump.dat");
|
||||||
smoothing_factor = FLAGS_carrier_smoothing_factor;
|
smoothing_factor = FLAGS_carrier_smoothing_factor;
|
||||||
nchannels_in = 0;
|
nchannels_in = 0U;
|
||||||
nchannels_out = 0;
|
nchannels_out = 0U;
|
||||||
|
observable_interval_ms = 20U;
|
||||||
enable_carrier_smoothing = false;
|
enable_carrier_smoothing = false;
|
||||||
dump = false;
|
dump = false;
|
||||||
dump_mat = false;
|
dump_mat = false;
|
||||||
|
@ -36,6 +36,7 @@ public:
|
|||||||
int32_t smoothing_factor;
|
int32_t smoothing_factor;
|
||||||
uint32_t nchannels_in;
|
uint32_t nchannels_in;
|
||||||
uint32_t nchannels_out;
|
uint32_t nchannels_out;
|
||||||
|
uint32_t observable_interval_ms;
|
||||||
bool enable_carrier_smoothing;
|
bool enable_carrier_smoothing;
|
||||||
bool dump;
|
bool dump;
|
||||||
bool dump_mat;
|
bool dump_mat;
|
||||||
|
Loading…
Reference in New Issue
Block a user