diff --git a/src/algorithms/PVT/adapters/galileo_e1_pvt.h b/src/algorithms/PVT/adapters/galileo_e1_pvt.h index a3993563d..e8f622253 100644 --- a/src/algorithms/PVT/adapters/galileo_e1_pvt.h +++ b/src/algorithms/PVT/adapters/galileo_e1_pvt.h @@ -86,7 +86,7 @@ public: private: galileo_e1_pvt_cc_sptr pvt_; bool dump_; - unsigned int fs_in_; + //unsigned int fs_in_; std::string dump_filename_; std::string role_; unsigned int in_streams_; diff --git a/src/algorithms/PVT/adapters/gps_l1_ca_pvt.h b/src/algorithms/PVT/adapters/gps_l1_ca_pvt.h index 63d040456..1497247da 100644 --- a/src/algorithms/PVT/adapters/gps_l1_ca_pvt.h +++ b/src/algorithms/PVT/adapters/gps_l1_ca_pvt.h @@ -88,7 +88,6 @@ public: private: gps_l1_ca_pvt_cc_sptr pvt_; bool dump_; - unsigned int fs_in_; std::string dump_filename_; std::string role_; unsigned int in_streams_; diff --git a/src/algorithms/PVT/adapters/hybrid_pvt.h b/src/algorithms/PVT/adapters/hybrid_pvt.h index 4bcf7fcb4..ae2b6ad7f 100644 --- a/src/algorithms/PVT/adapters/hybrid_pvt.h +++ b/src/algorithms/PVT/adapters/hybrid_pvt.h @@ -86,7 +86,6 @@ public: private: hybrid_pvt_cc_sptr pvt_; bool dump_; - unsigned int fs_in_; std::string dump_filename_; std::string role_; unsigned int in_streams_; diff --git a/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc index 76b1eb41d..e991f5d95 100644 --- a/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc @@ -121,7 +121,7 @@ galileo_e1_pvt_cc::~galileo_e1_pvt_cc() -bool galileo_e1_pvt_cc::pseudoranges_pairCompare_min( std::pair a, std::pair b) +bool galileo_e1_pvt_cc::pseudoranges_pairCompare_min(const std::pair& a, const std::pair& b) { return (a.second.Pseudorange_m) < (b.second.Pseudorange_m); } diff --git a/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.h index 49952afa0..2dfd1d975 100644 --- a/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.h @@ -111,7 +111,7 @@ private: std::shared_ptr d_nmea_printer; double d_rx_time; std::shared_ptr d_ls_pvt; - bool pseudoranges_pairCompare_min(std::pair a, std::pair b); + bool pseudoranges_pairCompare_min(const std::pair& a, const std::pair& b); public: ~galileo_e1_pvt_cc (); //!< Default destructor diff --git a/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.cc index cae5e0b2b..7ad3e2dea 100644 --- a/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.cc @@ -136,7 +136,7 @@ gps_l1_ca_pvt_cc::~gps_l1_ca_pvt_cc() -bool pseudoranges_pairCompare_min( std::pair a, std::pair b) +bool pseudoranges_pairCompare_min(const std::pair& a, const std::pair& b) { return (a.second.Pseudorange_m) < (b.second.Pseudorange_m); } diff --git a/src/algorithms/PVT/gnuradio_blocks/hybrid_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/hybrid_pvt_cc.cc index d9d31b5d6..35024293b 100644 --- a/src/algorithms/PVT/gnuradio_blocks/hybrid_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/hybrid_pvt_cc.cc @@ -93,7 +93,6 @@ hybrid_pvt_cc::hybrid_pvt_cc(unsigned int nchannels, boost::shared_ptrset_averaging_depth(d_averaging_depth); d_sample_counter = 0; - valid_solution_counter = 0; d_last_sample_nav_output = 0; d_rx_time = 0.0; d_TOW_at_curr_symbol_constellation = 0.0; @@ -127,7 +126,7 @@ hybrid_pvt_cc::~hybrid_pvt_cc() -bool hybrid_pvt_cc::pseudoranges_pairCompare_min( std::pair a, std::pair b) +bool hybrid_pvt_cc::pseudoranges_pairCompare_min(const std::pair& a, const std::pair& b) { return (a.second.Pseudorange_m) < (b.second.Pseudorange_m); } diff --git a/src/algorithms/PVT/gnuradio_blocks/hybrid_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/hybrid_pvt_cc.h index dad4a2256..2ac6b1eb0 100644 --- a/src/algorithms/PVT/gnuradio_blocks/hybrid_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/hybrid_pvt_cc.h @@ -110,15 +110,13 @@ private: int d_output_rate_ms; int d_display_rate_ms; long unsigned int d_sample_counter; - long unsigned int valid_solution_counter; - long unsigned int valid_solution_16_sat_counter; long unsigned int d_last_sample_nav_output; std::shared_ptr d_kml_dump; std::shared_ptr d_nmea_printer; double d_rx_time; double d_TOW_at_curr_symbol_constellation; std::shared_ptr d_ls_pvt; - bool pseudoranges_pairCompare_min(std::pair a, std::pair b); + bool pseudoranges_pairCompare_min(const std::pair& a, const std::pair& b); public: ~hybrid_pvt_cc (); //!< Default destructor diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 75020c30f..a65142a0d 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -173,7 +173,9 @@ Rinex_Printer::Rinex_Printer() } else { - LOG(ERROR) << "Unknown RINEX version " << FLAGS_RINEX_version << " (must be 2.11 or 3.02)" << std::endl; + LOG(WARNING) << "Unknown RINEX version " << FLAGS_RINEX_version << " (must be 2.11 or 3.02). Using 3.02"; + version = 3; + stringVersion = "3.02"; } numberTypesObservations = 4; // Number of available types of observable in the system @@ -197,23 +199,23 @@ Rinex_Printer::~Rinex_Printer() // If nothing written, erase the files. if (posn == 0) { - remove(navfilename.c_str()); + if(remove(navfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } if (poso == 0) { - remove(obsfilename.c_str()); + if(remove(obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } if (poss == 0) { - remove(sbsfilename.c_str()); + if(remove(sbsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } if (posng == 0) { - remove(navGalfilename.c_str()); + if(remove(navGalfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } if (posmn == 0) { - remove(navMixfilename.c_str()); + if(remove(navMixfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc index 234859b1a..22f169980 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -117,6 +117,10 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( // LOG(WARNING) << item_type_ // << " unknown acquisition item type"; // } + channel_ = 0; + threshold_ = 0.0; + doppler_max_ = 0; + doppler_step_ = 0; } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc index ef3e6ce7b..bc6d5c07d 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc @@ -85,6 +85,12 @@ pcps_acquisition_cc::pcps_acquisition_cc( d_input_power = 0.0; d_num_doppler_bins = 0; d_bit_transition_flag = bit_transition_flag; + d_threshold = 0.0; + d_doppler_step = 250; + d_code_phase = 0; + d_test_statistics = 0.0; + d_channel = 0; + d_doppler_freq = 0.0; d_fft_codes = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); d_magnitude = static_cast(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); @@ -138,15 +144,7 @@ void pcps_acquisition_cc::init() d_mag = 0.0; d_input_power = 0.0; - d_num_doppler_bins=ceil((static_cast(d_doppler_max)-static_cast(-d_doppler_max))/d_doppler_step); - // Count the number of bins -// d_num_doppler_bins = 0; -// for (int doppler = static_cast(-d_doppler_max); -// doppler <= static_cast(d_doppler_max); -// doppler += d_doppler_step) -// { -// d_num_doppler_bins++; -// } + d_num_doppler_bins = ceil( static_cast(static_cast(d_doppler_max) - static_cast(-d_doppler_max)) / static_cast(d_doppler_step)); // Create the carrier Doppler wipeoff signals d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.h index a0f7674e3..168e62cf6 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.h @@ -105,7 +105,7 @@ private: long d_freq; int d_samples_per_ms; int d_samples_per_code; - unsigned int d_doppler_resolution; + //unsigned int d_doppler_resolution; float d_threshold; std::string d_satellite_str; unsigned int d_doppler_max; diff --git a/src/tests/test_main.cc b/src/tests/test_main.cc index 538e90349..f10e93966 100644 --- a/src/tests/test_main.cc +++ b/src/tests/test_main.cc @@ -153,8 +153,17 @@ concurrent_map global_sbas_ephemeris_map; int main(int argc, char **argv) { std::cout << "Running GNSS-SDR Tests..." << std::endl; - testing::InitGoogleTest(&argc, argv); - google::ParseCommandLineFlags(&argc, &argv, true); - google::InitGoogleLogging(argv[0]); - return RUN_ALL_TESTS(); + try + { + testing::InitGoogleTest(&argc, argv); + google::ParseCommandLineFlags(&argc, &argv, true); + google::InitGoogleLogging(argv[0]); + return RUN_ALL_TESTS(); + } + catch(const testing::internal::GoogleTestFailureException& e) + { + std::cout << e.what() << std::endl; + } + catch(...) + {} }