From f83a6254b0728e6e323c236466ed7fc51d249cc4 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 19 Sep 2019 08:33:39 +0200 Subject: [PATCH 1/3] Add /usr/local/lib64 to LOG4CPP module --- cmake/Modules/FindLOG4CPP.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/Modules/FindLOG4CPP.cmake b/cmake/Modules/FindLOG4CPP.cmake index 4af45d7c0..76c104b26 100644 --- a/cmake/Modules/FindLOG4CPP.cmake +++ b/cmake/Modules/FindLOG4CPP.cmake @@ -69,6 +69,7 @@ find_library(LOG4CPP_LIBRARY ${PC_LOG4CPP_LIBDIR} ${CMAKE_INSTALL_PREFIX}/lib/ PATHS /usr/local/lib + /usr/local/lib64 /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu /usr/lib/arm-linux-gnueabihf From a4c55b53e98f382f4749ee1e822fc4032c20cd33 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 19 Sep 2019 18:07:13 +0200 Subject: [PATCH 2/3] Fix tracking of data component in L5 and E5a --- .../gnuradio_blocks/dll_pll_veml_tracking.cc | 27 +++++++-- .../gnuradio_blocks/dll_pll_veml_tracking.h | 1 + .../dll_pll_veml_tracking_fpga.cc | 57 +++++++++++++++---- .../dll_pll_veml_tracking_fpga.h | 1 + 4 files changed, 71 insertions(+), 15 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 462728e58..e3d99570e 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -114,6 +114,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl d_data_secondary_code_length = 0U; d_data_secondary_code_string = nullptr; d_preamble_length_symbols = 0; + interchange_iq = false; signal_type = std::string(trk_parameters.signal); std::map map_signal_pretty_name; @@ -192,6 +193,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl d_secondary_code_length = static_cast(GPS_L5I_NH_CODE_LENGTH); d_secondary_code_string = const_cast(&GPS_L5I_NH_CODE_STR); signal_pretty_name = signal_pretty_name + "I"; + interchange_iq = true; } } else @@ -260,6 +262,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl d_secondary_code_length = static_cast(GALILEO_E5A_I_SECONDARY_CODE_LENGTH); d_secondary_code_string = const_cast(&GALILEO_E5A_I_SECONDARY_CODE); signal_pretty_name = signal_pretty_name + "I"; + interchange_iq = true; } } else @@ -1767,8 +1770,16 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) // ########### Output the tracking results to Telemetry block ########## // Fill the acquisition data current_synchro_data = *d_acquisition_gnss_synchro; - current_synchro_data.Prompt_I = static_cast(d_P_data_accu.real()); - current_synchro_data.Prompt_Q = static_cast(d_P_data_accu.imag()); + if (interchange_iq) + { + current_synchro_data.Prompt_I = static_cast(d_P_data_accu.imag()); + current_synchro_data.Prompt_Q = static_cast(d_P_data_accu.real()); + } + else + { + current_synchro_data.Prompt_I = static_cast(d_P_data_accu.real()); + current_synchro_data.Prompt_Q = static_cast(d_P_data_accu.imag()); + } current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; @@ -1808,8 +1819,16 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) // ########### Output the tracking results to Telemetry block ########## // Fill the acquisition data current_synchro_data = *d_acquisition_gnss_synchro; - current_synchro_data.Prompt_I = static_cast(d_P_data_accu.real()); - current_synchro_data.Prompt_Q = static_cast(d_P_data_accu.imag()); + if (interchange_iq) + { + current_synchro_data.Prompt_I = static_cast(d_P_data_accu.imag()); + current_synchro_data.Prompt_Q = static_cast(d_P_data_accu.real()); + } + else + { + current_synchro_data.Prompt_I = static_cast(d_P_data_accu.real()); + current_synchro_data.Prompt_Q = static_cast(d_P_data_accu.imag()); + } current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h index f79bf00dd..414838a7f 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h @@ -178,6 +178,7 @@ private: // tracking vars bool d_pull_in_transitory; bool d_corrected_doppler; + bool interchange_iq; double d_current_correlation_time_s; double d_carr_phase_error_hz; double d_carr_freq_error_hz; diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc index 24f72dd3a..40f4805b7 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc @@ -54,7 +54,7 @@ #include // for mp #include #include // for fill_n -#include // for fmod, round, floor, fabs +#include // for fmod, round, floor #include // for exception #include // for cout, cerr #include @@ -106,6 +106,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & d_data_secondary_code_length = 0U; d_data_secondary_code_string = nullptr; signal_type = std::string(trk_parameters.signal); + interchange_iq = false; std::map map_signal_pretty_name; map_signal_pretty_name["1C"] = "L1 C/A"; @@ -191,6 +192,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & d_secondary_code_length = static_cast(GPS_L5I_NH_CODE_LENGTH); d_secondary_code_string = const_cast(&GPS_L5I_NH_CODE_STR); signal_pretty_name = signal_pretty_name + "I"; + interchange_iq = true; } } else @@ -262,6 +264,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & d_secondary_code_length = static_cast(GALILEO_E5A_I_SECONDARY_CODE_LENGTH); d_secondary_code_string = const_cast(&GALILEO_E5A_I_SECONDARY_CODE); signal_pretty_name = signal_pretty_name + "I"; + interchange_iq = true; } } else @@ -607,7 +610,7 @@ bool dll_pll_veml_tracking_fpga::cn0_and_tracking_lock_status(double coh_integra d_Prompt_buffer[d_cn0_estimation_counter % trk_parameters.cn0_samples] = d_P_accu; d_cn0_estimation_counter++; // Code lock indicator - float d_CN0_SNV_dB_Hz_raw = cn0_mm_estimator(d_Prompt_buffer.data(), trk_parameters.cn0_samples, static_cast(coh_integration_time_s)); + float d_CN0_SNV_dB_Hz_raw = cn0_svn_estimator(d_Prompt_buffer.data(), trk_parameters.cn0_samples, static_cast(coh_integration_time_s)); d_CN0_SNV_dB_Hz = d_cn0_smoother.smooth(d_CN0_SNV_dB_Hz_raw); // Carrier lock indicator d_carrier_lock_test = d_carrier_lock_test_smoother.smooth(carrier_lock_detector(d_Prompt_buffer.data(), 1)); @@ -746,7 +749,7 @@ void dll_pll_veml_tracking_fpga::run_dll_pll() if (d_dll_filt_history.full()) { float avg_code_error_chips_s = std::accumulate(d_dll_filt_history.begin(), d_dll_filt_history.end(), 0.0) / static_cast(d_dll_filt_history.capacity()); - if (std::fabs(avg_code_error_chips_s) > 1.0) + if (fabs(avg_code_error_chips_s) > 1.0) { float carrier_doppler_error_hz = static_cast(d_signal_carrier_freq) * avg_code_error_chips_s / static_cast(d_code_chip_rate); LOG(INFO) << "Detected and corrected carrier doppler error: " << carrier_doppler_error_hz << " [Hz] on sat " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN); @@ -1760,8 +1763,16 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un // ########### Output the tracking results to Telemetry block ########## // Fill the acquisition data current_synchro_data = *d_acquisition_gnss_synchro; - current_synchro_data.Prompt_I = static_cast(d_P_data_accu.real()); - current_synchro_data.Prompt_Q = static_cast(d_P_data_accu.imag()); + if (interchange_iq) + { + current_synchro_data.Prompt_I = static_cast(d_P_data_accu.imag()); + current_synchro_data.Prompt_Q = static_cast(d_P_data_accu.real()); + } + else + { + current_synchro_data.Prompt_I = static_cast(d_P_data_accu.real()); + current_synchro_data.Prompt_Q = static_cast(d_P_data_accu.imag()); + } current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; @@ -1809,8 +1820,16 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un // ########### Output the tracking results to Telemetry block ########## // Fill the acquisition data current_synchro_data = *d_acquisition_gnss_synchro; - current_synchro_data.Prompt_I = static_cast(d_P_data_accu.real()); - current_synchro_data.Prompt_Q = static_cast(d_P_data_accu.imag()); + if (interchange_iq) + { + current_synchro_data.Prompt_I = static_cast(d_P_data_accu.imag()); + current_synchro_data.Prompt_Q = static_cast(d_P_data_accu.real()); + } + else + { + current_synchro_data.Prompt_I = static_cast(d_P_data_accu.real()); + current_synchro_data.Prompt_Q = static_cast(d_P_data_accu.imag()); + } current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; @@ -1858,8 +1877,16 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un // ########### Output the tracking results to Telemetry block ########## // Fill the acquisition data current_synchro_data = *d_acquisition_gnss_synchro; - current_synchro_data.Prompt_I = static_cast(d_P_data_accu.real()); - current_synchro_data.Prompt_Q = static_cast(d_P_data_accu.imag()); + if (interchange_iq) + { + current_synchro_data.Prompt_I = static_cast(d_P_data_accu.imag()); + current_synchro_data.Prompt_Q = static_cast(d_P_data_accu.real()); + } + else + { + current_synchro_data.Prompt_I = static_cast(d_P_data_accu.real()); + current_synchro_data.Prompt_Q = static_cast(d_P_data_accu.imag()); + } current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; @@ -1916,8 +1943,16 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un // ########### Output the tracking results to Telemetry block ########## // Fill the acquisition data current_synchro_data = *d_acquisition_gnss_synchro; - current_synchro_data.Prompt_I = static_cast(d_P_data_accu.real()); - current_synchro_data.Prompt_Q = static_cast(d_P_data_accu.imag()); + if (interchange_iq) + { + current_synchro_data.Prompt_I = static_cast(d_P_data_accu.imag()); + current_synchro_data.Prompt_Q = static_cast(d_P_data_accu.real()); + } + else + { + current_synchro_data.Prompt_I = static_cast(d_P_data_accu.real()); + current_synchro_data.Prompt_Q = static_cast(d_P_data_accu.imag()); + } current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h index c12618ab8..ba6c887a1 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h @@ -199,6 +199,7 @@ private: // tracking vars bool d_pull_in_transitory; bool d_corrected_doppler; + bool interchange_iq; double d_current_correlation_time_s; double d_carr_phase_error_hz; double d_carr_freq_error_hz; From f16bcf36ba26a26f9f8e0c30cc6fe2f56a04a58f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 19 Sep 2019 18:27:49 +0200 Subject: [PATCH 3/3] Update changelog --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index 852dac7b3..33dbaad1d 100644 --- a/docs/changelog +++ b/docs/changelog @@ -14,6 +14,7 @@ - New Tracking parameters allow the configuration of the C/N0 and lock detector smoothers, as well as the activation of the FLL in pull-in and steady state stages. - New PVT parameter enable_rx_clock_correction parameter allows to enable or disable the application of the Time solution correction to the computation of Observables. +- Fixed L5 and E5a receiver chains when tracking the data component. ### Improvements in Interoperability: