Fix cpplint format defects

This commit is contained in:
Javier Arribas 2021-12-05 19:31:43 +01:00
parent 91f826b5ca
commit 03b14a0212
8 changed files with 51 additions and 53 deletions

View File

@ -854,7 +854,7 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration,
pvt_output_parameters.max_obs_block_rx_clock_offset_ms = configuration->property(role + ".max_clock_offset_ms", pvt_output_parameters.max_obs_block_rx_clock_offset_ms);
//Source timetag
// Source timetag
pvt_output_parameters.log_source_timetag = configuration->property(role + ".log_timetag", pvt_output_parameters.log_source_timetag);
pvt_output_parameters.log_source_timetag_file = configuration->property(role + ".log_source_timetag_file", pvt_output_parameters.log_source_timetag_file);

View File

@ -18,6 +18,7 @@
#include "gnss_sdr_string_literals.h"
#include "gnss_sdr_timestamp.h"
#include <glog/logging.h>
#include <string>
using namespace std::string_literals;

View File

@ -21,6 +21,7 @@
#include "configuration_interface.h"
#include "file_source_base.h"
#include "gnss_sdr_timestamp.h"
#include <string>
/** \addtogroup Signal_Source
* \{ */
@ -42,8 +43,8 @@ public:
~FileTimestampSignalSource() = default;
protected:
//std::tuple<size_t, bool> itemTypeToSize() override;
//double packetsPerSample() const override;
// std::tuple<size_t, bool> itemTypeToSize() override;
// double packetsPerSample() const override;
gnss_shared_ptr<gr::block> source() const override;
void create_file_source_hook() override;
void pre_connect_hook(gr::top_block_sptr top_block) override;

View File

@ -42,20 +42,19 @@ LimesdrSignalSource::LimesdrSignalSource(const ConfigurationInterface* configura
// Driver parameters
channel_ = configuration->property(role + ".channel", 0);
//AGC_enabled_ = configuration->property(role + ".AGC_enabled", true);
freq_ = configuration->property(role + ".freq", 1575420000);
gain_ = configuration->property(role + ".gain", 40.0);
sample_rate_ = configuration->property(role + ".sampling_frequency", 2.0e6);
//todo: check aif bw is within limits
analog_bw_hz_ = configuration->property(role + ".analog_bw", sample_rate_ / 2); //LPF analog filters in I,Q branches
digital_bw_hz_ = configuration->property(role + ".digital_bw", 0); //disable by default
// todo: check if bw is within limits
analog_bw_hz_ = configuration->property(role + ".analog_bw", sample_rate_ / 2); // LPF analog filters in I,Q branches
digital_bw_hz_ = configuration->property(role + ".digital_bw", 0); // disable by default
item_type_ = configuration->property(role + ".item_type", default_item_type);
limesdr_serial_ = configuration->property(role + ".limesdr_serial", std::string());
limesdr_file_ = configuration->property(role + ".limesdr_file", std::string());
antenna_ = configuration->property(role + ".antenna", 255);
PPS_mode_ = configuration->property(role + ".PPS_mode", false);
ext_clock_MHz_ = configuration->property(role + ".ext_clock_MHz", 0.0); //external clock: 0.0 MHz will enable the internal clock
ext_clock_MHz_ = configuration->property(role + ".ext_clock_MHz", 0.0); // external clock: 0.0 MHz will enable the internal clock
limechannel_mode_ = configuration->property(role + ".limechannel_mode", 0);
if (limechannel_mode_ < 0 && limechannel_mode_ > 2)
{
@ -73,7 +72,7 @@ LimesdrSignalSource::LimesdrSignalSource(const ConfigurationInterface* configura
else if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
//1. Make the driver instance
// 1. Make the driver instance
try
{

View File

@ -87,7 +87,6 @@ private:
int limechannel_mode_;
bool PPS_mode_;
//bool AGC_enabled_;
bool dump_;
};

View File

@ -24,6 +24,7 @@
#include <algorithm> // for min
#include <cmath>
#include <cstring> // for memcpy
#include <memory>
Gnss_Sdr_Timestamp::Gnss_Sdr_Timestamp(size_t sizeof_stream_item,
std::string timestamp_file, double clock_offset_ms) : gr::sync_block("Timestamp",

View File

@ -846,7 +846,7 @@ void kf_vtl_tracking::start_tracking()
void kf_vtl_tracking::init_kf(double acq_code_phase_chips, double acq_doppler_hz)
{
//Kalman Filter class variables
// Kalman Filter class variables
double Ti = d_correlation_length_ms * 0.001;
// state vector: code_phase_chips, carrier_phase_rads, carrier_freq_hz,carrier_freq_rate_hz, code_freq_chips_s
F = arma::mat(5, 5);
@ -856,7 +856,7 @@ void kf_vtl_tracking::init_kf(double acq_code_phase_chips, double acq_doppler_hz
<< 0 << 0 << 0 << 1 << 0 << arma::endr
<< 0 << 0 << 0 << 0 << 1 << arma::endr;
double B = d_code_chip_rate / d_signal_carrier_freq; //carrier to code rate factor
double B = d_code_chip_rate / d_signal_carrier_freq; // carrier to code rate factor
H = arma::mat(2, 5);
H << 1 << 0 << -B * Ti / 2.0 << B * (Ti * Ti) / 6.0 << 0 << arma::endr
@ -878,7 +878,7 @@ void kf_vtl_tracking::init_kf(double acq_code_phase_chips, double acq_doppler_hz
R << pow(d_trk_parameters.code_disc_sd_chips, 2.0) << 0 << arma::endr
<< 0 << pow(d_trk_parameters.carrier_disc_sd_rads, 2.0) << arma::endr;
//system covariance matrix (static)
// system covariance matrix (static)
Q = arma::mat(5, 5);
Q << pow(d_trk_parameters.code_phase_sd_chips, 2.0) << 0 << 0 << 0 << 0 << arma::endr
<< 0 << pow(d_trk_parameters.carrier_phase_sd_rad, 2.0) << 0 << 0 << 0 << arma::endr
@ -896,10 +896,10 @@ void kf_vtl_tracking::init_kf(double acq_code_phase_chips, double acq_doppler_hz
<< 0 << 0 << 0 << 0 << pow(d_trk_parameters.init_code_rate_sd_chips_s, 2.0) << arma::endr;
//init state vector
// init state vector
x_old_old = arma::vec(5);
//states: code_phase_chips, carrier_phase_rads, carrier_freq_hz, carrier_freq_rate_hz_s, code_freq_rate_chips_s
// states: code_phase_chips, carrier_phase_rads, carrier_freq_hz, carrier_freq_rate_hz_s, code_freq_rate_chips_s
x_old_old << acq_code_phase_chips << 0 << acq_doppler_hz << 0 << 0 << arma::endr;
// std::cout << "F: " << F << "\n";
@ -912,7 +912,7 @@ void kf_vtl_tracking::init_kf(double acq_code_phase_chips, double acq_doppler_hz
void kf_vtl_tracking::update_kf_narrow_intgration_time()
{
//Kalman Filter class variables
// Kalman Filter class variables
double Ti = d_current_correlation_time_s;
std::cout << "Ti:" << Ti << std::endl;
// state vector: code_phase_chips, carrier_phase_rads, carrier_freq_hz,carrier_freq_rate_hz, code_freq_chips_s
@ -938,7 +938,7 @@ void kf_vtl_tracking::update_kf_narrow_intgration_time()
R << pow(d_trk_parameters.code_disc_sd_chips, 2.0) << 0 << arma::endr
<< 0 << pow(d_trk_parameters.carrier_disc_sd_rads, 2.0) << arma::endr;
//system covariance matrix (static)
// system covariance matrix (static)
Q << pow(d_trk_parameters.narrow_code_phase_sd_chips, 2.0) << 0 << 0 << 0 << 0 << arma::endr
<< 0 << pow(d_trk_parameters.narrow_carrier_phase_sd_rad, 2.0) << 0 << 0 << 0 << arma::endr
<< 0 << 0 << pow(d_trk_parameters.narrow_carrier_freq_sd_hz, 2.0) << 0 << 0 << arma::endr
@ -948,7 +948,7 @@ void kf_vtl_tracking::update_kf_narrow_intgration_time()
void kf_vtl_tracking::update_kf_cn0(double current_cn0_dbhz)
{
//Kalman Filter class variables
// Kalman Filter class variables
double Ti = d_correlation_length_ms * 0.001;
double B = d_code_chip_rate / d_signal_carrier_freq; //carrier to code rate factor
@ -1163,46 +1163,46 @@ void kf_vtl_tracking::run_Kf()
d_code_error_disc_chips = dll_nc_e_minus_l_normalized(d_E_accu, d_L_accu, d_trk_parameters.spc, d_trk_parameters.slope, d_trk_parameters.y_intercept); // [chips/Ti]
}
//Kalman loop
// Kalman loop
//Prediction
// Prediction
x_new_old = F * x_old_old;
P_new_old = F * P_old_old * F.t() + Q;
//Innovation
// Innovation
arma::vec z = {d_code_error_disc_chips, d_carr_phase_error_disc_hz * TWO_PI};
// Measurement update
arma::mat K = P_new_old * H.t() * arma::inv(H * P_new_old * H.t() + R); //Kalman gain
arma::mat K = P_new_old * H.t() * arma::inv(H * P_new_old * H.t() + R); // Kalman gain
x_new_new = x_new_old + K * z;
P_new_new = (arma::eye(5, 5) - K * H) * P_new_old;
//new code phase estimation
// new code phase estimation
d_code_error_kf_chips = x_new_new(0);
x_new_new(0) = 0; //reset error estimation because the NCO corrects the code phase
x_new_new(0) = 0; // reset error estimation because the NCO corrects the code phase
//new carrier phase estimation
// new carrier phase estimation
d_carrier_phase_kf_rad = x_new_new(1);
// New carrier Doppler frequency estimation
d_carrier_doppler_kf_hz = x_new_new(2); //d_carrier_loop_filter.get_carrier_error(0, static_cast<float>(d_carr_phase_error_hz), static_cast<float>(d_current_correlation_time_s));
d_carrier_doppler_kf_hz = x_new_new(2); // d_carrier_loop_filter.get_carrier_error(0, static_cast<float>(d_carr_phase_error_hz), static_cast<float>(d_current_correlation_time_s));
d_carrier_doppler_rate_kf_hz_s = x_new_new(3);
//std::cout << "d_carrier_doppler_hz: " << d_carrier_doppler_hz << '\n';
//std::cout << "d_CN0_SNV_dB_Hz: " << this->d_CN0_SNV_dB_Hz << '\n';
// std::cout << "d_carrier_doppler_hz: " << d_carrier_doppler_hz << '\n';
// std::cout << "d_CN0_SNV_dB_Hz: " << this->d_CN0_SNV_dB_Hz << '\n';
// New code Doppler frequency estimation
if (d_trk_parameters.carrier_aiding)
{
//estimate the code rate exclusively based on the carrier Doppler
// estimate the code rate exclusively based on the carrier Doppler
d_code_freq_kf_chips_s = d_code_chip_rate + d_carrier_doppler_kf_hz * d_code_chip_rate / d_signal_carrier_freq;
}
else
{
//use its own KF code rate estimation
// use its own KF code rate estimation
d_code_freq_kf_chips_s -= x_new_new(4);
}
x_new_new(4) = 0;
@ -1254,7 +1254,7 @@ void kf_vtl_tracking::clear_tracking_vars()
d_code_phase_rate_step_chips = 0.0;
}
//todo: IT DOES NOT WORK WHEN NO KF IS RUNNING (extended correlation epochs!!)
// todo: IT DOES NOT WORK WHEN NO KF IS RUNNING (extended correlation epochs!!)
void kf_vtl_tracking::update_tracking_vars()
{
d_T_chip_seconds = 1.0 / d_code_freq_kf_chips_s;
@ -1264,15 +1264,15 @@ void kf_vtl_tracking::update_tracking_vars()
// keep alignment parameters for the next input buffer
// Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation
d_T_prn_samples = d_T_prn_seconds * d_trk_parameters.fs_in;
//d_K_blk_samples = d_T_prn_samples + d_rem_code_phase_samples + d_trk_parameters.fs_in * d_code_error_kf_chips / d_code_freq_kf_chips_s;
//KF will update d_rem_code_phase_samples
// d_K_blk_samples = d_T_prn_samples + d_rem_code_phase_samples + d_trk_parameters.fs_in * d_code_error_kf_chips / d_code_freq_kf_chips_s;
// KF will update d_rem_code_phase_samples
d_K_blk_samples = d_T_prn_samples + d_rem_code_phase_samples;
d_current_prn_length_samples = static_cast<int32_t>(std::floor(d_K_blk_samples)); // round to a discrete number of samples
// ################### PLL COMMANDS #################################################
// carrier phase step (NCO phase increment per sample) [rads/sample]
d_carrier_phase_step_rad = TWO_PI * d_carrier_doppler_kf_hz / d_trk_parameters.fs_in;
//d_rem_carr_phase_rad = d_carrier_phase_kf_rad;
// d_rem_carr_phase_rad = d_carrier_phase_kf_rad;
// remnant carrier phase to prevent overflow in the code NCO
d_rem_carr_phase_rad += static_cast<float>(d_carrier_phase_step_rad * static_cast<double>(d_current_prn_length_samples) + 0.5 * d_carrier_phase_rate_step_rad * static_cast<double>(d_current_prn_length_samples) * static_cast<double>(d_current_prn_length_samples));
@ -1297,7 +1297,7 @@ void kf_vtl_tracking::update_tracking_vars()
// ################### DLL COMMANDS #################################################
// code phase step (Code resampler phase increment per sample) [chips/sample]
d_code_phase_step_chips = d_code_freq_kf_chips_s / d_trk_parameters.fs_in;
//todo: extend kf to estimate code rate
// todo: extend kf to estimate code rate
// if (d_trk_parameters.high_dyn)
// {
// d_code_phase_rate_step_chips = d_code_freq_kf_rate_chips_s / d_trk_parameters.fs_in;
@ -1817,7 +1817,7 @@ int kf_vtl_tracking::general_work(int noutput_items __attribute__((unused)), gr_
d_cn0_smoother.reset();
d_carrier_lock_test_smoother.reset();
//init KF
// init KF
// d_T_chip_seconds = 1.0 / d_code_freq_chips;
// d_T_prn_seconds = d_T_chip_seconds * static_cast<double>(samples_offset);
// // keep alignment parameters for the next input buffer

View File

@ -22,7 +22,12 @@
#include "cpu_multicorrelator_real_codes.h"
#include "exponential_smoother.h"
#include "gnss_block_interface.h"
#include "gnss_time.h" //for timetags produced by File_Timestamp_Signal_Source
#include "kf_conf.h"
#include "tracking_FLL_PLL_filter.h" // for PLL/FLL filter
#include "tracking_loop_filter.h" // for DLL filter
#include <armadillo>
#include <boost/circular_buffer.hpp>
#include <gnuradio/block.h> // for block
#include <gnuradio/gr_complex.h> // for gr_complex
@ -35,13 +40,6 @@
#include <string> // for string
#include <typeinfo> // for typeid
#include <utility> // for pair
#if GNURADIO_USES_STD_POINTERS
#include <memory>
#else
#include <boost/shared_ptr.hpp>
#endif
#include <armadillo>
class Gnss_Synchro;
class kf_vtl_tracking;
@ -118,7 +116,7 @@ private:
const size_t int_type_hash_code = typeid(int).hash_code();
//Kalman Filter class variables
// Kalman Filter class variables
arma::mat F;
arma::mat H;
arma::mat R;
@ -130,26 +128,26 @@ private:
arma::vec x_new_old;
arma::vec x_new_new;
//nominal signal parameters
// nominal signal parameters
double d_signal_carrier_freq;
double d_code_period;
double d_code_chip_rate;
//acquisition
// acquisition
double d_acq_code_phase_samples;
double d_acq_carrier_doppler_hz;
double d_current_correlation_time_s;
//carrier and code discriminators output
// carrier and code discriminators output
double d_carr_phase_error_disc_hz;
double d_carr_freq_error_disc_hz;
double d_code_error_disc_chips;
//estimated parameters
//code
// estimated parameters
// code
double d_code_error_kf_chips;
double d_code_freq_kf_chips_s;
//carrier
// carrier
double d_carrier_phase_kf_rad;
double d_carrier_doppler_kf_hz;
double d_carrier_doppler_rate_kf_hz_s;
@ -165,12 +163,11 @@ private:
double d_CN0_SNV_dB_Hz;
double d_carrier_lock_threshold;
//carrier NCO
// carrier NCO
double d_carrier_phase_step_rad;
double d_carrier_phase_rate_step_rad;
//code NCO
// code NCO
double d_code_phase_step_chips;
double d_code_phase_rate_step_chips;
double d_rem_code_phase_chips;