From 0c26a95af4371ab24fd993568bf67ead78c97fdb Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 21 Aug 2018 15:20:48 +0200 Subject: [PATCH] Enhance const correctness, minor cosmetics --- .../tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc | 9 ++++----- src/algorithms/tracking/libs/bayesian_estimation.cc | 6 +++--- src/algorithms/tracking/libs/bayesian_estimation.h | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc index 138cf604f..740a11e84 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc @@ -84,7 +84,7 @@ void Gps_L1_Ca_Kf_Tracking_cc::forecast(int noutput_items, { if (noutput_items != 0) { - ninput_items_required[0] = static_cast(d_vector_length) * 2; //set the required available samples in each call + ninput_items_required[0] = static_cast(d_vector_length) * 2; // set the required available samples in each call } } @@ -122,7 +122,7 @@ Gps_L1_Ca_Kf_Tracking_cc::Gps_L1_Ca_Kf_Tracking_cc( // Initialize tracking ========================================== d_code_loop_filter.set_DLL_BW(dll_bw_hz); - //--- DLL variables -------------------------------------------------------- + // --- DLL variables -------------------------------------------------------- d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) // Initialization of local code replica @@ -144,7 +144,7 @@ Gps_L1_Ca_Kf_Tracking_cc::Gps_L1_Ca_Kf_Tracking_cc( multicorrelator_cpu.init(2 * d_current_prn_length_samples, d_n_correlator_taps); - //--- Perform initializations ------------------------------ + // --- Perform initializations ------------------------------ // define initial code frequency basis of NCO d_code_freq_chips = GPS_L1_CA_CODE_RATE_HZ; // define residual code phase (in chips) @@ -156,7 +156,6 @@ Gps_L1_Ca_Kf_Tracking_cc::Gps_L1_Ca_Kf_Tracking_cc( // sample synchronization d_sample_counter = 0; - //d_sample_counter_seconds = 0; d_acq_sample_stamp = 0; d_enable_tracking = false; @@ -197,7 +196,7 @@ Gps_L1_Ca_Kf_Tracking_cc::Gps_L1_Ca_Kf_Tracking_cc( double sigma2_phase_detector_cycles2; sigma2_phase_detector_cycles2 = (1.0 / (2.0 * CN_lin * GPS_L1_CA_CODE_PERIOD)) * (1.0 + 1.0 / (2.0 * CN_lin * GPS_L1_CA_CODE_PERIOD)); - //covariances (static) + // covariances (static) double sigma2_carrier_phase = GPS_TWO_PI / 4; double sigma2_doppler = 450; double sigma2_doppler_rate = pow(4.0 * GPS_TWO_PI, 2) / 12.0; diff --git a/src/algorithms/tracking/libs/bayesian_estimation.cc b/src/algorithms/tracking/libs/bayesian_estimation.cc index 536ca1803..30e7d45ec 100644 --- a/src/algorithms/tracking/libs/bayesian_estimation.cc +++ b/src/algorithms/tracking/libs/bayesian_estimation.cc @@ -38,7 +38,7 @@ */ #include "bayesian_estimation.h" -#include + Bayesian_estimator::Bayesian_estimator() { @@ -176,12 +176,12 @@ void Bayesian_estimator::update_sequential(const arma::vec& data, const arma::ve Psi_prior = Psi_posterior; } -arma::mat Bayesian_estimator::get_mu_est() +arma::mat Bayesian_estimator::get_mu_est() const { return mu_est; } -arma::mat Bayesian_estimator::get_Psi_est() +arma::mat Bayesian_estimator::get_Psi_est() const { return Psi_est; } diff --git a/src/algorithms/tracking/libs/bayesian_estimation.h b/src/algorithms/tracking/libs/bayesian_estimation.h index 606c97c77..002e7a75c 100644 --- a/src/algorithms/tracking/libs/bayesian_estimation.h +++ b/src/algorithms/tracking/libs/bayesian_estimation.h @@ -69,8 +69,8 @@ public: void update_sequential(const arma::vec& data); void update_sequential(const arma::vec& data, const arma::vec& mu_prior_0, int kappa_prior_0, int nu_prior_0, const arma::mat& Psi_prior_0); - arma::mat get_mu_est(); - arma::mat get_Psi_est(); + arma::mat get_mu_est() const; + arma::mat get_Psi_est() const; private: arma::vec mu_est;