From c5b3e7597a1ed5d0a1be626023109f6c8ecd77d4 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 17 Aug 2019 14:41:32 +0200 Subject: [PATCH] Remove tabs --- .../supl/asn-rrlp/UncompressedEphemeris.h | 4 +- src/core/libs/supl/asn-rrlp/asn_system.h | 4 +- src/core/libs/supl/asn-supl/AltitudeInfo.h | 2 +- .../libs/supl/asn-supl/PositionEstimate.h | 2 +- src/core/libs/supl/asn-supl/asn_system.h | 4 +- src/tests/common-files/gnuplot_i.h | 4 +- .../hybrid_observables_test_fpga.cc | 59 +++++++------------ 7 files changed, 30 insertions(+), 49 deletions(-) diff --git a/src/core/libs/supl/asn-rrlp/UncompressedEphemeris.h b/src/core/libs/supl/asn-rrlp/UncompressedEphemeris.h index d994f4805..c3d751b3f 100644 --- a/src/core/libs/supl/asn-rrlp/UncompressedEphemeris.h +++ b/src/core/libs/supl/asn-rrlp/UncompressedEphemeris.h @@ -58,8 +58,8 @@ extern "C" } UncompressedEphemeris_t; /* Implementation */ - /* extern asn_TYPE_descriptor_t asn_DEF_ephemE_17; // (Use -fall-defs-global to expose) */ - /* extern asn_TYPE_descriptor_t asn_DEF_ephemAPowerHalf_19; // (Use -fall-defs-global to expose) */ + /* extern asn_TYPE_descriptor_t asn_DEF_ephemE_17; // (Use -fall-defs-global to expose) */ + /* extern asn_TYPE_descriptor_t asn_DEF_ephemAPowerHalf_19; // (Use -fall-defs-global to expose) */ extern asn_TYPE_descriptor_t asn_DEF_UncompressedEphemeris; #ifdef __cplusplus diff --git a/src/core/libs/supl/asn-rrlp/asn_system.h b/src/core/libs/supl/asn-rrlp/asn_system.h index 1d2958174..4c175d3d3 100644 --- a/src/core/libs/supl/asn-rrlp/asn_system.h +++ b/src/core/libs/supl/asn-rrlp/asn_system.h @@ -116,8 +116,8 @@ typedef unsigned int uint32_t; #ifndef MIN /* Suitable for comparing primitive types (integers) */ #if defined(__GNUC__) -#define MIN(a, b) ({ __typeof a _a = a; __typeof b _b = b; \ - ((_a)<(_b)?(_a):(_b)); }) +#define MIN(a, b) ({ __typeof a _a = a; __typeof b _b = b; \ + ((_a)<(_b)?(_a):(_b)); }) #else /* !__GNUC__ */ #define MIN(a, b) ((a) < (b) ? (a) : (b)) /* Unsafe variant */ #endif /* __GNUC__ */ diff --git a/src/core/libs/supl/asn-supl/AltitudeInfo.h b/src/core/libs/supl/asn-supl/AltitudeInfo.h index 117da26e2..694d7c6db 100644 --- a/src/core/libs/supl/asn-supl/AltitudeInfo.h +++ b/src/core/libs/supl/asn-supl/AltitudeInfo.h @@ -43,7 +43,7 @@ extern "C" } AltitudeInfo_t; /* Implementation */ - /* extern asn_TYPE_descriptor_t asn_DEF_altitudeDirection_2; // (Use -fall-defs-global to expose) */ + /* extern asn_TYPE_descriptor_t asn_DEF_altitudeDirection_2; // (Use -fall-defs-global to expose) */ extern asn_TYPE_descriptor_t asn_DEF_AltitudeInfo; #ifdef __cplusplus diff --git a/src/core/libs/supl/asn-supl/PositionEstimate.h b/src/core/libs/supl/asn-supl/PositionEstimate.h index d4d48ae55..8f8a1d589 100644 --- a/src/core/libs/supl/asn-supl/PositionEstimate.h +++ b/src/core/libs/supl/asn-supl/PositionEstimate.h @@ -57,7 +57,7 @@ extern "C" } PositionEstimate_t; /* Implementation */ - /* extern asn_TYPE_descriptor_t asn_DEF_latitudeSign_2; // (Use -fall-defs-global to expose) */ + /* extern asn_TYPE_descriptor_t asn_DEF_latitudeSign_2; // (Use -fall-defs-global to expose) */ extern asn_TYPE_descriptor_t asn_DEF_PositionEstimate; #ifdef __cplusplus diff --git a/src/core/libs/supl/asn-supl/asn_system.h b/src/core/libs/supl/asn-supl/asn_system.h index 1d2958174..4c175d3d3 100644 --- a/src/core/libs/supl/asn-supl/asn_system.h +++ b/src/core/libs/supl/asn-supl/asn_system.h @@ -116,8 +116,8 @@ typedef unsigned int uint32_t; #ifndef MIN /* Suitable for comparing primitive types (integers) */ #if defined(__GNUC__) -#define MIN(a, b) ({ __typeof a _a = a; __typeof b _b = b; \ - ((_a)<(_b)?(_a):(_b)); }) +#define MIN(a, b) ({ __typeof a _a = a; __typeof b _b = b; \ + ((_a)<(_b)?(_a):(_b)); }) #else /* !__GNUC__ */ #define MIN(a, b) ((a) < (b) ? (a) : (b)) /* Unsafe variant */ #endif /* __GNUC__ */ diff --git a/src/tests/common-files/gnuplot_i.h b/src/tests/common-files/gnuplot_i.h index a240fe53e..213889ee0 100644 --- a/src/tests/common-files/gnuplot_i.h +++ b/src/tests/common-files/gnuplot_i.h @@ -148,7 +148,7 @@ private: ///\brief checks if file is available /// /// \param filename --> the filename - /// \param mode --> the mode [optional,default value = 0] + /// \param mode --> the mode [optional,default value = 0] /// /// \return file exists (yes == true, no == false) // --------------------------------------------------------------------------------- @@ -158,7 +158,7 @@ private: ///\brief checks if file exists /// /// \param filename --> the filename - /// \param mode --> the mode [optional,default value = 0] + /// \param mode --> the mode [optional,default value = 0] /// /// \return file exists (yes == true, no == false) // --------------------------------------------------------------------------------- diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc index be6583874..fd5c55470 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc @@ -615,7 +615,6 @@ bool HybridObservablesTestFpga::acquire_signal() int acq_doppler_max = config->property("Acquisition.doppler_max", FLAGS_external_signal_acquisition_doppler_max_hz); int acq_doppler_step = config->property("Acquisition.doppler_step", FLAGS_external_signal_acquisition_doppler_step_hz); - for (unsigned int PRN = 1; PRN < MAX_PRN_IDX; PRN++) { tmp_gnss_synchro.PRN = PRN; @@ -709,7 +708,6 @@ bool HybridObservablesTestFpga::acquire_signal() tmp_gnss_synchro.Acq_samplestamp_samples = 0; // do not take into account the filter internal state initialisation tmp_gnss_synchro.Acq_samplestamp_samples = tmp_gnss_synchro.Acq_samplestamp_samples; // delay due to the downsampling filter in the acquisition - gnss_synchro_vec.push_back(tmp_gnss_synchro); } else @@ -717,10 +715,7 @@ bool HybridObservablesTestFpga::acquire_signal() std::cout << " . "; } - top_block->stop(); - - std::cout.flush(); } std::cout << "]" << std::endl; @@ -857,6 +852,7 @@ void HybridObservablesTestFpga::configure_receiver( std::cout << "*****************************************\n"; } + void HybridObservablesTestFpga::check_results_carrier_phase( arma::mat& true_ch0, arma::vec& true_tow_s, @@ -1195,6 +1191,7 @@ void HybridObservablesTestFpga::check_results_carrier_doppler( ASSERT_LT(rmse_ch0, 30); } + bool HybridObservablesTestFpga::save_mat_xy(std::vector& x, std::vector& y, std::string filename) { try @@ -1230,6 +1227,7 @@ bool HybridObservablesTestFpga::save_mat_xy(std::vector& x, std::vector< } } + void HybridObservablesTestFpga::check_results_code_pseudorange( arma::mat& true_ch0, arma::mat& true_ch1, @@ -1319,6 +1317,7 @@ void HybridObservablesTestFpga::check_results_code_pseudorange( ASSERT_GT(min_error, -10.0); } + bool HybridObservablesTestFpga::ReadRinexObs(std::vector* obs_vec, Gnss_Synchro gnss) { // Open and read reference RINEX observables file @@ -1459,6 +1458,8 @@ bool HybridObservablesTestFpga::ReadRinexObs(std::vector* obs_vec, Gn } return true; } + + TEST_F(HybridObservablesTestFpga, ValidationOfResults) { // pointer to the DMA thread that sends the samples to the acquisition engine @@ -1475,7 +1476,6 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) generate_signal(); } - std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); @@ -1556,7 +1556,6 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) } } - // The HW has been reset after the acquisition phase when the acquisition class was destroyed. // No more samples remained in the DMA. Therefore any intermediate state in the LPF of the // GPS L1 / Galileo E1 filter has been cleared. @@ -1567,7 +1566,6 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) // instantiate the acquisition modules in order to use them to reset the HW. // (note that the constructor of the acquisition modules resets the HW too) - std::shared_ptr acquisition; // reset the HW to clear the sample counters: the acquisition constructor generates a reset @@ -1597,18 +1595,16 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) throw(std::exception()); } - std::vector> tracking_ch_vec; std::vector> tlm_ch_vec; std::vector null_sink_vec; for (unsigned int n = 0; n < gnss_synchro_vec.size(); n++) { - //set channels ids + // set channels ids gnss_synchro_vec.at(n).Channel_ID = n; - //create the tracking channels and create the telemetry decoders - + // create the tracking channels and create the telemetry decoders std::shared_ptr trk_ = factory->GetBlock(config, "Tracking", config->property("Tracking.implementation", std::string("undefined")), 1, 1); tracking_ch_vec.push_back(std::dynamic_pointer_cast(trk_)); std::shared_ptr tlm_ = factory->GetBlock(config, "TelemetryDecoder", config->property("TelemetryDecoder.implementation", std::string("undefined")), 1, 1); @@ -1673,7 +1669,6 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) gnss_sdr_fpga_sample_counter_sptr ch_out_fpga_sample_counter; ch_out_fpga_sample_counter = gnss_sdr_make_fpga_sample_counter(fs, observable_interval_ms); - for (unsigned int n = 0; n < tracking_ch_vec.size(); n++) { //top_block->connect(gr_interleaved_char_to_complex, 0, tracking_ch_vec.at(n)->get_left_block(), 0); @@ -1687,10 +1682,8 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) top_block->connect(ch_out_fpga_sample_counter, 0, observables->get_left_block(), tracking_ch_vec.size()); //extra port for the sample counter pulse }) << "Failure connecting the blocks."; - args.file = file; args.nsamples_tx = baseband_sampling_freq * FLAGS_duration; - ; args.skip_used_samples = 0; @@ -1699,7 +1692,6 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) std::cout << "ERROR cannot create DMA Process" << std::endl; } - for (auto& n : tracking_ch_vec) { n->start_tracking(); @@ -1709,10 +1701,8 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) send_samples_start_obs_test = 1; pthread_mutex_unlock(&mutex_obs_test); - top_block->start(); - EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); //top_block->run(); // Start threads and wait @@ -1720,30 +1710,25 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) elapsed_seconds = end - start; }) << "Failure running the top_block."; - // wait for the child DMA process to finish pthread_join(thread_DMA, nullptr); - top_block->stop(); - // reset the HW AGAIN acquisition->stop_acquisition(); + // pthread_mutex_lock(&mutex_obs_test); + // send_samples_start_obs_test = 0; + // pthread_mutex_unlock(&mutex_obs_test); - // pthread_mutex_lock(&mutex_obs_test); - // send_samples_start_obs_test = 0; - // pthread_mutex_unlock(&mutex_obs_test); - - - //check results + // check results // Matrices for storing columnwise true GPS time, Range, Doppler and Carrier phase std::vector true_obs_vec; if (!FLAGS_enable_external_signal_file) { - //load the true values + // load the true values True_Observables_Reader true_observables; ASSERT_NO_THROW({ if (true_observables.open_obs_file(std::string("./obs_out.bin")) == false) @@ -1789,8 +1774,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) << "Failure reading RINEX file"; } - - //read measured values + // read measured values Observables_Dump_Reader estimated_observables(tracking_ch_vec.size()); ASSERT_NO_THROW({ if (estimated_observables.open_obs_file(std::string("./observables.dat")) == false) @@ -1828,8 +1812,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) } } - - //Cut measurement tail zeros + // Cut measurement tail zeros arma::uvec index; for (auto& n : measured_obs_vec) { @@ -1840,7 +1823,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) } } - //Cut measurement initial transitory of the measurements + // Cut measurement initial transitory of the measurements double initial_transitory_s = FLAGS_skip_obs_transitory_s; @@ -1859,12 +1842,11 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) } } + // Correct the clock error using true values (it is not possible for a receiver to correct + // the receiver clock offset error at the observables level because it is required the + // decoding of the ephemeris data and solve the PVT equations) - //Correct the clock error using true values (it is not possible for a receiver to correct - //the receiver clock offset error at the observables level because it is required the - //decoding of the ephemeris data and solve the PVT equations) - - //Find the reference satellite (the nearest) and compute the receiver time offset at observable level + // Find the reference satellite (the nearest) and compute the receiver time offset at observable level double min_pr = std::numeric_limits::max(); unsigned int min_pr_ch_id = 0; for (unsigned int n = 0; n < measured_obs_vec.size(); n++) @@ -1969,6 +1951,5 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) } } - std::cout << "Test completed in " << elapsed_seconds.count() << " [s]" << std::endl; }