From eb0b01d0aa5acd38a7cb178dca83c3293776a7fc Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Feb 2018 01:00:17 +0100 Subject: [PATCH] Add doppler_step flag --- src/algorithms/channel/adapters/channel.cc | 6 ++-- src/algorithms/libs/gnss_sdr_flags.cc | 33 ++++++++++++++-------- src/algorithms/libs/gnss_sdr_flags.h | 27 +++++++++--------- 3 files changed, 40 insertions(+), 26 deletions(-) diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index e66074b7a..59c56eeee 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -33,6 +33,7 @@ #include #include #include "configuration_interface.h" +#include "gnss_sdr_flags.h" using google::LogMessage; @@ -74,8 +75,9 @@ Channel::Channel(ConfigurationInterface *configuration, unsigned int channel, // IMPORTANT: Do not change the order between set_doppler_step and set_threshold - unsigned int doppler_step = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast(channel_) + ".doppler_step" ,0); - if(doppler_step == 0) doppler_step = configuration->property("Acquisition_" + implementation_+".doppler_step", 500); + unsigned int doppler_step = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast(channel_) + ".doppler_step", 0); + if(doppler_step == 0) doppler_step = configuration->property("Acquisition_" + implementation_ + ".doppler_step", 500); + if(FLAGS_doppler_step != 0) doppler_step = static_cast(FLAGS_doppler_step); DLOG(INFO) << "Channel "<< channel_ << " Doppler_step = " << doppler_step; acq_->set_doppler_step(doppler_step); diff --git a/src/algorithms/libs/gnss_sdr_flags.cc b/src/algorithms/libs/gnss_sdr_flags.cc index ea3d0dfbd..0aa8221b5 100644 --- a/src/algorithms/libs/gnss_sdr_flags.cc +++ b/src/algorithms/libs/gnss_sdr_flags.cc @@ -33,29 +33,31 @@ #include #include -DEFINE_string(c, "-", "Path to the configuration file (if set, overrides --config_file)"); +DEFINE_string(c, "-", "Path to the configuration file (if set, overrides --config_file)."); DEFINE_string(s, "-", - "If defined, path to the file containing the signal samples (overrides the configuration file and --signal_source)"); + "If defined, path to the file containing the signal samples (overrides the configuration file and --signal_source)."); DEFINE_string(signal_source, "-", - "If defined, path to the file containing the signal samples (overrides the configuration file)"); + "If defined, path to the file containing the signal samples (overrides the configuration file)."); -DEFINE_int32(doppler_max, 0, "If defined, maximum Doppler value in the search grid, in Hz (overrides the configuration file)"); +DEFINE_int32(doppler_max, 0, "If defined, sets the maximum Doppler value in the search grid, in Hz (overrides the configuration file)."); -DEFINE_int32(cn0_samples, 20, "Number of correlator outputs used for CN0 estimation"); +DEFINE_int32(doppler_step, 0, "If defined, sets the frequency step in the search grid, in Hz (overrides the configuration file)."); -DEFINE_int32(cn0_min, 25, "Minimum valid CN0 (in dB-Hz)"); +DEFINE_int32(cn0_samples, 20, "Number of correlator outputs used for CN0 estimation."); -DEFINE_int32(max_lock_fail, 50, "Number number of lock failures before dropping satellite"); +DEFINE_int32(cn0_min, 25, "Minimum valid CN0 (in dB-Hz)."); -DEFINE_double(carrier_lock_th, 0.85, "Carrier lock threshold (in rad)"); +DEFINE_int32(max_lock_fail, 50, "Number number of lock failures before dropping satellite."); -DEFINE_string(RINEX_version, "3.02", "Specifies the RINEX version (2.11 or 3.02)"); +DEFINE_double(carrier_lock_th, 0.85, "Carrier lock threshold (in rad)."); -DEFINE_double(dll_bw_hz, 0.0, "If defined, bandwidth of the DLL low pass filter, in Hz (overrides the configuration file)"); +DEFINE_string(RINEX_version, "-", "If defined, specifies the RINEX version (2.11 or 3.02). Overrides the configuration file."); -DEFINE_double(pll_bw_hz, 0.0, "If defined, bandwidth of the PLL low pass filter, in Hz (overrides the configuration file)"); +DEFINE_double(dll_bw_hz, 0.0, "If defined, bandwidth of the DLL low pass filter, in Hz (overrides the configuration file)."); + +DEFINE_double(pll_bw_hz, 0.0, "If defined, bandwidth of the PLL low pass filter, in Hz (overrides the configuration file)."); #if GFLAGS_GREATER_2_0 @@ -68,6 +70,14 @@ static bool ValidateDopplerMax(const char* flagname, int32_t value) return false; } +static bool ValidateDopplerStep(const char* flagname, int32_t value) +{ + if (value >= 0 && value < 10000) // value is ok + return true; + std::cout << "Invalid value for " << flagname << ": " << value << std::endl; + return false; +} + static bool ValidateCn0Samples(const char* flagname, int32_t value) { if (value > 0 && value < 10000) // value is ok @@ -118,6 +128,7 @@ static bool ValidatePllBw(const char* flagname, double value) DEFINE_validator(doppler_max, &ValidateDopplerMax); +DEFINE_validator(doppler_step, &ValidateDopplerStep); DEFINE_validator(cn0_samples, &ValidateCn0Samples); DEFINE_validator(cn0_min, &ValidateCn0Min); DEFINE_validator(max_lock_fail, &ValidateMaxLockFail); diff --git a/src/algorithms/libs/gnss_sdr_flags.h b/src/algorithms/libs/gnss_sdr_flags.h index 6d36ac087..7ccbdabe5 100644 --- a/src/algorithms/libs/gnss_sdr_flags.h +++ b/src/algorithms/libs/gnss_sdr_flags.h @@ -34,28 +34,29 @@ #include -DECLARE_string(c); //