Merge branch 'MrCry0-feat/tracking-dump-every-code-period-next' into next

This commit is contained in:
Carles Fernandez committed 2026-11-24 18:41:10 +01:00
commit 4663ee50ec
11 files changed
+103 -17

No files matched your search

+6
View File
@@ -381,6 +381,12 @@ All notable changes to GNSS-SDR will be documented in this file.
acquired, instead of moving by half a cycle to the polarity of the pilot, and
the half-cycle ambiguity is left to the telemetry decoder, as for signals
without a pilot. The parameter is ignored for BeiDou B1C.
- A new tracking parameter `Tracking_XX.dump_every_code_period` (default
`false`) makes the tracking dump (`Tracking_XX.dump=true`) keep one record per
code period once the channel has reached symbol synchronization, instead of
one record per symbol. This stores the prompt correlator output of the code
periods inside a symbol (for instance, each of the 20 periods of a GPS L1 C/A
bit). The record layout does not change.
See the definitions of concepts and metrics at
https://gnss-sdr.org/design-forces/
@@ -2865,9 +2865,13 @@ int dll_pll_veml_tracking::process_input(int noutput_items __attribute__((unused
do_correlation_step(in);
save_correlation_results();
update_tracking_vars();
if (d_current_data_symbol == 0)
// dump_every_code_period also logs the code periods inside a symbol
if (d_current_data_symbol == 0 || d_trk_parameters.dump_every_code_period)
{
log_data();
}
if (d_current_data_symbol == 0)
{
// ########### Output the tracking results to Telemetry block ##########
// Fill the acquisition data
current_synchro_data = *d_acquisition_gnss_synchro;
@@ -2907,10 +2911,14 @@ int dll_pll_veml_tracking::process_input(int noutput_items __attribute__((unused
run_dll_pll();
update_tracking_vars();
check_carrier_phase_coherent_initialization();
// enable write dump file this cycle (valid DLL/PLL cycle);
// dump_every_code_period also logs the code periods inside a symbol
if (d_current_data_symbol == 0 || d_trk_parameters.dump_every_code_period)
{
log_data();
}
if (d_current_data_symbol == 0)
{
// enable write dump file this cycle (valid DLL/PLL cycle)
log_data();
// ########### Output the tracking results to Telemetry block ##########
// Fill the acquisition data
current_synchro_data = *d_acquisition_gnss_synchro;
@@ -1854,9 +1854,13 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
save_correlation_results();
update_tracking_vars();
if (d_current_data_symbol == 0)
// dump_every_code_period also logs the correlations inside a symbol
if (d_current_data_symbol == 0 || d_trk_parameters.dump_every_code_period)
{
log_data();
}
if (d_current_data_symbol == 0)
{
// ########### Output the tracking results to Telemetry block ##########
// Fill the acquisition data
current_synchro_data = *d_acquisition_gnss_synchro;
@@ -1909,10 +1913,14 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
run_dll_pll();
update_tracking_vars();
check_carrier_phase_coherent_initialization();
// enable write dump file this cycle (valid DLL/PLL cycle);
// dump_every_code_period also logs the correlations inside a symbol
if (d_current_data_symbol == 0 || d_trk_parameters.dump_every_code_period)
{
log_data();
}
if (d_current_data_symbol == 0)
{
// enable write dump file this cycle (valid DLL/PLL cycle)
log_data();
// ########### Output the tracking results to Telemetry block ##########
// Fill the acquisition data
current_synchro_data = *d_acquisition_gnss_synchro;
@@ -1967,9 +1975,13 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
save_correlation_results();
update_tracking_vars();
if (d_current_data_symbol == 0)
// dump_every_code_period also logs the correlations inside a symbol
if (d_current_data_symbol == 0 || d_trk_parameters.dump_every_code_period)
{
log_data();
}
if (d_current_data_symbol == 0)
{
// ########### Output the tracking results to Telemetry block ##########
// Fill the acquisition data
current_synchro_data = *d_acquisition_gnss_synchro;
@@ -2032,10 +2044,14 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
update_tracking_vars();
check_carrier_phase_coherent_initialization();
// enable write dump file this cycle (valid DLL/PLL cycle);
// dump_every_code_period also logs the correlations inside a symbol
if (d_current_data_symbol == 0 || d_trk_parameters.dump_every_code_period)
{
log_data();
}
if (d_current_data_symbol == 0)
{
// enable write dump file this cycle (valid DLL/PLL cycle)
log_data();
// ########### Output the tracking results to Telemetry block ##########
// Fill the acquisition data
current_synchro_data = *d_acquisition_gnss_synchro;
@@ -2016,9 +2016,13 @@ int kf_tracking::process_input(int noutput_items __attribute__((unused)), gr_vec
save_correlation_results();
// run_Kf();
update_tracking_vars(); // ?
if (d_current_data_symbol == 0)
// dump_every_code_period also logs the code periods inside a symbol
if (d_current_data_symbol == 0 || d_trk_parameters.dump_every_code_period)
{
log_data();
}
if (d_current_data_symbol == 0)
{
// ########### Output the tracking results to Telemetry block ##########
// Fill the acquisition data
current_synchro_data = *d_acquisition_gnss_synchro;
@@ -2066,10 +2070,14 @@ int kf_tracking::process_input(int noutput_items __attribute__((unused)), gr_vec
run_Kf();
update_tracking_vars();
check_carrier_phase_coherent_initialization();
// enable write dump file this cycle (valid DLL/PLL cycle);
// dump_every_code_period also logs the code periods inside a symbol
if (d_current_data_symbol == 0 || d_trk_parameters.dump_every_code_period)
{
log_data();
}
if (d_current_data_symbol == 0)
{
// enable write dump file this cycle (valid DLL/PLL cycle)
log_data();
// ########### Output the tracking results to Telemetry block ##########
// Fill the acquisition data
current_synchro_data = *d_acquisition_gnss_synchro;
@@ -63,6 +63,7 @@ void Dll_Pll_Conf::SetFromConfiguration(const ConfigurationInterface *configurat
f_error_dump = configuration->property(role + ".f_error_dump", f_error_dump);
f_error_dump_filename = configuration->property(role + ".f_error_dump_filename", f_error_dump_filename);
dump_mat = configuration->property(role + ".dump_mat", dump_mat);
dump_every_code_period = configuration->property(role + ".dump_every_code_period", dump_every_code_period);
keep_phase_at_secondary_lock = configuration->property(role + ".keep_phase_at_secondary_lock", keep_phase_at_secondary_lock);
pll_bw_hz = configuration->property(role + ".pll_bw_hz", pll_bw_hz);
#if USE_GLOG_AND_GFLAGS
@@ -93,6 +93,7 @@ public:
bool dump{false};
bool dump_mat{true};
bool f_error_dump{false};
bool dump_every_code_period{false};
bool keep_phase_at_secondary_lock{false};
bool tow_to_trk{false};
bool bs_use_phase_dot_detector{true};
@@ -60,6 +60,7 @@ void Dll_Pll_Conf_Fpga::SetFromConfiguration(const ConfigurationInterface *confi
}
dump = configuration->property(role + ".dump", dump);
dump_mat = configuration->property(role + ".dump_mat", dump_mat);
dump_every_code_period = configuration->property(role + ".dump_every_code_period", dump_every_code_period);
keep_phase_at_secondary_lock = configuration->property(role + ".keep_phase_at_secondary_lock", keep_phase_at_secondary_lock);
dump_filename = configuration->property(role + ".dump_filename", dump_filename);
enable_fll_pull_in = configuration->property(role + ".enable_fll_pull_in", enable_fll_pull_in);
@@ -105,6 +105,7 @@ public:
bool high_dyn{false};
bool dump{false};
bool dump_mat{true};
bool dump_every_code_period{false};
bool keep_phase_at_secondary_lock{false};
bool bs_use_phase_dot_detector{true};
};
+2
View File
@@ -82,6 +82,7 @@ Kf_Conf::Kf_Conf() : item_type("gr_complex"),
high_dyn(false),
dump(false),
dump_mat(true),
dump_every_code_period(false),
keep_phase_at_secondary_lock(false)
{
signal[0] = '1';
@@ -106,6 +107,7 @@ void Kf_Conf::SetFromConfiguration(const ConfigurationInterface *configuration,
dump = configuration->property(role + ".dump", dump);
dump_filename = configuration->property(role + ".dump_filename", dump_filename);
dump_mat = configuration->property(role + ".dump_mat", dump_mat);
dump_every_code_period = configuration->property(role + ".dump_every_code_period", dump_every_code_period);
keep_phase_at_secondary_lock = configuration->property(role + ".keep_phase_at_secondary_lock", keep_phase_at_secondary_lock);
pull_in_time_s = configuration->property(role + ".pull_in_time_s", pull_in_time_s);
+1
View File
@@ -81,6 +81,7 @@ public:
bool high_dyn;
bool dump;
bool dump_mat;
bool dump_every_code_period;
bool keep_phase_at_secondary_lock;
};
@@ -276,7 +276,7 @@ std::string find_line_starting_with(const std::string& filename, const std::stri
}
std::string find_line_containing(const std::string& filename, const std::string& text)
std::string find_line_containing(const std::string& filename, const std::string& text, bool data_records_only = false)
{
std::fstream fstr(filename.c_str(), std::fstream::in);
if (!fstr.is_open())
@@ -286,9 +286,18 @@ std::string find_line_containing(const std::string& filename, const std::string&
fstr.seekg(0);
std::string line_str;
bool in_header = data_records_only;
while (!fstr.eof())
{
std::getline(fstr, line_str);
if (in_header)
{
if (line_str.find("END OF HEADER", 60) != std::string::npos)
{
in_header = false;
}
continue;
}
if (line_str.find(text) != std::string::npos)
{
return line_str;
@@ -564,10 +573,42 @@ TEST_F(RinexPrinterTest, Rinex4GpsNavAndObs)
const std::string sto_line = find_line_containing(navfile, "GPUT");
EXPECT_NE(std::string::npos, sto_line.find("UTC(USNO)"));
// RINEX 4 navigation records use the 'e' exponent indicator instead of 'D'
EXPECT_TRUE(find_line_containing(navfile, "D+0").empty());
EXPECT_TRUE(find_line_containing(navfile, "D-0").empty());
EXPECT_FALSE(find_line_containing(navfile, "e+0").empty());
// RINEX 4 navigation records use the 'e' exponent indicator instead of 'D'.
// Ignore header comments: a version containing HEAD-0 is not an exponent.
EXPECT_TRUE(find_line_containing(navfile, "D+0", true).empty());
EXPECT_TRUE(find_line_containing(navfile, "D-0", true).empty());
EXPECT_FALSE(find_line_containing(navfile, "e+0", true).empty());
}
TEST_F(RinexPrinterTest, NavigationExponentSearchSkipsHeader)
{
auto rp = make_rinex_printer(GPS_1C, 4);
const std::string navfile = rp->get_navfilename()[0];
rp = nullptr;
{
std::ofstream out(navfile);
ASSERT_TRUE(out.is_open());
const std::string version = "GNSS-SDR VERSION 0.0.22.git-HEAD-068cc29";
out << version << std::string(60 - version.size(), ' ') << "COMMENT\n";
out << std::string(60, ' ') << "END OF HEADER\n";
out << "> EPH G01 LNAV\n 1.000000000000e+00\n";
}
EXPECT_FALSE(find_line_containing(navfile, "D-0").empty());
EXPECT_TRUE(find_line_containing(navfile, "D-0", true).empty());
EXPECT_TRUE(find_line_containing(navfile, "D+0", true).empty());
EXPECT_FALSE(find_line_containing(navfile, "e+0", true).empty());
{
std::ofstream out(navfile, std::ios::app);
ASSERT_TRUE(out.is_open());
out << " 1.000000000000D-01\n 1.000000000000D+01\n";
}
EXPECT_EQ(" 1.000000000000D-01", find_line_containing(navfile, "D-0", true));
EXPECT_EQ(" 1.000000000000D+01", find_line_containing(navfile, "D+0", true));
}