mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 15:23:04 +00:00 
			
		
		
		
	bds_b3i: merging new changes, fixing small bugs
This commit is contained in:
		| @@ -25,14 +25,6 @@ if(ENABLE_CUDA) | ||||
|         ${OPT_TRACKING_BLOCKS_HEADERS} | ||||
|         gps_l1_ca_dll_pll_tracking_gpu_cc.h | ||||
|     ) | ||||
|     set(OPT_TRACKING_INCLUDES | ||||
|         ${OPT_TRACKING_INCLUDES} | ||||
|         ${CUDA_INCLUDE_DIRS} | ||||
|     ) | ||||
|     set(OPT_TRACKING_LIBRARIES | ||||
|         ${OPT_TRACKING_LIBRARIES} | ||||
|         ${CUDA_LIBRARIES} | ||||
|     ) | ||||
| endif() | ||||
|  | ||||
| if(ENABLE_FPGA) | ||||
| @@ -91,20 +83,33 @@ add_library(tracking_gr_blocks | ||||
| target_link_libraries(tracking_gr_blocks | ||||
|     PUBLIC | ||||
|         Boost::boost | ||||
|         tracking_lib | ||||
|         Gnuradio::blocks | ||||
|         Matio::matio | ||||
|         Volkgnsssdr::volkgnsssdr | ||||
|         gnss_sdr_flags | ||||
|         gnss_sp_libs | ||||
|         gnss_rx | ||||
|         Matio::matio | ||||
|         ${OPT_TRACKING_LIBRARIES} | ||||
|         algorithms_libs | ||||
|         tracking_libs | ||||
| ) | ||||
|  | ||||
| target_include_directories(tracking_gr_blocks | ||||
|     PUBLIC | ||||
|         ${OPT_TRACKING_INCLUDES} | ||||
| ) | ||||
| if(ENABLE_CUDA) | ||||
|     target_link_libraries(tracking_gr_blocks | ||||
|         PUBLIC | ||||
|             ${CUDA_LIBRARIES} | ||||
|     ) | ||||
|     target_include_directories(tracking_gr_blocks | ||||
|         PUBLIC | ||||
|             ${CUDA_INCLUDE_DIRS} | ||||
|     ) | ||||
| endif() | ||||
|  | ||||
| if(ENABLE_CLANG_TIDY) | ||||
|     if(CLANG_TIDY_EXE) | ||||
|         set_target_properties(tracking_gr_blocks | ||||
|             PROPERTIES | ||||
|                 CXX_CLANG_TIDY "${DO_CLANG_TIDY}" | ||||
|         ) | ||||
|     endif() | ||||
| endif() | ||||
|  | ||||
| set_property(TARGET tracking_gr_blocks | ||||
|     APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES | ||||
|   | ||||
| @@ -46,7 +46,6 @@ | ||||
| #include "MATH_CONSTANTS.h" | ||||
| #include "beidou_b3i_signal_processing.h" | ||||
| #include "beidou_b1i_signal_processing.h" | ||||
| #include "control_message_factory.h" | ||||
| #include "galileo_e1_signal_processing.h" | ||||
| #include "galileo_e5_signal_processing.h" | ||||
| #include "gnss_sdr_create_directory.h" | ||||
| @@ -62,6 +61,7 @@ | ||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | ||||
| #include <algorithm> | ||||
| #include <cmath> | ||||
| #include <exception> | ||||
| #include <iostream> | ||||
| #include <numeric> | ||||
| #include <sstream> | ||||
| @@ -102,6 +102,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl | ||||
|     d_secondary_code_length = 0U; | ||||
|     d_secondary_code_string = nullptr; | ||||
|     d_preambles_symbols = nullptr; | ||||
|     d_preamble_length_symbols = 0; | ||||
|     signal_type = std::string(trk_parameters.signal); | ||||
|  | ||||
|     std::map<std::string, std::string> map_signal_pretty_name; | ||||
| @@ -176,24 +177,24 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl | ||||
|             else if (signal_type == "L5") | ||||
|                 { | ||||
|                     d_signal_carrier_freq = GPS_L5_FREQ_HZ; | ||||
|                     d_code_period = GPS_L5i_PERIOD; | ||||
|                     d_code_chip_rate = GPS_L5i_CODE_RATE_HZ; | ||||
|                     d_code_period = GPS_L5I_PERIOD; | ||||
|                     d_code_chip_rate = GPS_L5I_CODE_RATE_HZ; | ||||
|                     d_symbols_per_bit = GPS_L5_SAMPLES_PER_SYMBOL; | ||||
|                     d_correlation_length_ms = 1; | ||||
|                     d_code_samples_per_chip = 1; | ||||
|                     d_code_length_chips = static_cast<uint32_t>(GPS_L5i_CODE_LENGTH_CHIPS); | ||||
|                     d_code_length_chips = static_cast<uint32_t>(GPS_L5I_CODE_LENGTH_CHIPS); | ||||
|                     d_secondary = true; | ||||
|                     if (trk_parameters.track_pilot) | ||||
|                         { | ||||
|                             d_secondary_code_length = static_cast<uint32_t>(GPS_L5q_NH_CODE_LENGTH); | ||||
|                             d_secondary_code_string = const_cast<std::string *>(&GPS_L5q_NH_CODE_STR); | ||||
|                             d_secondary_code_length = static_cast<uint32_t>(GPS_L5Q_NH_CODE_LENGTH); | ||||
|                             d_secondary_code_string = const_cast<std::string *>(&GPS_L5Q_NH_CODE_STR); | ||||
|                             signal_pretty_name = signal_pretty_name + "Q"; | ||||
|                             interchange_iq = true; | ||||
|                         } | ||||
|                     else | ||||
|                         { | ||||
|                             d_secondary_code_length = static_cast<uint32_t>(GPS_L5i_NH_CODE_LENGTH); | ||||
|                             d_secondary_code_string = const_cast<std::string *>(&GPS_L5i_NH_CODE_STR); | ||||
|                             d_secondary_code_length = static_cast<uint32_t>(GPS_L5I_NH_CODE_LENGTH); | ||||
|                             d_secondary_code_string = const_cast<std::string *>(&GPS_L5I_NH_CODE_STR); | ||||
|                             signal_pretty_name = signal_pretty_name + "I"; | ||||
|                             interchange_iq = false; | ||||
|                         } | ||||
| @@ -217,10 +218,10 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl | ||||
|             systemName = "Galileo"; | ||||
|             if (signal_type == "1B") | ||||
|                 { | ||||
|                     d_signal_carrier_freq = Galileo_E1_FREQ_HZ; | ||||
|                     d_code_period = Galileo_E1_CODE_PERIOD; | ||||
|                     d_code_chip_rate = Galileo_E1_CODE_CHIP_RATE_HZ; | ||||
|                     d_code_length_chips = static_cast<uint32_t>(Galileo_E1_B_CODE_LENGTH_CHIPS); | ||||
|                     d_signal_carrier_freq = GALILEO_E1_FREQ_HZ; | ||||
|                     d_code_period = GALILEO_E1_CODE_PERIOD; | ||||
|                     d_code_chip_rate = GALILEO_E1_CODE_CHIP_RATE_HZ; | ||||
|                     d_code_length_chips = static_cast<uint32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS); | ||||
|                     d_symbols_per_bit = 1; | ||||
|                     d_correlation_length_ms = 4; | ||||
|                     d_code_samples_per_chip = 2;  // CBOC disabled: 2 samples per chip. CBOC enabled: 12 samples per chip | ||||
| @@ -228,8 +229,8 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl | ||||
|                     if (trk_parameters.track_pilot) | ||||
|                         { | ||||
|                             d_secondary = true; | ||||
|                             d_secondary_code_length = static_cast<uint32_t>(Galileo_E1_C_SECONDARY_CODE_LENGTH); | ||||
|                             d_secondary_code_string = const_cast<std::string *>(&Galileo_E1_C_SECONDARY_CODE); | ||||
|                             d_secondary_code_length = static_cast<uint32_t>(GALILEO_E1_C_SECONDARY_CODE_LENGTH); | ||||
|                             d_secondary_code_string = const_cast<std::string *>(&GALILEO_E1_C_SECONDARY_CODE); | ||||
|                             signal_pretty_name = signal_pretty_name + "C"; | ||||
|                         } | ||||
|                     else | ||||
| @@ -241,18 +242,18 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl | ||||
|                 } | ||||
|             else if (signal_type == "5X") | ||||
|                 { | ||||
|                     d_signal_carrier_freq = Galileo_E5a_FREQ_HZ; | ||||
|                     d_code_period = GALILEO_E5a_CODE_PERIOD; | ||||
|                     d_code_chip_rate = Galileo_E5a_CODE_CHIP_RATE_HZ; | ||||
|                     d_signal_carrier_freq = GALILEO_E5A_FREQ_HZ; | ||||
|                     d_code_period = GALILEO_E5A_CODE_PERIOD; | ||||
|                     d_code_chip_rate = GALILEO_E5A_CODE_CHIP_RATE_HZ; | ||||
|                     d_symbols_per_bit = 20; | ||||
|                     d_correlation_length_ms = 1; | ||||
|                     d_code_samples_per_chip = 1; | ||||
|                     d_code_length_chips = static_cast<uint32_t>(Galileo_E5a_CODE_LENGTH_CHIPS); | ||||
|                     d_code_length_chips = static_cast<uint32_t>(GALILEO_E5A_CODE_LENGTH_CHIPS); | ||||
|  | ||||
|                     if (trk_parameters.track_pilot) | ||||
|                         { | ||||
|                             d_secondary = true; | ||||
|                             d_secondary_code_length = static_cast<uint32_t>(Galileo_E5a_Q_SECONDARY_CODE_LENGTH); | ||||
|                             d_secondary_code_length = static_cast<uint32_t>(GALILEO_E5A_Q_SECONDARY_CODE_LENGTH); | ||||
|                             signal_pretty_name = signal_pretty_name + "Q"; | ||||
|                             interchange_iq = true; | ||||
|                         } | ||||
| @@ -283,19 +284,19 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl | ||||
|             systemName = "Beidou"; | ||||
|             if (signal_type == "B1") | ||||
|                 { | ||||
|             		// GEO Satellites use different secondary code | ||||
|             	    d_signal_carrier_freq = BEIDOU_B1I_FREQ_HZ; | ||||
| 					d_code_period = BEIDOU_B1I_CODE_PERIOD; | ||||
| 					d_code_chip_rate = BEIDOU_B1I_CODE_RATE_HZ; | ||||
| 					d_code_length_chips = static_cast<unsigned int>(BEIDOU_B1I_CODE_LENGTH_CHIPS); | ||||
| 					d_symbols_per_bit = BEIDOU_B1I_TELEMETRY_SYMBOLS_PER_BIT; | ||||
| 					d_correlation_length_ms = 1; | ||||
| 					d_code_samples_per_chip = 1; | ||||
| 					d_secondary = true; | ||||
| 					trk_parameters.track_pilot = false; | ||||
| 					interchange_iq = false; | ||||
| 					d_secondary_code_length = static_cast<unsigned int>(BEIDOU_B1I_SECONDARY_CODE_LENGTH); | ||||
| 					d_secondary_code_string = const_cast<std::string *>(&BEIDOU_B1I_SECONDARY_CODE_STR); | ||||
|                     // GEO Satellites use different secondary code | ||||
|                     d_signal_carrier_freq = BEIDOU_B1I_FREQ_HZ; | ||||
|                     d_code_period = BEIDOU_B1I_CODE_PERIOD; | ||||
|                     d_code_chip_rate = BEIDOU_B1I_CODE_RATE_HZ; | ||||
|                     d_code_length_chips = static_cast<unsigned int>(BEIDOU_B1I_CODE_LENGTH_CHIPS); | ||||
|                     d_symbols_per_bit = BEIDOU_B1I_TELEMETRY_SYMBOLS_PER_BIT; | ||||
|                     d_correlation_length_ms = 1; | ||||
|                     d_code_samples_per_chip = 1; | ||||
|                     d_secondary = true; | ||||
|                     trk_parameters.track_pilot = false; | ||||
|                     interchange_iq = false; | ||||
|                     d_secondary_code_length = static_cast<unsigned int>(BEIDOU_B1I_SECONDARY_CODE_LENGTH); | ||||
|                     d_secondary_code_string = const_cast<std::string *>(&BEIDOU_B1I_SECONDARY_CODE_STR); | ||||
|                 } | ||||
|             else if (signal_type == "B3") | ||||
|             { | ||||
| @@ -312,7 +313,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl | ||||
| 				interchange_iq = false; | ||||
| 				d_secondary_code_length = static_cast<unsigned int>(BEIDOU_B3I_SECONDARY_CODE_LENGTH); | ||||
| 				d_secondary_code_string = const_cast<std::string *>(&BEIDOU_B3I_SECONDARY_CODE_STR); | ||||
|             } | ||||
|                 } | ||||
|             else | ||||
|                 { | ||||
|                     LOG(WARNING) << "Invalid Signal argument when instantiating tracking blocks"; | ||||
| @@ -573,7 +574,7 @@ void dll_pll_veml_tracking::start_tracking() | ||||
|             galileo_e5_a_code_gen_complex_primary(aux_code, d_acquisition_gnss_synchro->PRN, const_cast<char *>(signal_type.c_str())); | ||||
|             if (trk_parameters.track_pilot) | ||||
|                 { | ||||
|                     d_secondary_code_string = const_cast<std::string *>(&Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1]); | ||||
|                     d_secondary_code_string = const_cast<std::string *>(&GALILEO_E5A_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1]); | ||||
|                     for (uint32_t i = 0; i < d_code_length_chips; i++) | ||||
|                         { | ||||
|                             d_tracking_code[i] = aux_code[i].imag(); | ||||
| @@ -595,22 +596,22 @@ void dll_pll_veml_tracking::start_tracking() | ||||
|         { | ||||
|             beidou_b1i_code_gen_float(d_tracking_code, d_acquisition_gnss_synchro->PRN, 0); | ||||
|             // Update secondary code settings for geo satellites | ||||
|             if(d_acquisition_gnss_synchro->PRN > 0 and d_acquisition_gnss_synchro->PRN < 6) | ||||
|             if (d_acquisition_gnss_synchro->PRN > 0 and d_acquisition_gnss_synchro->PRN < 6) | ||||
|                 { | ||||
|             		d_symbols_per_bit = 2; | ||||
| 					d_correlation_length_ms = 1; | ||||
| 					d_code_samples_per_chip = 1; | ||||
| 					d_secondary = false; | ||||
| 					trk_parameters.track_pilot = false; | ||||
| 					interchange_iq = false; | ||||
| 					d_secondary_code_length = 0; | ||||
| 					d_secondary_code_string = const_cast<std::string *>(&BEIDOU_B1I_D2_SECONDARY_CODE_STR); | ||||
|                     d_symbols_per_bit = 2; | ||||
|                     d_correlation_length_ms = 1; | ||||
|                     d_code_samples_per_chip = 1; | ||||
|                     d_secondary = false; | ||||
|                     trk_parameters.track_pilot = false; | ||||
|                     interchange_iq = false; | ||||
|                     d_secondary_code_length = 0; | ||||
|                     d_secondary_code_string = const_cast<std::string *>(&BEIDOU_B1I_D2_SECONDARY_CODE_STR); | ||||
|  | ||||
| 					// preamble bits to sampled symbols | ||||
| 					d_preamble_length_symbols = 22; | ||||
| 					d_preambles_symbols = static_cast<int32_t *>(volk_gnsssdr_malloc(22 * sizeof(int32_t), volk_gnsssdr_get_alignment())); | ||||
| 					int32_t n = 0; | ||||
| 					uint16_t preambles_bits[BEIDOU_B1I_PREAMBLE_LENGTH_BITS] = {1,1,1,0,0,0,1,0,0,1,0}; | ||||
|                     // preamble bits to sampled symbols | ||||
|                     d_preamble_length_symbols = 22; | ||||
|                     d_preambles_symbols = static_cast<int32_t *>(volk_gnsssdr_malloc(22 * sizeof(int32_t), volk_gnsssdr_get_alignment())); | ||||
|                     int32_t n = 0; | ||||
|                     uint16_t preambles_bits[BEIDOU_B1I_PREAMBLE_LENGTH_BITS] = {1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0}; | ||||
| 					for (uint16_t preambles_bit : preambles_bits) | ||||
| 						{ | ||||
| 							for (int32_t j = 0; j < d_symbols_per_bit; j++) | ||||
| @@ -652,23 +653,23 @@ void dll_pll_veml_tracking::start_tracking() | ||||
| 					d_preambles_symbols = static_cast<int32_t *>(volk_gnsssdr_malloc(22 * sizeof(int32_t), volk_gnsssdr_get_alignment())); | ||||
| 					int32_t n = 0; | ||||
| 					uint16_t preambles_bits[BEIDOU_B3I_PREAMBLE_LENGTH_BITS] = {1,1,1,0,0,0,1,0,0,1,0}; | ||||
| 					for (uint16_t preambles_bit : preambles_bits) | ||||
| 						{ | ||||
| 							for (int32_t j = 0; j < d_symbols_per_bit; j++) | ||||
| 								{ | ||||
| 									if (preambles_bit == 1) | ||||
| 										{ | ||||
| 											d_preambles_symbols[n] = 1; | ||||
| 										} | ||||
| 									else | ||||
| 										{ | ||||
| 											d_preambles_symbols[n] = -1; | ||||
| 										} | ||||
| 									n++; | ||||
| 								} | ||||
| 						} | ||||
| 					d_symbol_history.resize(22);  // Change fixed buffer size | ||||
| 					d_symbol_history.clear(); | ||||
|                     for (uint16_t preambles_bit : preambles_bits) | ||||
|                         { | ||||
|                             for (int32_t j = 0; j < d_symbols_per_bit; j++) | ||||
|                                 { | ||||
|                                     if (preambles_bit == 1) | ||||
|                                         { | ||||
|                                             d_preambles_symbols[n] = 1; | ||||
|                                         } | ||||
|                                     else | ||||
|                                         { | ||||
|                                             d_preambles_symbols[n] = -1; | ||||
|                                         } | ||||
|                                     n++; | ||||
|                                 } | ||||
|                         } | ||||
|                     d_symbol_history.resize(22);  // Change fixed buffer size | ||||
|                     d_symbol_history.clear(); | ||||
|                 } | ||||
|         } | ||||
|  | ||||
| @@ -733,9 +734,16 @@ dll_pll_veml_tracking::~dll_pll_veml_tracking() | ||||
|                 } | ||||
|         } | ||||
|     if (d_dump_mat) | ||||
|         { | ||||
|             try | ||||
|         { | ||||
|             save_matfile(); | ||||
|         } | ||||
|             catch (const std::exception &ex) | ||||
|                 { | ||||
|                     LOG(WARNING) << "Error saving the .mat file: " << ex.what(); | ||||
|                 } | ||||
|         } | ||||
|     try | ||||
|         { | ||||
|             volk_gnsssdr_free(d_local_code_shift_chips); | ||||
| @@ -792,7 +800,7 @@ bool dll_pll_veml_tracking::acquire_secondary() | ||||
|             return true; | ||||
|         } | ||||
|  | ||||
|             return false; | ||||
|     return false; | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -806,29 +814,32 @@ bool dll_pll_veml_tracking::cn0_and_tracking_lock_status(double coh_integration_ | ||||
|             d_cn0_estimation_counter++; | ||||
|             return true; | ||||
|         } | ||||
|             d_cn0_estimation_counter = 0; | ||||
|             // Code lock indicator | ||||
|             d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, trk_parameters.cn0_samples, coh_integration_time_s); | ||||
|             // Carrier lock indicator | ||||
|             d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, trk_parameters.cn0_samples); | ||||
|             // Loss of lock detection | ||||
|             if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < trk_parameters.cn0_min) | ||||
|     d_cn0_estimation_counter = 0; | ||||
|     // Code lock indicator | ||||
|     d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, trk_parameters.cn0_samples, coh_integration_time_s); | ||||
|     // Carrier lock indicator | ||||
|     d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, trk_parameters.cn0_samples); | ||||
|     // Loss of lock detection | ||||
|     if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < trk_parameters.cn0_min) | ||||
|         { | ||||
|             d_carrier_lock_fail_counter++; | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|             if (d_carrier_lock_fail_counter > 0) | ||||
|                 { | ||||
|                     d_carrier_lock_fail_counter++; | ||||
|                     d_carrier_lock_fail_counter--; | ||||
|                 } | ||||
|             else | ||||
|                 { | ||||
|                     if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; | ||||
|                 } | ||||
|             if (d_carrier_lock_fail_counter > trk_parameters.max_lock_fail) | ||||
|                 { | ||||
|                     std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; | ||||
|                     LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; | ||||
|                     this->message_port_pub(pmt::mp("events"), pmt::from_long(3));  // 3 -> loss of lock | ||||
|                     d_carrier_lock_fail_counter = 0; | ||||
|                     return false; | ||||
|                 } | ||||
|                     return true; | ||||
|         } | ||||
|     if (d_carrier_lock_fail_counter > trk_parameters.max_lock_fail) | ||||
|         { | ||||
|             std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; | ||||
|             LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; | ||||
|             this->message_port_pub(pmt::mp("events"), pmt::from_long(3));  // 3 -> loss of lock | ||||
|             d_carrier_lock_fail_counter = 0; | ||||
|             return false; | ||||
|         } | ||||
|     return true; | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -907,7 +918,10 @@ void dll_pll_veml_tracking::run_dll_pll() | ||||
| void dll_pll_veml_tracking::clear_tracking_vars() | ||||
| { | ||||
|     std::fill_n(d_correlator_outs, d_n_correlator_taps, gr_complex(0.0, 0.0)); | ||||
|     if (trk_parameters.track_pilot) d_Prompt_Data[0] = gr_complex(0.0, 0.0); | ||||
|     if (trk_parameters.track_pilot) | ||||
|         { | ||||
|             d_Prompt_Data[0] = gr_complex(0.0, 0.0); | ||||
|         } | ||||
|     d_carr_error_hz = 0.0; | ||||
|     d_carr_error_filt_hz = 0.0; | ||||
|     d_code_error_chips = 0.0; | ||||
| @@ -1043,9 +1057,13 @@ void dll_pll_veml_tracking::save_correlation_results() | ||||
|         } | ||||
|     // If tracking pilot, disable Costas loop | ||||
|     if (trk_parameters.track_pilot) | ||||
|         { | ||||
|         d_cloop = false; | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|         d_cloop = true; | ||||
|         } | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -1512,7 +1530,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) | ||||
|                 DLOG(INFO) << "PULL-IN Doppler [Hz] = " << d_carrier_doppler_hz | ||||
|                            << ". PULL-IN Code Phase [samples] = " << d_acq_code_phase_samples; | ||||
|  | ||||
|                 consume_each(samples_offset);                               // shift input to perform alignment with local replica | ||||
|                 consume_each(samples_offset);  // shift input to perform alignment with local replica | ||||
|                 return 0; | ||||
|             } | ||||
|         case 2:  // Wide tracking and symbol synchronization | ||||
| @@ -1552,8 +1570,8 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) | ||||
|                                         next_state = acquire_secondary(); | ||||
|                                         if (next_state) | ||||
|                                             { | ||||
|                                         		LOG(INFO) << systemName << " " << signal_pretty_name << " secondary code locked in channel " << d_channel | ||||
|                                                         << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; | ||||
|                                                 LOG(INFO) << systemName << " " << signal_pretty_name << " secondary code locked in channel " << d_channel | ||||
|                                                           << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; | ||||
|                                                 std::cout << systemName << " " << signal_pretty_name << " secondary code locked in channel " << d_channel | ||||
|                                                           << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; | ||||
|                                             } | ||||
| @@ -1585,7 +1603,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) | ||||
|                                             } | ||||
|                                         if (corr_value == d_preamble_length_symbols) | ||||
|                                             { | ||||
|                                         		LOG(INFO) << systemName << " " << signal_pretty_name << " tracking preamble detected in channel " << d_channel | ||||
|                                                 LOG(INFO) << systemName << " " << signal_pretty_name << " tracking preamble detected in channel " << d_channel | ||||
|                                                           << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; | ||||
|                                                 next_state = true; | ||||
|                                             } | ||||
|   | ||||
| @@ -47,7 +47,7 @@ | ||||
|  | ||||
| class dll_pll_veml_tracking; | ||||
|  | ||||
| typedef boost::shared_ptr<dll_pll_veml_tracking> dll_pll_veml_tracking_sptr; | ||||
| using dll_pll_veml_tracking_sptr = boost::shared_ptr<dll_pll_veml_tracking>; | ||||
|  | ||||
| dll_pll_veml_tracking_sptr dll_pll_veml_make_tracking(const Dll_Pll_Conf &conf_); | ||||
|  | ||||
| @@ -121,8 +121,8 @@ private: | ||||
|     float *d_data_code; | ||||
|     float *d_local_code_shift_chips; | ||||
|     float *d_prompt_data_shift; | ||||
|     cpu_multicorrelator_real_codes multicorrelator_cpu; | ||||
|     cpu_multicorrelator_real_codes correlator_data_cpu;  //for data channel | ||||
|     Cpu_Multicorrelator_Real_Codes multicorrelator_cpu; | ||||
|     Cpu_Multicorrelator_Real_Codes correlator_data_cpu;  //for data channel | ||||
|     /*  TODO: currently the multicorrelator does not support adding extra correlator | ||||
|         with different local code, thus we need extra multicorrelator instance. | ||||
|         Implement this functionality inside multicorrelator class | ||||
|   | ||||
| @@ -42,7 +42,6 @@ | ||||
| #include "Galileo_E1.h" | ||||
| #include "Galileo_E5a.h" | ||||
| #include "MATH_CONSTANTS.h" | ||||
| #include "control_message_factory.h" | ||||
| #include "gnss_sdr_create_directory.h" | ||||
| #include "gps_l2c_signal.h" | ||||
| #include "gps_l5_signal.h" | ||||
| @@ -55,6 +54,7 @@ | ||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | ||||
| #include <algorithm> | ||||
| #include <cmath> | ||||
| #include <exception> | ||||
| #include <iostream> | ||||
| #include <sstream> | ||||
|  | ||||
| @@ -124,7 +124,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & | ||||
|                     // preamble bits to sampled symbols | ||||
|                     d_gps_l1ca_preambles_symbols = static_cast<int32_t *>(volk_gnsssdr_malloc(GPS_CA_PREAMBLE_LENGTH_SYMBOLS * sizeof(int32_t), volk_gnsssdr_get_alignment())); | ||||
|                     int32_t n = 0; | ||||
|                     for (unsigned short preambles_bit : preambles_bits) | ||||
|                     for (uint16_t preambles_bit : preambles_bits) | ||||
|                         { | ||||
|                             for (uint32_t j = 0; j < GPS_CA_TELEMETRY_SYMBOLS_PER_BIT; j++) | ||||
|                                 { | ||||
| @@ -159,8 +159,8 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & | ||||
|             else if (signal_type == "L5") | ||||
|                 { | ||||
|                     d_signal_carrier_freq = GPS_L5_FREQ_HZ; | ||||
|                     d_code_period = GPS_L5i_PERIOD; | ||||
|                     d_code_chip_rate = GPS_L5i_CODE_RATE_HZ; | ||||
|                     d_code_period = GPS_L5I_PERIOD; | ||||
|                     d_code_chip_rate = GPS_L5I_CODE_RATE_HZ; | ||||
|                     d_symbols_per_bit = GPS_L5_SAMPLES_PER_SYMBOL; | ||||
|                     d_correlation_length_ms = 1; | ||||
|                     //d_code_samples_per_chip = 1; | ||||
| @@ -169,15 +169,15 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & | ||||
|                     //                   interchange_iq = false; | ||||
|                     if (trk_parameters.track_pilot) | ||||
|                         { | ||||
|                             d_secondary_code_length = static_cast<uint32_t>(GPS_L5q_NH_CODE_LENGTH); | ||||
|                             d_secondary_code_string = const_cast<std::string *>(&GPS_L5q_NH_CODE_STR); | ||||
|                             d_secondary_code_length = static_cast<uint32_t>(GPS_L5Q_NH_CODE_LENGTH); | ||||
|                             d_secondary_code_string = const_cast<std::string *>(&GPS_L5Q_NH_CODE_STR); | ||||
|                             signal_pretty_name = signal_pretty_name + "Q"; | ||||
|                             interchange_iq = true; | ||||
|                         } | ||||
|                     else | ||||
|                         { | ||||
|                             d_secondary_code_length = static_cast<uint32_t>(GPS_L5i_NH_CODE_LENGTH); | ||||
|                             d_secondary_code_string = const_cast<std::string *>(&GPS_L5i_NH_CODE_STR); | ||||
|                             d_secondary_code_length = static_cast<uint32_t>(GPS_L5I_NH_CODE_LENGTH); | ||||
|                             d_secondary_code_string = const_cast<std::string *>(&GPS_L5I_NH_CODE_STR); | ||||
|                             signal_pretty_name = signal_pretty_name + "I"; | ||||
|                             interchange_iq = false; | ||||
|                         } | ||||
| @@ -201,9 +201,9 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & | ||||
|             systemName = "Galileo"; | ||||
|             if (signal_type == "1B") | ||||
|                 { | ||||
|                     d_signal_carrier_freq = Galileo_E1_FREQ_HZ; | ||||
|                     d_code_period = Galileo_E1_CODE_PERIOD; | ||||
|                     d_code_chip_rate = Galileo_E1_CODE_CHIP_RATE_HZ; | ||||
|                     d_signal_carrier_freq = GALILEO_E1_FREQ_HZ; | ||||
|                     d_code_period = GALILEO_E1_CODE_PERIOD; | ||||
|                     d_code_chip_rate = GALILEO_E1_CODE_CHIP_RATE_HZ; | ||||
|                     //d_code_length_chips = static_cast<uint32_t >(Galileo_E1_B_CODE_LENGTH_CHIPS); | ||||
|                     d_symbols_per_bit = 1; | ||||
|                     d_correlation_length_ms = 4; | ||||
| @@ -212,8 +212,8 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & | ||||
|                     if (trk_parameters.track_pilot) | ||||
|                         { | ||||
|                             d_secondary = true; | ||||
|                             d_secondary_code_length = static_cast<uint32_t>(Galileo_E1_C_SECONDARY_CODE_LENGTH); | ||||
|                             d_secondary_code_string = const_cast<std::string *>(&Galileo_E1_C_SECONDARY_CODE); | ||||
|                             d_secondary_code_length = static_cast<uint32_t>(GALILEO_E1_C_SECONDARY_CODE_LENGTH); | ||||
|                             d_secondary_code_string = const_cast<std::string *>(&GALILEO_E1_C_SECONDARY_CODE); | ||||
|                             signal_pretty_name = signal_pretty_name + "C"; | ||||
|                         } | ||||
|                     else | ||||
| @@ -225,9 +225,9 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & | ||||
|                 } | ||||
|             else if (signal_type == "5X") | ||||
|                 { | ||||
|                     d_signal_carrier_freq = Galileo_E5a_FREQ_HZ; | ||||
|                     d_code_period = GALILEO_E5a_CODE_PERIOD; | ||||
|                     d_code_chip_rate = Galileo_E5a_CODE_CHIP_RATE_HZ; | ||||
|                     d_signal_carrier_freq = GALILEO_E5A_FREQ_HZ; | ||||
|                     d_code_period = GALILEO_E5A_CODE_PERIOD; | ||||
|                     d_code_chip_rate = GALILEO_E5A_CODE_CHIP_RATE_HZ; | ||||
|                     d_symbols_per_bit = 20; | ||||
|                     d_correlation_length_ms = 1; | ||||
|                     //d_code_samples_per_chip = 1; | ||||
| @@ -236,14 +236,14 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & | ||||
|                     //interchange_iq = false; | ||||
|                     if (trk_parameters.track_pilot) | ||||
|                         { | ||||
|                             d_secondary_code_length = static_cast<uint32_t>(Galileo_E5a_Q_SECONDARY_CODE_LENGTH); | ||||
|                             d_secondary_code_length = static_cast<uint32_t>(GALILEO_E5A_Q_SECONDARY_CODE_LENGTH); | ||||
|                             signal_pretty_name = signal_pretty_name + "Q"; | ||||
|                             interchange_iq = true; | ||||
|                         } | ||||
|                     else | ||||
|                         { | ||||
|                             d_secondary_code_length = static_cast<uint32_t>(Galileo_E5a_I_SECONDARY_CODE_LENGTH); | ||||
|                             d_secondary_code_string = const_cast<std::string *>(&Galileo_E5a_I_SECONDARY_CODE); | ||||
|                             d_secondary_code_length = static_cast<uint32_t>(GALILEO_E5A_I_SECONDARY_CODE_LENGTH); | ||||
|                             d_secondary_code_string = const_cast<std::string *>(&GALILEO_E5A_I_SECONDARY_CODE); | ||||
|                             signal_pretty_name = signal_pretty_name + "I"; | ||||
|                             interchange_iq = false; | ||||
|                         } | ||||
| @@ -537,7 +537,7 @@ void dll_pll_veml_tracking_fpga::start_tracking() | ||||
|         { | ||||
|             if (trk_parameters.track_pilot) | ||||
|                 { | ||||
|                     d_secondary_code_string = const_cast<std::string *>(&Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1]); | ||||
|                     d_secondary_code_string = const_cast<std::string *>(&GALILEO_E5A_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1]); | ||||
|                     for (uint32_t i = 0; i < d_code_length_chips; i++) | ||||
|                         { | ||||
|                             // nothing to compute : the local codes are pre-computed in the adapter class | ||||
| @@ -622,7 +622,14 @@ dll_pll_veml_tracking_fpga::~dll_pll_veml_tracking_fpga() | ||||
|         } | ||||
|     if (d_dump_mat) | ||||
|         { | ||||
|             save_matfile(); | ||||
|             try | ||||
|                 { | ||||
|                     save_matfile(); | ||||
|                 } | ||||
|             catch (const std::exception &ex) | ||||
|                 { | ||||
|                     LOG(WARNING) << "Error saving the .mat file: " << ex.what(); | ||||
|                 } | ||||
|         } | ||||
|     try | ||||
|         { | ||||
|   | ||||
| @@ -39,15 +39,12 @@ | ||||
| #include "galileo_e1_tcp_connector_tracking_cc.h" | ||||
| #include "GPS_L1_CA.h" | ||||
| #include "Galileo_E1.h" | ||||
| #include "control_message_factory.h" | ||||
| #include "galileo_e1_signal_processing.h" | ||||
| #include "gnss_sdr_flags.h" | ||||
| #include "lock_detectors.h" | ||||
| #include "tcp_communication.h" | ||||
| #include "tcp_packet_data.h" | ||||
| #include "tracking_discriminators.h" | ||||
| #include <boost/asio.hpp> | ||||
| #include <boost/lexical_cast.hpp> | ||||
| #include <glog/logging.h> | ||||
| #include <gnuradio/io_signature.h> | ||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | ||||
| @@ -119,7 +116,7 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc( | ||||
|  | ||||
|     // Initialization of local code replica | ||||
|     // Get space for a vector with the sinboc(1,1) replica sampled 2x/chip | ||||
|     d_ca_code = static_cast<gr_complex *>(volk_gnsssdr_malloc((2 * Galileo_E1_B_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||
|     d_ca_code = static_cast<gr_complex *>(volk_gnsssdr_malloc((2 * GALILEO_E1_B_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||
|  | ||||
|     // correlator outputs (scalar) | ||||
|     d_n_correlator_taps = 5;  // Very-Early, Early, Prompt, Late, Very-Late | ||||
| @@ -149,7 +146,7 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc( | ||||
|  | ||||
|     //--- Perform initializations ------------------------------ | ||||
|     // define initial code frequency basis of NCO | ||||
|     d_code_freq_chips = Galileo_E1_CODE_CHIP_RATE_HZ; | ||||
|     d_code_freq_chips = GALILEO_E1_CODE_CHIP_RATE_HZ; | ||||
|     // define residual code phase (in chips) | ||||
|     d_rem_code_phase_samples = 0.0; | ||||
|     // define residual carrier phase | ||||
| @@ -197,10 +194,10 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::start_tracking() | ||||
|         d_acquisition_gnss_synchro->Signal, | ||||
|         false, | ||||
|         d_acquisition_gnss_synchro->PRN, | ||||
|         2 * Galileo_E1_CODE_CHIP_RATE_HZ, | ||||
|         2 * GALILEO_E1_CODE_CHIP_RATE_HZ, | ||||
|         0); | ||||
|  | ||||
|     multicorrelator_cpu.set_local_code_and_taps(static_cast<int32_t>(2 * Galileo_E1_B_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips); | ||||
|     multicorrelator_cpu.set_local_code_and_taps(static_cast<int32_t>(2 * GALILEO_E1_B_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips); | ||||
|     for (int32_t n = 0; n < d_n_correlator_taps; n++) | ||||
|         { | ||||
|             d_correlator_outs[n] = gr_complex(0, 0); | ||||
| @@ -305,7 +302,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri | ||||
|     float carr_error_filt_hz = 0.0; | ||||
|     float code_error_filt_chips = 0.0; | ||||
|  | ||||
|     tcp_packet_data tcp_data; | ||||
|     Tcp_Packet_Data tcp_data; | ||||
|     // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder | ||||
|     Gnss_Synchro current_synchro_data = Gnss_Synchro(); | ||||
|     // Block input data and block output stream pointers | ||||
| @@ -324,8 +321,8 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri | ||||
|                     float acq_trk_shif_correction_samples; | ||||
|                     int32_t acq_to_trk_delay_samples; | ||||
|                     acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; | ||||
|                     acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples)); | ||||
|                     samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); | ||||
|                     acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples)); | ||||
|                     samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); | ||||
|                     current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); | ||||
|                     current_synchro_data.fs = d_fs_in; | ||||
|                     *out[0] = current_synchro_data; | ||||
| @@ -375,11 +372,11 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri | ||||
|             // New carrier Doppler frequency estimation | ||||
|             d_carrier_doppler_hz = d_acq_carrier_doppler_hz + carr_error_filt_hz; | ||||
|             // New code Doppler frequency estimation | ||||
|             d_code_freq_chips = Galileo_E1_CODE_CHIP_RATE_HZ + ((d_carrier_doppler_hz * Galileo_E1_CODE_CHIP_RATE_HZ) / Galileo_E1_FREQ_HZ); | ||||
|             d_code_freq_chips = GALILEO_E1_CODE_CHIP_RATE_HZ + ((d_carrier_doppler_hz * GALILEO_E1_CODE_CHIP_RATE_HZ) / GALILEO_E1_FREQ_HZ); | ||||
|             //carrier phase accumulator for (K) doppler estimation | ||||
|             d_acc_carrier_phase_rad -= GPS_TWO_PI * d_carrier_doppler_hz * Galileo_E1_CODE_PERIOD; | ||||
|             d_acc_carrier_phase_rad -= GPS_TWO_PI * d_carrier_doppler_hz * GALILEO_E1_CODE_PERIOD; | ||||
|             //remnant carrier phase to prevent overflow in the code NCO | ||||
|             d_rem_carr_phase_rad = d_rem_carr_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * Galileo_E1_CODE_PERIOD; | ||||
|             d_rem_carr_phase_rad = d_rem_carr_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * GALILEO_E1_CODE_PERIOD; | ||||
|             d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, GPS_TWO_PI); | ||||
|  | ||||
|             // ################## DLL ########################################################## | ||||
| @@ -387,7 +384,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri | ||||
|             code_error_filt_chips = tcp_data.proc_pack_code_error; | ||||
|             //Code phase accumulator | ||||
|             float code_error_filt_secs; | ||||
|             code_error_filt_secs = (Galileo_E1_CODE_PERIOD * code_error_filt_chips) / Galileo_E1_CODE_CHIP_RATE_HZ;  //[seconds] | ||||
|             code_error_filt_secs = (GALILEO_E1_CODE_PERIOD * code_error_filt_chips) / GALILEO_E1_CODE_CHIP_RATE_HZ;  //[seconds] | ||||
|             d_acc_code_phase_secs = d_acc_code_phase_secs + code_error_filt_secs; | ||||
|  | ||||
|             // ################## CARRIER AND CODE NCO BUFFER ALIGNMENT ####################### | ||||
| @@ -398,7 +395,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri | ||||
|             double K_blk_samples; | ||||
|             // Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation | ||||
|             T_chip_seconds = 1 / static_cast<double>(d_code_freq_chips); | ||||
|             T_prn_seconds = T_chip_seconds * Galileo_E1_B_CODE_LENGTH_CHIPS; | ||||
|             T_prn_seconds = T_chip_seconds * GALILEO_E1_B_CODE_LENGTH_CHIPS; | ||||
|             T_prn_samples = T_prn_seconds * static_cast<double>(d_fs_in); | ||||
|             K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast<double>(d_fs_in); | ||||
|             d_current_prn_length_samples = round(K_blk_samples);  //round to a discrete samples | ||||
| @@ -416,7 +413,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri | ||||
|                     d_cn0_estimation_counter = 0; | ||||
|  | ||||
|                     // Code lock indicator | ||||
|                     d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, Galileo_E1_CODE_PERIOD); | ||||
|                     d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, GALILEO_E1_CODE_PERIOD); | ||||
|  | ||||
|                     // Carrier lock indicator | ||||
|                     d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); | ||||
| @@ -428,7 +425,10 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri | ||||
|                         } | ||||
|                     else | ||||
|                         { | ||||
|                             if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; | ||||
|                             if (d_carrier_lock_fail_counter > 0) | ||||
|                                 { | ||||
|                                     d_carrier_lock_fail_counter--; | ||||
|                                 } | ||||
|                         } | ||||
|                     if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) | ||||
|                         { | ||||
|   | ||||
| @@ -51,7 +51,7 @@ | ||||
|  | ||||
| class Galileo_E1_Tcp_Connector_Tracking_cc; | ||||
|  | ||||
| typedef boost::shared_ptr<Galileo_E1_Tcp_Connector_Tracking_cc> galileo_e1_tcp_connector_tracking_cc_sptr; | ||||
| using galileo_e1_tcp_connector_tracking_cc_sptr = boost::shared_ptr<Galileo_E1_Tcp_Connector_Tracking_cc>; | ||||
|  | ||||
| galileo_e1_tcp_connector_tracking_cc_sptr | ||||
| galileo_e1_tcp_connector_make_tracking_cc( | ||||
| @@ -142,7 +142,7 @@ private: | ||||
|     // correlator | ||||
|     float *d_local_code_shift_chips; | ||||
|     gr_complex *d_correlator_outs; | ||||
|     cpu_multicorrelator multicorrelator_cpu; | ||||
|     Cpu_Multicorrelator multicorrelator_cpu; | ||||
|  | ||||
|     // tracking vars | ||||
|     double d_code_freq_chips; | ||||
| @@ -154,7 +154,7 @@ private: | ||||
|     size_t d_port; | ||||
|     int32_t d_listen_connection; | ||||
|     float d_control_id; | ||||
|     tcp_communication d_tcp_com; | ||||
|     Tcp_Communication d_tcp_com; | ||||
|  | ||||
|     //PRN period in samples | ||||
|     int32_t d_current_prn_length_samples; | ||||
|   | ||||
| @@ -38,7 +38,6 @@ | ||||
|  | ||||
| #include "glonass_l1_ca_dll_pll_c_aid_tracking_cc.h" | ||||
| #include "GLONASS_L1_L2_CA.h" | ||||
| #include "control_message_factory.h" | ||||
| #include "glonass_l1_signal_processing.h" | ||||
| #include "gnss_sdr_flags.h" | ||||
| #include "lock_detectors.h" | ||||
| @@ -50,6 +49,7 @@ | ||||
| #include <pmt/pmt.h> | ||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | ||||
| #include <cmath> | ||||
| #include <exception> | ||||
| #include <iostream> | ||||
| #include <memory> | ||||
| #include <sstream> | ||||
| @@ -326,7 +326,14 @@ glonass_l1_ca_dll_pll_c_aid_tracking_cc::~glonass_l1_ca_dll_pll_c_aid_tracking_c | ||||
|                 { | ||||
|                     std::cout << "Writing .mat files ..."; | ||||
|                 } | ||||
|             glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile(); | ||||
|             try | ||||
|                 { | ||||
|                     glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile(); | ||||
|                 } | ||||
|             catch (const std::exception &ex) | ||||
|                 { | ||||
|                     LOG(WARNING) << "Error saving the .mat file: " << ex.what(); | ||||
|                 } | ||||
|             if (d_channel == 0) | ||||
|                 { | ||||
|                     std::cout << " done." << std::endl; | ||||
| @@ -801,7 +808,10 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at | ||||
|                                 } | ||||
|                             else | ||||
|                                 { | ||||
|                                     if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; | ||||
|                                     if (d_carrier_lock_fail_counter > 0) | ||||
|                                         { | ||||
|                                             d_carrier_lock_fail_counter--; | ||||
|                                         } | ||||
|                                 } | ||||
|                             if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) | ||||
|                                 { | ||||
|   | ||||
| @@ -53,8 +53,7 @@ | ||||
|  | ||||
| class glonass_l1_ca_dll_pll_c_aid_tracking_cc; | ||||
|  | ||||
| typedef boost::shared_ptr<glonass_l1_ca_dll_pll_c_aid_tracking_cc> | ||||
|     glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr; | ||||
| using glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr = boost::shared_ptr<glonass_l1_ca_dll_pll_c_aid_tracking_cc>; | ||||
|  | ||||
| glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr | ||||
| glonass_l1_ca_dll_pll_c_aid_make_tracking_cc( | ||||
| @@ -126,7 +125,7 @@ private: | ||||
|     gr_complex* d_ca_code; | ||||
|     float* d_local_code_shift_chips; | ||||
|     gr_complex* d_correlator_outs; | ||||
|     cpu_multicorrelator multicorrelator_cpu; | ||||
|     Cpu_Multicorrelator multicorrelator_cpu; | ||||
|  | ||||
|     // remaining code phase and carrier phase between tracking loops | ||||
|     double d_rem_code_phase_samples; | ||||
|   | ||||
| @@ -38,7 +38,6 @@ | ||||
|  | ||||
| #include "glonass_l1_ca_dll_pll_c_aid_tracking_sc.h" | ||||
| #include "GLONASS_L1_L2_CA.h" | ||||
| #include "control_message_factory.h" | ||||
| #include "glonass_l1_signal_processing.h" | ||||
| #include "gnss_sdr_flags.h" | ||||
| #include "lock_detectors.h" | ||||
| @@ -49,6 +48,7 @@ | ||||
| #include <matio.h> | ||||
| #include <pmt/pmt.h> | ||||
| #include <cmath> | ||||
| #include <exception> | ||||
| #include <iostream> | ||||
| #include <memory> | ||||
| #include <sstream> | ||||
| @@ -529,7 +529,15 @@ glonass_l1_ca_dll_pll_c_aid_tracking_sc::~glonass_l1_ca_dll_pll_c_aid_tracking_s | ||||
|                 { | ||||
|                     std::cout << "Writing .mat files ..."; | ||||
|                 } | ||||
|             glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile(); | ||||
|             try | ||||
|                 { | ||||
|                     glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile(); | ||||
|                 } | ||||
|             catch (const std::exception &ex) | ||||
|                 { | ||||
|                     LOG(WARNING) << "Error saving the .mat file: " << ex.what(); | ||||
|                 } | ||||
|  | ||||
|             if (d_channel == 0) | ||||
|                 { | ||||
|                     std::cout << " done." << std::endl; | ||||
| @@ -790,7 +798,10 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at | ||||
|                                 } | ||||
|                             else | ||||
|                                 { | ||||
|                                     if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; | ||||
|                                     if (d_carrier_lock_fail_counter > 0) | ||||
|                                         { | ||||
|                                             d_carrier_lock_fail_counter--; | ||||
|                                         } | ||||
|                                 } | ||||
|                             if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) | ||||
|                                 { | ||||
|   | ||||
| @@ -54,8 +54,7 @@ | ||||
|  | ||||
| class glonass_l1_ca_dll_pll_c_aid_tracking_sc; | ||||
|  | ||||
| typedef boost::shared_ptr<glonass_l1_ca_dll_pll_c_aid_tracking_sc> | ||||
|     glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr; | ||||
| using glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr = boost::shared_ptr<glonass_l1_ca_dll_pll_c_aid_tracking_sc>; | ||||
|  | ||||
| glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr | ||||
| glonass_l1_ca_dll_pll_c_aid_make_tracking_sc( | ||||
| @@ -130,7 +129,7 @@ private: | ||||
|     //gr_complex* d_correlator_outs; | ||||
|     lv_16sc_t* d_correlator_outs_16sc; | ||||
|     //cpu_multicorrelator multicorrelator_cpu; | ||||
|     cpu_multicorrelator_16sc multicorrelator_cpu_16sc; | ||||
|     Cpu_Multicorrelator_16sc multicorrelator_cpu_16sc; | ||||
|  | ||||
|     // remaining code phase and carrier phase between tracking loops | ||||
|     double d_rem_code_phase_samples; | ||||
|   | ||||
| @@ -38,7 +38,6 @@ | ||||
|  | ||||
| #include "glonass_l1_ca_dll_pll_tracking_cc.h" | ||||
| #include "GLONASS_L1_L2_CA.h" | ||||
| #include "control_message_factory.h" | ||||
| #include "glonass_l1_signal_processing.h" | ||||
| #include "gnss_sdr_flags.h" | ||||
| #include "lock_detectors.h" | ||||
| @@ -48,6 +47,7 @@ | ||||
| #include <matio.h> | ||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | ||||
| #include <cmath> | ||||
| #include <exception> | ||||
| #include <iostream> | ||||
| #include <memory> | ||||
| #include <sstream> | ||||
| @@ -279,7 +279,15 @@ Glonass_L1_Ca_Dll_Pll_Tracking_cc::~Glonass_L1_Ca_Dll_Pll_Tracking_cc() | ||||
|                 { | ||||
|                     std::cout << "Writing .mat files ..."; | ||||
|                 } | ||||
|             Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile(); | ||||
|             try | ||||
|                 { | ||||
|                     Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile(); | ||||
|                 } | ||||
|             catch (const std::exception &ex) | ||||
|                 { | ||||
|                     LOG(WARNING) << "Error saving the .mat file: " << ex.what(); | ||||
|                 } | ||||
|  | ||||
|             if (d_channel == 0) | ||||
|                 { | ||||
|                     std::cout << " done." << std::endl; | ||||
| @@ -566,7 +574,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut | ||||
|                     double acq_trk_shif_correction_samples; | ||||
|                     int32_t acq_to_trk_delay_samples; | ||||
|                     acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; | ||||
|                     acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples)); | ||||
|                     acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples)); | ||||
|                     samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); | ||||
|                     current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); | ||||
|                     d_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset);  // count for the processed samples | ||||
| @@ -659,7 +667,10 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut | ||||
|                         } | ||||
|                     else | ||||
|                         { | ||||
|                             if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; | ||||
|                             if (d_carrier_lock_fail_counter > 0) | ||||
|                                 { | ||||
|                                     d_carrier_lock_fail_counter--; | ||||
|                                 } | ||||
|                         } | ||||
|                     if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) | ||||
|                         { | ||||
|   | ||||
| @@ -50,8 +50,7 @@ | ||||
|  | ||||
| class Glonass_L1_Ca_Dll_Pll_Tracking_cc; | ||||
|  | ||||
| typedef boost::shared_ptr<Glonass_L1_Ca_Dll_Pll_Tracking_cc> | ||||
|     glonass_l1_ca_dll_pll_tracking_cc_sptr; | ||||
| using glonass_l1_ca_dll_pll_tracking_cc_sptr = boost::shared_ptr<Glonass_L1_Ca_Dll_Pll_Tracking_cc>; | ||||
|  | ||||
| glonass_l1_ca_dll_pll_tracking_cc_sptr | ||||
| glonass_l1_ca_dll_pll_make_tracking_cc( | ||||
| @@ -127,7 +126,7 @@ private: | ||||
|     gr_complex* d_ca_code; | ||||
|     float* d_local_code_shift_chips; | ||||
|     gr_complex* d_correlator_outs; | ||||
|     cpu_multicorrelator multicorrelator_cpu; | ||||
|     Cpu_Multicorrelator multicorrelator_cpu; | ||||
|  | ||||
|  | ||||
|     // tracking vars | ||||
|   | ||||
| @@ -36,7 +36,6 @@ | ||||
|  | ||||
| #include "glonass_l2_ca_dll_pll_c_aid_tracking_cc.h" | ||||
| #include "GLONASS_L1_L2_CA.h" | ||||
| #include "control_message_factory.h" | ||||
| #include "glonass_l2_signal_processing.h" | ||||
| #include "gnss_sdr_flags.h" | ||||
| #include "lock_detectors.h" | ||||
| @@ -48,6 +47,7 @@ | ||||
| #include <pmt/pmt.h> | ||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | ||||
| #include <cmath> | ||||
| #include <exception> | ||||
| #include <iostream> | ||||
| #include <memory> | ||||
| #include <sstream> | ||||
| @@ -323,7 +323,15 @@ glonass_l2_ca_dll_pll_c_aid_tracking_cc::~glonass_l2_ca_dll_pll_c_aid_tracking_c | ||||
|                 { | ||||
|                     std::cout << "Writing .mat files ..."; | ||||
|                 } | ||||
|             glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile(); | ||||
|             try | ||||
|                 { | ||||
|                     glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile(); | ||||
|                 } | ||||
|             catch (const std::exception &ex) | ||||
|                 { | ||||
|                     LOG(WARNING) << "Error saving the .mat file: " << ex.what(); | ||||
|                 } | ||||
|  | ||||
|             if (d_channel == 0) | ||||
|                 { | ||||
|                     std::cout << " done." << std::endl; | ||||
| @@ -798,7 +806,10 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at | ||||
|                                 } | ||||
|                             else | ||||
|                                 { | ||||
|                                     if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; | ||||
|                                     if (d_carrier_lock_fail_counter > 0) | ||||
|                                         { | ||||
|                                             d_carrier_lock_fail_counter--; | ||||
|                                         } | ||||
|                                 } | ||||
|                             if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) | ||||
|                                 { | ||||
|   | ||||
| @@ -51,8 +51,7 @@ | ||||
|  | ||||
| class glonass_l2_ca_dll_pll_c_aid_tracking_cc; | ||||
|  | ||||
| typedef boost::shared_ptr<glonass_l2_ca_dll_pll_c_aid_tracking_cc> | ||||
|     glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr; | ||||
| using glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr = boost::shared_ptr<glonass_l2_ca_dll_pll_c_aid_tracking_cc>; | ||||
|  | ||||
| glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr | ||||
| glonass_l2_ca_dll_pll_c_aid_make_tracking_cc( | ||||
| @@ -124,7 +123,7 @@ private: | ||||
|     gr_complex* d_ca_code; | ||||
|     float* d_local_code_shift_chips; | ||||
|     gr_complex* d_correlator_outs; | ||||
|     cpu_multicorrelator multicorrelator_cpu; | ||||
|     Cpu_Multicorrelator multicorrelator_cpu; | ||||
|  | ||||
|     // remaining code phase and carrier phase between tracking loops | ||||
|     double d_rem_code_phase_samples; | ||||
|   | ||||
| @@ -36,7 +36,6 @@ | ||||
|  | ||||
| #include "glonass_l2_ca_dll_pll_c_aid_tracking_sc.h" | ||||
| #include "GLONASS_L1_L2_CA.h" | ||||
| #include "control_message_factory.h" | ||||
| #include "glonass_l2_signal_processing.h" | ||||
| #include "gnss_sdr_flags.h" | ||||
| #include "lock_detectors.h" | ||||
| @@ -47,6 +46,7 @@ | ||||
| #include <matio.h> | ||||
| #include <pmt/pmt.h> | ||||
| #include <cmath> | ||||
| #include <exception> | ||||
| #include <iostream> | ||||
| #include <memory> | ||||
| #include <sstream> | ||||
| @@ -528,7 +528,15 @@ glonass_l2_ca_dll_pll_c_aid_tracking_sc::~glonass_l2_ca_dll_pll_c_aid_tracking_s | ||||
|                 { | ||||
|                     std::cout << "Writing .mat files ..."; | ||||
|                 } | ||||
|             glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile(); | ||||
|             try | ||||
|                 { | ||||
|                     glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile(); | ||||
|                 } | ||||
|             catch (const std::exception &ex) | ||||
|                 { | ||||
|                     LOG(WARNING) << "Error saving the .mat file: " << ex.what(); | ||||
|                 } | ||||
|  | ||||
|             if (d_channel == 0) | ||||
|                 { | ||||
|                     std::cout << " done." << std::endl; | ||||
| @@ -789,7 +797,10 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at | ||||
|                                 } | ||||
|                             else | ||||
|                                 { | ||||
|                                     if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; | ||||
|                                     if (d_carrier_lock_fail_counter > 0) | ||||
|                                         { | ||||
|                                             d_carrier_lock_fail_counter--; | ||||
|                                         } | ||||
|                                 } | ||||
|                             if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) | ||||
|                                 { | ||||
|   | ||||
| @@ -52,8 +52,7 @@ | ||||
|  | ||||
| class glonass_l2_ca_dll_pll_c_aid_tracking_sc; | ||||
|  | ||||
| typedef boost::shared_ptr<glonass_l2_ca_dll_pll_c_aid_tracking_sc> | ||||
|     glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr; | ||||
| using glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr = boost::shared_ptr<glonass_l2_ca_dll_pll_c_aid_tracking_sc>; | ||||
|  | ||||
| glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr | ||||
| glonass_l2_ca_dll_pll_c_aid_make_tracking_sc( | ||||
| @@ -128,7 +127,7 @@ private: | ||||
|     //gr_complex* d_correlator_outs; | ||||
|     lv_16sc_t* d_correlator_outs_16sc; | ||||
|     //cpu_multicorrelator multicorrelator_cpu; | ||||
|     cpu_multicorrelator_16sc multicorrelator_cpu_16sc; | ||||
|     Cpu_Multicorrelator_16sc multicorrelator_cpu_16sc; | ||||
|  | ||||
|     // remaining code phase and carrier phase between tracking loops | ||||
|     double d_rem_code_phase_samples; | ||||
|   | ||||
| @@ -38,7 +38,6 @@ | ||||
|  | ||||
| #include "glonass_l2_ca_dll_pll_tracking_cc.h" | ||||
| #include "GLONASS_L1_L2_CA.h" | ||||
| #include "control_message_factory.h" | ||||
| #include "glonass_l2_signal_processing.h" | ||||
| #include "gnss_sdr_flags.h" | ||||
| #include "lock_detectors.h" | ||||
| @@ -48,6 +47,7 @@ | ||||
| #include <matio.h> | ||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | ||||
| #include <cmath> | ||||
| #include <exception> | ||||
| #include <iostream> | ||||
| #include <memory> | ||||
| #include <sstream> | ||||
| @@ -279,7 +279,15 @@ Glonass_L2_Ca_Dll_Pll_Tracking_cc::~Glonass_L2_Ca_Dll_Pll_Tracking_cc() | ||||
|                 { | ||||
|                     std::cout << "Writing .mat files ..."; | ||||
|                 } | ||||
|             Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile(); | ||||
|             try | ||||
|                 { | ||||
|                     Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile(); | ||||
|                 } | ||||
|             catch (const std::exception &ex) | ||||
|                 { | ||||
|                     LOG(WARNING) << "Error saving the .mat file: " << ex.what(); | ||||
|                 } | ||||
|  | ||||
|             if (d_channel == 0) | ||||
|                 { | ||||
|                     std::cout << " done." << std::endl; | ||||
| @@ -566,7 +574,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut | ||||
|                     double acq_trk_shif_correction_samples; | ||||
|                     int32_t acq_to_trk_delay_samples; | ||||
|                     acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; | ||||
|                     acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples)); | ||||
|                     acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples)); | ||||
|                     samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); | ||||
|                     current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); | ||||
|                     d_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset);  // count for the processed samples | ||||
| @@ -659,7 +667,10 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut | ||||
|                         } | ||||
|                     else | ||||
|                         { | ||||
|                             if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; | ||||
|                             if (d_carrier_lock_fail_counter > 0) | ||||
|                                 { | ||||
|                                     d_carrier_lock_fail_counter--; | ||||
|                                 } | ||||
|                         } | ||||
|                     if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) | ||||
|                         { | ||||
|   | ||||
| @@ -48,8 +48,7 @@ | ||||
|  | ||||
| class Glonass_L2_Ca_Dll_Pll_Tracking_cc; | ||||
|  | ||||
| typedef boost::shared_ptr<Glonass_L2_Ca_Dll_Pll_Tracking_cc> | ||||
|     glonass_l2_ca_dll_pll_tracking_cc_sptr; | ||||
| using glonass_l2_ca_dll_pll_tracking_cc_sptr = boost::shared_ptr<Glonass_L2_Ca_Dll_Pll_Tracking_cc>; | ||||
|  | ||||
| glonass_l2_ca_dll_pll_tracking_cc_sptr | ||||
| glonass_l2_ca_dll_pll_make_tracking_cc( | ||||
| @@ -125,7 +124,7 @@ private: | ||||
|     gr_complex* d_ca_code; | ||||
|     float* d_local_code_shift_chips; | ||||
|     gr_complex* d_correlator_outs; | ||||
|     cpu_multicorrelator multicorrelator_cpu; | ||||
|     Cpu_Multicorrelator multicorrelator_cpu; | ||||
|  | ||||
|  | ||||
|     // tracking vars | ||||
|   | ||||
| @@ -30,7 +30,6 @@ | ||||
|  | ||||
| #include "gps_l1_ca_dll_pll_c_aid_tracking_cc.h" | ||||
| #include "GPS_L1_CA.h" | ||||
| #include "control_message_factory.h" | ||||
| #include "gnss_sdr_flags.h" | ||||
| #include "gps_sdr_signal_processing.h" | ||||
| #include "lock_detectors.h" | ||||
| @@ -41,6 +40,7 @@ | ||||
| #include <matio.h> | ||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | ||||
| #include <cmath> | ||||
| #include <exception> | ||||
| #include <iostream> | ||||
| #include <memory> | ||||
| #include <sstream> | ||||
| @@ -305,7 +305,15 @@ gps_l1_ca_dll_pll_c_aid_tracking_cc::~gps_l1_ca_dll_pll_c_aid_tracking_cc() | ||||
|                 { | ||||
|                     std::cout << "Writing .mat files ..."; | ||||
|                 } | ||||
|             gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile(); | ||||
|             try | ||||
|                 { | ||||
|                     gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile(); | ||||
|                 } | ||||
|             catch (const std::exception &ex) | ||||
|                 { | ||||
|                     LOG(WARNING) << "Error saving the .mat file: " << ex.what(); | ||||
|                 } | ||||
|  | ||||
|             if (d_channel == 0) | ||||
|                 { | ||||
|                     std::cout << " done." << std::endl; | ||||
| @@ -779,7 +787,10 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __attrib | ||||
|                                 } | ||||
|                             else | ||||
|                                 { | ||||
|                                     if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; | ||||
|                                     if (d_carrier_lock_fail_counter > 0) | ||||
|                                         { | ||||
|                                             d_carrier_lock_fail_counter--; | ||||
|                                         } | ||||
|                                 } | ||||
|                             if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) | ||||
|                                 { | ||||
|   | ||||
| @@ -51,8 +51,7 @@ | ||||
|  | ||||
| class gps_l1_ca_dll_pll_c_aid_tracking_cc; | ||||
|  | ||||
| typedef boost::shared_ptr<gps_l1_ca_dll_pll_c_aid_tracking_cc> | ||||
|     gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr; | ||||
| using gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr = boost::shared_ptr<gps_l1_ca_dll_pll_c_aid_tracking_cc>; | ||||
|  | ||||
| gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr | ||||
| gps_l1_ca_dll_pll_c_aid_make_tracking_cc( | ||||
| @@ -122,7 +121,7 @@ private: | ||||
|     gr_complex* d_ca_code; | ||||
|     float* d_local_code_shift_chips; | ||||
|     gr_complex* d_correlator_outs; | ||||
|     cpu_multicorrelator multicorrelator_cpu; | ||||
|     Cpu_Multicorrelator multicorrelator_cpu; | ||||
|  | ||||
|     // remaining code phase and carrier phase between tracking loops | ||||
|     double d_rem_code_phase_samples; | ||||
|   | ||||
| @@ -30,7 +30,6 @@ | ||||
|  | ||||
| #include "gps_l1_ca_dll_pll_c_aid_tracking_sc.h" | ||||
| #include "GPS_L1_CA.h" | ||||
| #include "control_message_factory.h" | ||||
| #include "gnss_sdr_flags.h" | ||||
| #include "gps_sdr_signal_processing.h" | ||||
| #include "lock_detectors.h" | ||||
| @@ -41,6 +40,7 @@ | ||||
| #include <matio.h> | ||||
| #include <pmt/pmt.h> | ||||
| #include <cmath> | ||||
| #include <exception> | ||||
| #include <iostream> | ||||
| #include <memory> | ||||
| #include <sstream> | ||||
| @@ -306,7 +306,15 @@ gps_l1_ca_dll_pll_c_aid_tracking_sc::~gps_l1_ca_dll_pll_c_aid_tracking_sc() | ||||
|                 { | ||||
|                     std::cout << "Writing .mat files ..."; | ||||
|                 } | ||||
|             gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile(); | ||||
|             try | ||||
|                 { | ||||
|                     gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile(); | ||||
|                 } | ||||
|             catch (const std::exception &ex) | ||||
|                 { | ||||
|                     LOG(WARNING) << "Error saving the .mat file: " << ex.what(); | ||||
|                 } | ||||
|  | ||||
|             if (d_channel == 0) | ||||
|                 { | ||||
|                     std::cout << " done." << std::endl; | ||||
| @@ -780,7 +788,10 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __attrib | ||||
|                                 } | ||||
|                             else | ||||
|                                 { | ||||
|                                     if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; | ||||
|                                     if (d_carrier_lock_fail_counter > 0) | ||||
|                                         { | ||||
|                                             d_carrier_lock_fail_counter--; | ||||
|                                         } | ||||
|                                 } | ||||
|                             if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) | ||||
|                                 { | ||||
|   | ||||
| @@ -52,8 +52,7 @@ | ||||
|  | ||||
| class gps_l1_ca_dll_pll_c_aid_tracking_sc; | ||||
|  | ||||
| typedef boost::shared_ptr<gps_l1_ca_dll_pll_c_aid_tracking_sc> | ||||
|     gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr; | ||||
| using gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr = boost::shared_ptr<gps_l1_ca_dll_pll_c_aid_tracking_sc>; | ||||
|  | ||||
| gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr | ||||
| gps_l1_ca_dll_pll_c_aid_make_tracking_sc( | ||||
| @@ -127,7 +126,7 @@ private: | ||||
|     //gr_complex* d_correlator_outs; | ||||
|     lv_16sc_t* d_correlator_outs_16sc; | ||||
|     //cpu_multicorrelator multicorrelator_cpu; | ||||
|     cpu_multicorrelator_16sc multicorrelator_cpu_16sc; | ||||
|     Cpu_Multicorrelator_16sc multicorrelator_cpu_16sc; | ||||
|  | ||||
|     // remaining code phase and carrier phase between tracking loops | ||||
|     double d_rem_code_phase_samples; | ||||
|   | ||||
| @@ -30,7 +30,6 @@ | ||||
|  | ||||
| #include "gps_l1_ca_dll_pll_tracking_gpu_cc.h" | ||||
| #include "GPS_L1_CA.h" | ||||
| #include "control_message_factory.h" | ||||
| #include "gnss_sdr_flags.h" | ||||
| #include "gps_sdr_signal_processing.h" | ||||
| #include "lock_detectors.h" | ||||
|   | ||||
| @@ -39,7 +39,6 @@ | ||||
|  | ||||
| #include "gps_l1_ca_kf_tracking_cc.h" | ||||
| #include "GPS_L1_CA.h" | ||||
| #include "control_message_factory.h" | ||||
| #include "gnss_sdr_flags.h" | ||||
| #include "gps_sdr_signal_processing.h" | ||||
| #include "lock_detectors.h" | ||||
| @@ -49,6 +48,7 @@ | ||||
| #include <matio.h> | ||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | ||||
| #include <cmath> | ||||
| #include <exception> | ||||
| #include <iostream> | ||||
| #include <memory> | ||||
| #include <sstream> | ||||
| @@ -375,7 +375,15 @@ Gps_L1_Ca_Kf_Tracking_cc::~Gps_L1_Ca_Kf_Tracking_cc() | ||||
|                 { | ||||
|                     std::cout << "Writing .mat files ..."; | ||||
|                 } | ||||
|             Gps_L1_Ca_Kf_Tracking_cc::save_matfile(); | ||||
|             try | ||||
|                 { | ||||
|                     Gps_L1_Ca_Kf_Tracking_cc::save_matfile(); | ||||
|                 } | ||||
|             catch (const std::exception &ex) | ||||
|                 { | ||||
|                     LOG(WARNING) << "Error saving the .mat file: " << ex.what(); | ||||
|                 } | ||||
|  | ||||
|             if (d_channel == 0) | ||||
|                 { | ||||
|                     std::cout << " done." << std::endl; | ||||
| @@ -842,7 +850,10 @@ int Gps_L1_Ca_Kf_Tracking_cc::general_work(int noutput_items __attribute__((unus | ||||
|                         } | ||||
|                     else | ||||
|                         { | ||||
|                             if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; | ||||
|                             if (d_carrier_lock_fail_counter > 0) | ||||
|                                 { | ||||
|                                     d_carrier_lock_fail_counter--; | ||||
|                                 } | ||||
|                         } | ||||
|                     if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) | ||||
|                         { | ||||
|   | ||||
| @@ -53,8 +53,7 @@ | ||||
|  | ||||
| class Gps_L1_Ca_Kf_Tracking_cc; | ||||
|  | ||||
| typedef boost::shared_ptr<Gps_L1_Ca_Kf_Tracking_cc> | ||||
|     gps_l1_ca_kf_tracking_cc_sptr; | ||||
| using gps_l1_ca_kf_tracking_cc_sptr = boost::shared_ptr<Gps_L1_Ca_Kf_Tracking_cc>; | ||||
|  | ||||
| gps_l1_ca_kf_tracking_cc_sptr | ||||
| gps_l1_ca_kf_make_tracking_cc(uint32_t order, | ||||
| @@ -62,7 +61,7 @@ gps_l1_ca_kf_make_tracking_cc(uint32_t order, | ||||
|     int64_t fs_in, uint32_t vector_length, | ||||
|     bool dump, | ||||
|     std::string dump_filename, | ||||
|     float pll_bw_hz, | ||||
|     float dll_bw_hz, | ||||
|     float early_late_space_chips, | ||||
|     bool bce_run, | ||||
|     uint32_t bce_ptrans, | ||||
| @@ -174,7 +173,7 @@ private: | ||||
|     float* d_ca_code; | ||||
|     float* d_local_code_shift_chips; | ||||
|     gr_complex* d_correlator_outs; | ||||
|     cpu_multicorrelator_real_codes multicorrelator_cpu; | ||||
|     Cpu_Multicorrelator_Real_Codes multicorrelator_cpu; | ||||
|  | ||||
|     // tracking vars | ||||
|     double d_code_freq_chips; | ||||
|   | ||||
| @@ -37,19 +37,17 @@ | ||||
|  | ||||
| #include "gps_l1_ca_tcp_connector_tracking_cc.h" | ||||
| #include "GPS_L1_CA.h" | ||||
| #include "control_message_factory.h" | ||||
| #include "gnss_sdr_flags.h" | ||||
| #include "gps_sdr_signal_processing.h" | ||||
| #include "lock_detectors.h" | ||||
| #include "tcp_communication.h" | ||||
| #include "tcp_packet_data.h" | ||||
| #include "tracking_discriminators.h" | ||||
| #include <boost/asio.hpp> | ||||
| #include <boost/lexical_cast.hpp> | ||||
| #include <glog/logging.h> | ||||
| #include <gnuradio/io_signature.h> | ||||
| #include <volk_gnsssdr/volk_gnsssdr.h> | ||||
| #include <cmath> | ||||
| #include <exception> | ||||
| #include <iostream> | ||||
| #include <sstream> | ||||
| #include <utility> | ||||
| @@ -206,7 +204,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking() | ||||
|     T_prn_mod_seconds = T_chip_mod_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS; | ||||
|     T_prn_mod_samples = T_prn_mod_seconds * static_cast<float>(d_fs_in); | ||||
|  | ||||
|     d_next_prn_length_samples = round(T_prn_mod_samples); | ||||
|     d_next_prn_length_samples = std::round(T_prn_mod_samples); | ||||
|  | ||||
|     float T_prn_true_seconds = GPS_L1_CA_CODE_LENGTH_CHIPS / GPS_L1_CA_CODE_RATE_HZ; | ||||
|     float T_prn_true_samples = T_prn_true_seconds * static_cast<float>(d_fs_in); | ||||
| @@ -215,7 +213,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking() | ||||
|     float N_prn_diff; | ||||
|     N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds; | ||||
|     float corrected_acq_phase_samples, delay_correction_samples; | ||||
|     corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<float>(d_fs_in)), T_prn_true_samples); | ||||
|     corrected_acq_phase_samples = std::fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<float>(d_fs_in)), T_prn_true_samples); | ||||
|     if (corrected_acq_phase_samples < 0) | ||||
|         { | ||||
|             corrected_acq_phase_samples = T_prn_mod_samples + corrected_acq_phase_samples; | ||||
| @@ -336,7 +334,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib | ||||
|     float code_error = 0.0; | ||||
|     float code_nco = 0.0; | ||||
|  | ||||
|     tcp_packet_data tcp_data; | ||||
|     Tcp_Packet_Data tcp_data; | ||||
|     // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder | ||||
|     Gnss_Synchro current_synchro_data = Gnss_Synchro(); | ||||
|  | ||||
| @@ -359,8 +357,8 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib | ||||
|                     float acq_trk_shif_correction_samples; | ||||
|                     int32_t acq_to_trk_delay_samples; | ||||
|                     acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; | ||||
|                     acq_trk_shif_correction_samples = d_next_prn_length_samples - fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_next_prn_length_samples)); | ||||
|                     samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); | ||||
|                     acq_trk_shif_correction_samples = d_next_prn_length_samples - std::fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_next_prn_length_samples)); | ||||
|                     samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); | ||||
|                     current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); | ||||
|                     current_synchro_data.fs = d_fs_in; | ||||
|                     *out[0] = current_synchro_data; | ||||
| @@ -463,7 +461,10 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib | ||||
|                         } | ||||
|                     else | ||||
|                         { | ||||
|                             if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; | ||||
|                             if (d_carrier_lock_fail_counter > 0) | ||||
|                                 { | ||||
|                                     d_carrier_lock_fail_counter--; | ||||
|                                 } | ||||
|                         } | ||||
|                     if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) | ||||
|                         { | ||||
|   | ||||
| @@ -48,7 +48,7 @@ | ||||
|  | ||||
| class Gps_L1_Ca_Tcp_Connector_Tracking_cc; | ||||
|  | ||||
| typedef boost::shared_ptr<Gps_L1_Ca_Tcp_Connector_Tracking_cc> gps_l1_ca_tcp_connector_tracking_cc_sptr; | ||||
| using gps_l1_ca_tcp_connector_tracking_cc_sptr = boost::shared_ptr<Gps_L1_Ca_Tcp_Connector_Tracking_cc>; | ||||
|  | ||||
| gps_l1_ca_tcp_connector_tracking_cc_sptr | ||||
| gps_l1_ca_tcp_connector_make_tracking_cc( | ||||
| @@ -128,7 +128,7 @@ private: | ||||
|     // correlator | ||||
|     float *d_local_code_shift_chips; | ||||
|     gr_complex *d_correlator_outs; | ||||
|     cpu_multicorrelator multicorrelator_cpu; | ||||
|     Cpu_Multicorrelator multicorrelator_cpu; | ||||
|  | ||||
|     // tracking vars | ||||
|     double d_code_freq_hz; | ||||
| @@ -139,7 +139,7 @@ private: | ||||
|     size_t d_port; | ||||
|     int32_t d_listen_connection; | ||||
|     float d_control_id; | ||||
|     tcp_communication d_tcp_com; | ||||
|     Tcp_Communication d_tcp_com; | ||||
|  | ||||
|     //PRN period in samples | ||||
|     int32_t d_current_prn_length_samples; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Damian Miralles
					Damian Miralles