1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-13 03:30:33 +00:00

Fix uninitialized scalar fields

This commit is contained in:
Carles Fernandez 2021-12-14 10:21:31 +01:00
parent 589690a645
commit 33366ef6df
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
10 changed files with 126 additions and 137 deletions

View File

@ -29,7 +29,6 @@ set(GNSS_SPLIBS_SOURCES
gnss_sdr_create_directory.cc
geofunctions.cc
item_type_helpers.cc
trackingcmd.cc
pass_through.cc
short_x2_to_cshort.cc
gnss_sdr_string_literals.cc

View File

@ -1,23 +0,0 @@
/*!
* \file trackingcmd.cc
* \brief Class that stores information to update the GNSS signal tracking estimations
* \author Javier Arribas, 2021. jarribas(at)cttc.es
*
*
* -----------------------------------------------------------------------------
*
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
* This file is part of GNSS-SDR.
*
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
* SPDX-License-Identifier: GPL-3.0-or-later
*
* -----------------------------------------------------------------------------
*/
#include "trackingcmd.h"
TrackingCmd::TrackingCmd()
{
// TODO Auto-generated constructor stub
}

View File

@ -15,22 +15,29 @@
* -----------------------------------------------------------------------------
*/
#ifndef SRC_ALGORITHMS_LIBS_TRACKINGCMD_H_
#define SRC_ALGORITHMS_LIBS_TRACKINGCMD_H_
#ifndef GNSS_SDR_TRACKINGCMD_H_
#define GNSS_SDR_TRACKINGCMD_H_
#include <cstdint>
/** \addtogroup Algorithms_Library
* \{ */
/** \addtogroup Algorithm_libs algorithms_libs
* \{ */
class TrackingCmd
{
public:
TrackingCmd();
bool enable_carrier_nco_cmd;
bool enable_code_nco_cmd;
double code_freq_chips;
double carrier_freq_hz;
double carrier_freq_rate_hz_s;
uint64_t sample_counter;
bool enable_carrier_nco_cmd = false;
bool enable_code_nco_cmd = false;
double code_freq_chips = 0.0;
double carrier_freq_hz = 0.0;
double carrier_freq_rate_hz_s = 0.0;
uint64_t sample_counter = 0UL;
};
#endif /* SRC_ALGORITHMS_LIBS_TRACKINGCMD_H_ */
/** \} */
/** \} */
#endif // GNSS_SDR_TRACKINGCMD_H_

View File

@ -64,7 +64,7 @@ private:
bool read_next_timetag();
std::string d_timefile;
std::fstream d_timefilestream;
GnssTime next_timetag;
GnssTime next_timetag{};
double d_clock_offset_ms;
double d_integer_ms_offset;
double d_fraction_ms_offset;

View File

@ -84,7 +84,8 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
d_print_cnav_page(true),
d_enable_navdata_monitor(conf.enable_navdata_monitor),
d_dump_crc_stats(conf.dump_crc_stats),
d_enable_reed_solomon_inav(false)
d_enable_reed_solomon_inav(false),
d_valid_timetag(false)
{
// prevent telemetry symbols accumulation in output buffers
this->set_max_noutput_items(1);

View File

@ -102,7 +102,7 @@ private:
Galileo_Fnav_Message d_fnav_nav;
Nav_Message_Packet d_nav_msg_packet;
GnssTime d_current_timetag;
GnssTime d_current_timetag{};
std::unique_ptr<Tlm_CRC_Stats> d_Tlm_CRC_Stats;

View File

@ -167,7 +167,7 @@ private:
// uint64_t d_sample_counter;
uint64_t d_acq_sample_stamp;
GnssTime d_last_timetag;
GnssTime d_last_timetag{};
uint64_t d_last_timetag_samplecounter;
bool d_timetag_waiting;

View File

@ -499,6 +499,11 @@ kf_vtl_tracking::kf_vtl_tracking(const Kf_Conf &conf_)
d_current_prn_length_samples = static_cast<int32_t>(d_trk_parameters.vector_length);
d_current_correlation_time_s = 0.0;
d_carr_phase_error_disc_hz = 0.0;
d_code_error_disc_chips = 0.0;
d_code_error_kf_chips = 0.0;
d_code_freq_kf_chips_s = 0.0;
// CN0 estimation and lock detector buffers
d_cn0_estimation_counter = 0;
d_Prompt_buffer.reserve(d_trk_parameters.cn0_samples);

View File

@ -24,61 +24,61 @@
#include <glog/logging.h>
Kf_Conf::Kf_Conf()
Kf_Conf::Kf_Conf() : item_type("gr_complex"),
dump_filename("./Kf_dump.dat"),
fs_in(2000000.0),
carrier_lock_th(FLAGS_carrier_lock_th),
expected_cn0_dbhz(42.0),
code_disc_sd_chips(0.01),
carrier_disc_sd_rads(0.1),
code_phase_sd_chips(0.001),
code_rate_sd_chips_s(0.001),
carrier_phase_sd_rad(0.001),
carrier_freq_sd_hz(0.1),
carrier_freq_rate_sd_hz_s(1),
narrow_code_phase_sd_chips(0.001),
narrow_code_rate_sd_chips_s(0.001),
narrow_carrier_phase_sd_rad(0.001),
narrow_carrier_freq_sd_hz(0.1),
narrow_carrier_freq_rate_sd_hz_s(1),
init_code_phase_sd_chips(1),
init_code_rate_sd_chips_s(100),
init_carrier_phase_sd_rad(10),
init_carrier_freq_sd_hz(1000),
init_carrier_freq_rate_sd_hz_s(1000),
early_late_space_chips(0.25),
very_early_late_space_chips(0.5),
early_late_space_narrow_chips(0.15),
very_early_late_space_narrow_chips(0.5),
slope(1.0),
spc(0.5),
y_intercept(1.0),
cn0_smoother_alpha(0.002),
carrier_lock_test_smoother_alpha(0.002),
pull_in_time_s(10),
bit_synchronization_time_limit_s(70),
vector_length(0U),
smoother_length(10),
extend_correlation_symbols(1),
cn0_samples(FLAGS_cn0_samples),
cn0_smoother_samples(200),
carrier_lock_test_smoother_samples(25),
cn0_min(FLAGS_cn0_min),
max_code_lock_fail(FLAGS_max_lock_fail),
max_carrier_lock_fail(FLAGS_max_carrier_lock_fail),
system('G'),
track_pilot(true),
enable_doppler_correction(false),
carrier_aiding(true),
high_dyn(false),
dump(false),
dump_mat(true),
enable_dynamic_measurement_covariance(false),
use_estimated_cn0(false)
{
/*KF tracking configuration */
high_dyn = false;
smoother_length = 10;
fs_in = 2000000.0;
vector_length = 0U;
dump = false;
dump_mat = true;
dump_filename = std::string("./Kf_dump.dat");
pull_in_time_s = 10;
bit_synchronization_time_limit_s = pull_in_time_s + 60;
early_late_space_chips = 0.25;
very_early_late_space_chips = 0.5;
early_late_space_narrow_chips = 0.15;
very_early_late_space_narrow_chips = 0.5;
slope = 1.0;
spc = 0.5;
y_intercept = 1.0;
carrier_aiding = true;
extend_correlation_symbols = 1;
cn0_samples = FLAGS_cn0_samples;
cn0_smoother_samples = 200;
cn0_smoother_alpha = 0.002;
carrier_lock_test_smoother_alpha = 0.002;
carrier_lock_test_smoother_samples = 25;
cn0_min = FLAGS_cn0_min;
max_carrier_lock_fail = FLAGS_max_carrier_lock_fail;
max_code_lock_fail = FLAGS_max_lock_fail;
carrier_lock_th = FLAGS_carrier_lock_th;
track_pilot = true;
enable_doppler_correction = false;
system = 'G';
signal[0] = '1';
signal[1] = 'C';
signal[2] = '\0';
item_type = "gr_complex";
expected_cn0_dbhz = 0;
// System covariances (Q)
code_phase_sd_chips = 0;
code_rate_sd_chips_s = 0;
carrier_phase_sd_rad = 0;
carrier_freq_sd_hz = 0;
carrier_freq_rate_sd_hz_s = 0;
// initial Kalman covariance matrix (P)
init_code_phase_sd_chips = 0;
init_code_rate_sd_chips_s = 0;
init_carrier_phase_sd_rad = 0;
init_carrier_freq_sd_hz = 0;
init_carrier_freq_rate_sd_hz_s = 0;
enable_dynamic_measurement_covariance = false;
use_estimated_cn0 = false;
}
@ -129,36 +129,35 @@ void Kf_Conf::SetFromConfiguration(const ConfigurationInterface *configuration,
// Kalman filter covariances
// Measurement covariances (R)
expected_cn0_dbhz = configuration->property(role + ".expected_cn0_dbhz", 42.0);
expected_cn0_dbhz = configuration->property(role + ".expected_cn0_dbhz", expected_cn0_dbhz);
code_disc_sd_chips = configuration->property(role + ".code_disc_sd_chips", 0.01);
carrier_disc_sd_rads = configuration->property(role + ".carrier_disc_sd_rads", 0.1);
code_disc_sd_chips = configuration->property(role + ".code_disc_sd_chips", code_disc_sd_chips);
carrier_disc_sd_rads = configuration->property(role + ".carrier_disc_sd_rads", carrier_disc_sd_rads);
enable_dynamic_measurement_covariance = configuration->property(role + ".enable_dynamic_measurement_covariance", false);
use_estimated_cn0 = configuration->property(role + ".use_estimated_cn0", false);
enable_dynamic_measurement_covariance = configuration->property(role + ".enable_dynamic_measurement_covariance", enable_dynamic_measurement_covariance);
use_estimated_cn0 = configuration->property(role + ".use_estimated_cn0", use_estimated_cn0);
// System covariances (Q)
code_phase_sd_chips = configuration->property(role + ".code_phase_sd_chips", 0.001);
code_rate_sd_chips_s = configuration->property(role + ".code_rate_sd_chips_s", 0.001);
code_phase_sd_chips = configuration->property(role + ".code_phase_sd_chips", code_phase_sd_chips);
code_rate_sd_chips_s = configuration->property(role + ".code_rate_sd_chips_s", code_rate_sd_chips_s);
carrier_phase_sd_rad = configuration->property(role + ".carrier_phase_sd_rad", 0.001);
carrier_freq_sd_hz = configuration->property(role + ".carrier_freq_sd_hz", 0.1);
carrier_freq_rate_sd_hz_s = configuration->property(role + ".carrier_freq_rate_sd_hz_s", 1);
carrier_phase_sd_rad = configuration->property(role + ".carrier_phase_sd_rad", carrier_phase_sd_rad);
carrier_freq_sd_hz = configuration->property(role + ".carrier_freq_sd_hz", carrier_freq_sd_hz);
carrier_freq_rate_sd_hz_s = configuration->property(role + ".carrier_freq_rate_sd_hz_s", carrier_freq_rate_sd_hz_s);
// System covariances (narrow) (Q)
narrow_code_phase_sd_chips = configuration->property(role + ".narrow_code_phase_sd_chips", 0.001);
narrow_code_rate_sd_chips_s = configuration->property(role + ".narrow_code_rate_sd_chips_s", 0.001);
narrow_carrier_phase_sd_rad = configuration->property(role + ".narrow_carrier_phase_sd_rad", 0.001);
narrow_carrier_freq_sd_hz = configuration->property(role + ".narrow_carrier_freq_sd_hz", 0.1);
narrow_carrier_freq_rate_sd_hz_s = configuration->property(role + ".narrow_carrier_freq_rate_sd_hz_s", 1);
narrow_code_phase_sd_chips = configuration->property(role + ".narrow_code_phase_sd_chips", narrow_code_phase_sd_chips);
narrow_code_rate_sd_chips_s = configuration->property(role + ".narrow_code_rate_sd_chips_s", narrow_code_rate_sd_chips_s);
narrow_carrier_phase_sd_rad = configuration->property(role + ".narrow_carrier_phase_sd_rad", narrow_carrier_phase_sd_rad);
narrow_carrier_freq_sd_hz = configuration->property(role + ".narrow_carrier_freq_sd_hz", narrow_carrier_freq_sd_hz);
narrow_carrier_freq_rate_sd_hz_s = configuration->property(role + ".narrow_carrier_freq_rate_sd_hz_s", narrow_carrier_freq_rate_sd_hz_s);
// initial Kalman covariance matrix (P)
init_code_phase_sd_chips = configuration->property(role + ".init_code_phase_sd_chips", 1);
init_code_rate_sd_chips_s = configuration->property(role + ".init_code_rate_sd_chips_s", 100);
init_code_phase_sd_chips = configuration->property(role + ".init_code_phase_sd_chips", init_code_phase_sd_chips);
init_code_rate_sd_chips_s = configuration->property(role + ".init_code_rate_sd_chips_s", init_code_rate_sd_chips_s);
init_carrier_phase_sd_rad = configuration->property(role + ".init_carrier_phase_sd_rad", 10);
init_carrier_freq_sd_hz = configuration->property(role + ".init_carrier_freq_sd_hz", 1000);
init_carrier_freq_rate_sd_hz_s = configuration->property(role + ".init_carrier_freq_rate_sd_hz_s", 1000);
init_carrier_phase_sd_rad = configuration->property(role + ".init_carrier_phase_sd_rad", init_carrier_phase_sd_rad);
init_carrier_freq_sd_hz = configuration->property(role + ".init_carrier_freq_sd_hz", init_carrier_freq_sd_hz);
init_carrier_freq_rate_sd_hz_s = configuration->property(role + ".init_carrier_freq_rate_sd_hz_s", init_carrier_freq_rate_sd_hz_s);
}

View File

@ -36,34 +36,6 @@ public:
std::string dump_filename;
double fs_in;
double carrier_lock_th;
float early_late_space_chips;
float very_early_late_space_chips;
float early_late_space_narrow_chips;
float very_early_late_space_narrow_chips;
float slope;
float spc;
float y_intercept;
float cn0_smoother_alpha;
float carrier_lock_test_smoother_alpha;
uint32_t pull_in_time_s;
uint32_t bit_synchronization_time_limit_s;
uint32_t vector_length;
uint32_t smoother_length;
int32_t extend_correlation_symbols;
int32_t cn0_samples;
int32_t cn0_smoother_samples;
int32_t carrier_lock_test_smoother_samples;
int32_t cn0_min;
int32_t max_code_lock_fail;
int32_t max_carrier_lock_fail;
char signal[3]{};
char system;
bool track_pilot;
bool enable_doppler_correction;
bool carrier_aiding;
bool high_dyn;
bool dump;
bool dump_mat;
// KF statistics
// states: code_phase_chips, carrier_phase_rads, carrier_freq_hz, carrier_freq_rate_hz_s, code_freq_rate_chips_s
@ -97,6 +69,35 @@ public:
double init_carrier_freq_sd_hz;
double init_carrier_freq_rate_sd_hz_s;
float early_late_space_chips;
float very_early_late_space_chips;
float early_late_space_narrow_chips;
float very_early_late_space_narrow_chips;
float slope;
float spc;
float y_intercept;
float cn0_smoother_alpha;
float carrier_lock_test_smoother_alpha;
uint32_t pull_in_time_s;
uint32_t bit_synchronization_time_limit_s;
uint32_t vector_length;
uint32_t smoother_length;
int32_t extend_correlation_symbols;
int32_t cn0_samples;
int32_t cn0_smoother_samples;
int32_t carrier_lock_test_smoother_samples;
int32_t cn0_min;
int32_t max_code_lock_fail;
int32_t max_carrier_lock_fail;
char signal[3]{};
char system;
bool track_pilot;
bool enable_doppler_correction;
bool carrier_aiding;
bool high_dyn;
bool dump;
bool dump_mat;
bool enable_dynamic_measurement_covariance;
bool use_estimated_cn0;
};