diff --git a/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.cc b/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.cc index c9e6634cf..ba7a804a5 100644 --- a/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.cc +++ b/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.cc @@ -286,7 +286,9 @@ bool gps_l1_ca_ls_pvt::get_PVT(std::map gnss_pseudoranges_ // Compute UTC time and print PVT solution boost::posix_time::time_duration t = boost::posix_time::seconds(utc + 604800*(double)GPS_week); boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); - std::cout << "Position at " << boost::posix_time::to_simple_string(p_time) <<" is Lat = " << d_latitude_d << " [deg] Long = " << d_longitude_d << " [deg] Height= " << d_height_m << " [m]" << std::endl; + std::cout << "Position at " << boost::posix_time::to_simple_string(p_time) + << " is Lat = " << d_latitude_d << " [deg], Long = " << d_longitude_d + << " [deg], Height= " << d_height_m << " [m]" << std::endl; // ######## LOG FILE ######### if(d_flag_dump_enabled == true) { diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index 12a68c0ae..b7b531769 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -173,7 +173,7 @@ void Channel::set_satellite(Gnss_Satellite satellite) gnss_satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); acq_->set_satellite(gnss_satellite_); trk_->set_satellite(gnss_satellite_); - nav_->set_satellite(satellite.get_PRN()); + nav_->set_satellite(gnss_satellite_); } diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc index 1df48aafb..b880a0640 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc @@ -81,6 +81,14 @@ GpsL1CaTelemetryDecoder::~GpsL1CaTelemetryDecoder() {} +void GpsL1CaTelemetryDecoder::set_satellite(Gnss_Satellite satellite) +{ + satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + telemetry_decoder_->set_satellite(satellite_); + DLOG(INFO) << "TELEMETRY DECODER: satellite set to " << satellite_; +} + + void GpsL1CaTelemetryDecoder::connect(gr_top_block_sptr top_block) { // Nothing to connect internally diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.h index cd052952a..f45a284cc 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.h @@ -69,7 +69,7 @@ public: gr_basic_block_sptr get_left_block(); gr_basic_block_sptr get_right_block(); - void set_satellite(int satellite){telemetry_decoder_->set_satellite(satellite);}; + void set_satellite(Gnss_Satellite satellite); void set_channel(int channel){telemetry_decoder_->set_channel(channel);}; void reset() @@ -85,7 +85,7 @@ private: gps_l1_ca_telemetry_decoder_cc_sptr telemetry_decoder_; - int satellite_; + Gnss_Satellite satellite_; int channel_; unsigned int vector_length_; std::string item_type_; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc index ed1544c20..5c88cc8c0 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc @@ -50,7 +50,7 @@ using google::LogMessage; * \todo name and move the magic numbers to GPS_L1_CA.h */ gps_l1_ca_telemetry_decoder_cc_sptr -gps_l1_ca_make_telemetry_decoder_cc(unsigned int satellite, long if_freq, long fs_in, unsigned +gps_l1_ca_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned int vector_length, gr_msg_queue_sptr queue, bool dump) { @@ -70,7 +70,7 @@ void gps_l1_ca_telemetry_decoder_cc::forecast (int noutput_items, gr_vector_int -gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc(unsigned int satellite, long if_freq, long fs_in, unsigned +gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned int vector_length, gr_msg_queue_sptr queue, bool dump) : gr_block ("gps_navigation_cc", gr_make_io_signature (5, 5, sizeof(double)), gr_make_io_signature(1, 1, sizeof(gnss_synchro))) @@ -78,7 +78,8 @@ gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc(unsigned int sate // initialize internal vars d_queue = queue; d_dump = dump; - d_satellite = satellite; + d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + DLOG(INFO) << "TELEMETRY PROCESSING: satellite " << d_satellite; d_vector_length = vector_length; d_samples_per_bit = ( GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS ) / GPS_CA_TELEMETRY_RATE_BITS_SECOND; d_fs_in = fs_in; @@ -170,6 +171,8 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i gnss_synchro **out = (gnss_synchro **) &output_items[0]; d_sample_counter++; //count for the processed samples + DLOG(INFO) << "Sample counter: " << d_sample_counter; + const double **in = (const double **) &input_items[0]; //Get the input samples pointer // ########### Output the tracking data to navigation and PVT ########## // Output channel 0: Prompt correlator output Q @@ -219,7 +222,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i { d_GPS_FSM.Event_gps_word_preamble(); d_preamble_index = d_sample_counter;//record the preamble sample stamp - std::cout << "Preamble detection for SAT " << d_satellite << std::endl; + std::cout << "Preamble detection for SAT " << this->d_satellite << std::endl; d_symbol_accumulator = 0; //sync the symbol to bits integrator d_symbol_accumulator_counter = 0; d_frame_bit_index = 8; @@ -239,7 +242,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i if (!d_flag_frame_sync) { d_flag_frame_sync = true; - std::cout <<" Frame sync SAT " << d_satellite << " with preamble start at " << d_preamble_time_seconds << " [s]" << std::endl; + std::cout <<" Frame sync SAT " << this->d_satellite << " with preamble start at " << d_preamble_time_seconds << " [s]" << std::endl; } } } @@ -320,26 +323,27 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i // output the frame consume_each(1); //one by one + DLOG(INFO) << "TELEMETRY PROCESSED for satellite " << this->d_satellite; - - //! \todo This has to be documented and included in the header!!!! + //! \todo This has to be documented!!!! gps_synchro.valid_word = (d_flag_frame_sync == true and d_flag_parity == true); gps_synchro.flag_preamble = d_flag_preamble; gps_synchro.preamble_delay_ms = d_preamble_time_seconds*1000.0; gps_synchro.prn_delay_ms = (in[2][0] - d_preamble_duration_seconds)*1000.0; gps_synchro.preamble_code_phase_ms = d_preamble_code_phase_seconds*1000.0; gps_synchro.preamble_code_phase_correction_ms = (in[4][0] - d_preamble_code_phase_seconds)*1000.0; - gps_synchro.satellite_PRN = d_satellite; + gps_synchro.satellite_PRN = this->d_satellite.get_PRN(); gps_synchro.channel_ID = d_channel; *out[0] = gps_synchro; return 1; } -void gps_l1_ca_telemetry_decoder_cc::set_satellite(int satellite) +void gps_l1_ca_telemetry_decoder_cc::set_satellite(Gnss_Satellite satellite) { - d_satellite = satellite; - d_GPS_FSM.i_satellite_PRN = satellite; + d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + LOG_AT_LEVEL(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; + d_GPS_FSM.i_satellite_PRN = d_satellite.get_PRN(); LOG_AT_LEVEL(INFO) << "Navigation Satellite set to " << d_satellite; } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h index fd6906e1a..c67e642a7 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h @@ -40,6 +40,7 @@ #include #include //#include +#include "gnss_satellite.h" @@ -48,7 +49,7 @@ class gps_l1_ca_telemetry_decoder_cc; typedef boost::shared_ptr gps_l1_ca_telemetry_decoder_cc_sptr; gps_l1_ca_telemetry_decoder_cc_sptr -gps_l1_ca_make_telemetry_decoder_cc(unsigned int satellite, long if_freq, long fs_in, unsigned +gps_l1_ca_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned int vector_length, gr_msg_queue_sptr queue, bool dump); /*! @@ -61,8 +62,8 @@ public: ~gps_l1_ca_telemetry_decoder_cc(); - void set_satellite(int satellite); //!< Set satellite PRN - void set_channel(int channel); //!< Set receiver's channel + void set_satellite(Gnss_Satellite satellite); //!< Set satellite PRN + void set_channel(int channel); //!< Set receiver's channel /*! * \brief Set the navigation queue @@ -78,10 +79,10 @@ public: private: friend gps_l1_ca_telemetry_decoder_cc_sptr - gps_l1_ca_make_telemetry_decoder_cc(unsigned int satellite, long if_freq, long fs_in,unsigned + gps_l1_ca_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in,unsigned int vector_length, gr_msg_queue_sptr queue, bool dump); - gps_l1_ca_telemetry_decoder_cc(unsigned int satellite, long if_freq, long fs_in,unsigned + gps_l1_ca_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in,unsigned int vector_length, gr_msg_queue_sptr queue, bool dump); bool gps_word_parityCheck(unsigned int gpsword); @@ -120,7 +121,7 @@ private: gr_msg_queue_sptr d_queue; unsigned int d_vector_length; bool d_dump; - int d_satellite; + Gnss_Satellite d_satellite; int d_channel; //std::deque d_prn_start_sample_history; diff --git a/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc b/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc index e1cc2cca0..2d7799f91 100644 --- a/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc +++ b/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc @@ -214,7 +214,7 @@ GpsL1CaSubframeFsm::GpsL1CaSubframeFsm() void GpsL1CaSubframeFsm::gps_word_to_subframe(int position) { // insert the word in the correct position of the subframe - std::memcpy(&d_subframe[position*GPS_WORD_LENGTH],&d_GPS_frame_4bytes,sizeof(char)*GPS_WORD_LENGTH); + std::memcpy(&d_subframe[position*GPS_WORD_LENGTH], &d_GPS_frame_4bytes, sizeof(char)*GPS_WORD_LENGTH); } @@ -225,19 +225,20 @@ void GpsL1CaSubframeFsm::gps_subframe_to_nav_msg() { int subframe_ID; // NEW GPS SUBFRAME HAS ARRIVED! - subframe_ID=d_nav.subframe_decoder(this->d_subframe); //decode the subframe - std::cout<<"NAVIGATION FSM: received subframe "<d_subframe); //decode the subframe + //std::cout<<"Detected PRN: " << d_nav.i_satellite_PRN << " for satellite " << + std::cout << "NAVIGATION FSM: received subframe " << subframe_ID << " for satellite " << Gnss_Satellite(std::string("GPS"), i_satellite_PRN) << std::endl; + d_nav.i_satellite_PRN = i_satellite_PRN; + d_nav.i_channel_ID = i_channel_ID; + if (subframe_ID == 1) { - d_nav.d_subframe1_timestamp_ms=this->d_preamble_time_ms; + d_nav.d_subframe1_timestamp_ms = this->d_preamble_time_ms; //std::cout<<"NAVIGATION FSM: set subframe 1 preamble timestamp for satellite "< *d_nav_queue; diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_fll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_fll_pll_tracking.cc index 4864a5a44..c9b75a0cb 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_fll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_fll_pll_tracking.cc @@ -125,8 +125,8 @@ void GpsL1CaDllFllPllTracking::start_tracking() void GpsL1CaDllFllPllTracking::set_satellite(Gnss_Satellite satellite) { satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - tracking_->set_satellite(satellite); - DLOG(INFO) << "satellite set to " << satellite_; + tracking_->set_satellite(satellite_); + DLOG(INFO) << "DLL - PLL/FLL Tracking block now tracks satellite " << satellite_; } void GpsL1CaDllFllPllTracking::set_channel(unsigned int channel) diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc index 59aaaa17b..a16029a2e 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc @@ -118,8 +118,8 @@ void GpsL1CaDllPllTracking::start_tracking() void GpsL1CaDllPllTracking::set_satellite(Gnss_Satellite satellite) { satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - tracking_->set_satellite(satellite); - DLOG(INFO) << "satellite set to " << satellite_; + tracking_->set_satellite(satellite_); + DLOG(INFO) << "DLL - PLL Tracking block now tracks satellite " << satellite_; } /* diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_fll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_fll_pll_tracking_cc.cc index bf896ab46..f1b350cd4 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_fll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_fll_pll_tracking_cc.cc @@ -189,7 +189,7 @@ void Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::start_tracking() d_FLL_wait = 1; // generate local reference ALWAYS starting at chip 1 (1 sample per chip) - code_gen_conplex(&d_ca_code[1], d_satellite.get_PRN(), 0); + code_gen_conplex(&d_ca_code[1], this->d_satellite.get_PRN(), 0); d_ca_code[0] = d_ca_code[(int)GPS_L1_CA_CODE_LENGTH_CHIPS]; d_ca_code[(int)GPS_L1_CA_CODE_LENGTH_CHIPS + 1] = d_ca_code[1]; @@ -496,8 +496,8 @@ int Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::general_work (int noutput_items, gr_vecto if (floor(d_sample_counter/d_fs_in) != d_last_seg) { d_last_seg = floor(d_sample_counter/d_fs_in); - std::cout << "Current input signal time=" << d_last_seg << " [s]" << std::endl; - std::cout << "Tracking CH "<< d_channel << " CN0=" << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl; + std::cout << "Current input signal time = " << d_last_seg << " [s]" << std::endl; + std::cout << "Tracking CH " << d_channel << ": Satellite " << this->d_satellite << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl; //std::cout<<"TRK CH "<d_satellite << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl; //std::cout<<"TRK CH "<d_satellite << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl; //std::cout<<"TRK CH "<d_satellite << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl; //std::cout<<"TRK CH "<volk_32fc_x2_dot_prod_32fc_a_best_arch="generic"; - }else{ - std::cout << "Detected architectures in this machine for volk_32fc_x2_dot_prod_32fc_a:" << std::endl; - for (unsigned int i=0;ivolk_32fc_x2_dot_prod_32fc_a_best_arch=arch_list.at(arch_list.size()-1); - } + //first let's get a list of available architectures for the test + if(arch_list.size() < 2) + { + std::cout << "no architectures to test" << std::endl; + this->volk_32fc_x2_dot_prod_32fc_a_best_arch = "generic"; + } + else + { + std::cout << "Detected architectures in this machine for volk_32fc_x2_dot_prod_32fc_a:" << std::endl; + for (unsigned int i=0; ivolk_32fc_x2_dot_prod_32fc_a_best_arch = arch_list.at(arch_list.size() - 1); + } } + + + + + void correlator::cpu_arch_test_volk_32fc_x2_multiply_32fc_a() { - // - struct volk_func_desc desc=volk_32fc_x2_multiply_32fc_a_get_func_desc(); - std::vector arch_list; + // + struct volk_func_desc desc = volk_32fc_x2_multiply_32fc_a_get_func_desc(); + std::vector arch_list; - for(int i = 0; i < desc.n_archs; i++) { - //if(!(archs[i+1] & volk_get_lvarch())) continue; //this arch isn't available on this pc - arch_list.push_back(std::string(desc.indices[i])); - } + for(int i = 0; i < desc.n_archs; ++i) + { + //if(!(archs[i+1] & volk_get_lvarch())) continue; //this arch isn't available on this pc + arch_list.push_back(std::string(desc.indices[i])); + } - this->volk_32fc_x2_multiply_32fc_a_best_arch="generic"; - //first let's get a list of available architectures for the test - if(arch_list.size() < 2) { - std::cout << "no architectures to test" << std::endl; - }else{ - std::cout << "Detected architectures in this machine for volk_32fc_x2_multiply_32fc_a:" << std::endl; - for (unsigned int i=0;ivolk_32fc_x2_multiply_32fc_a_best_arch="sse3"; - } - } - - } + this->volk_32fc_x2_multiply_32fc_a_best_arch = "generic"; + //first let's get a list of available architectures for the test + if(arch_list.size() < 2) + { + std::cout << "no architectures to test" << std::endl; + } + else + { + std::cout << "Detected architectures in this machine for volk_32fc_x2_multiply_32fc_a:" << std::endl; + for (unsigned int i=0; i < arch_list.size(); ++i) + { + std::cout << "Arch " << i << ":" << arch_list.at(i) << std::endl; + if (arch_list.at(i).compare("sse3") == 1) + { + // TODO: Make a test to find the best architecture + this->volk_32fc_x2_multiply_32fc_a_best_arch = "sse3"; + } + } + } } + + + correlator::correlator () { - cpu_arch_test_volk_32fc_x2_dot_prod_32fc_a(); - cpu_arch_test_volk_32fc_x2_multiply_32fc_a(); + cpu_arch_test_volk_32fc_x2_dot_prod_32fc_a(); + cpu_arch_test_volk_32fc_x2_multiply_32fc_a(); } + + + correlator::~correlator () {} diff --git a/src/algorithms/tracking/libs/correlator.h b/src/algorithms/tracking/libs/correlator.h index f14263b42..25aa2fda5 100644 --- a/src/algorithms/tracking/libs/correlator.h +++ b/src/algorithms/tracking/libs/correlator.h @@ -1,13 +1,14 @@ /*! * \file correlator.h * \brief High optimized vector correlator class - * \author Javier Arribas, 2011. jarribas(at)cttc.es + * \author Javier Arribas, 2012. jarribas(at)cttc.es * - * Class that implements a high optimized vector correlator class. + * Class that implements a high optimized vector correlator class + * using the volk library * * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -30,29 +31,30 @@ * ------------------------------------------------------------------------- */ -#ifndef CORRELATOR_H_ -#define CORRELATOR_H_ +#ifndef GNSS_SDR_CORRELATOR_H_ +#define GNSS_SDR_CORRELATOR_H_ + +#include +#include + + /*! * \brief High optimized vector correlator class * */ - -#include -#include class correlator { +public: + void Carrier_wipeoff_and_EPL_generic(int signal_length_samples,const gr_complex* input, gr_complex* carrier,gr_complex* E_code, gr_complex* P_code, gr_complex* L_code,gr_complex* E_out, gr_complex* P_out, gr_complex* L_out); + void Carrier_wipeoff_and_EPL_volk(int signal_length_samples,const gr_complex* input, gr_complex* carrier,gr_complex* E_code, gr_complex* P_code, gr_complex* L_code,gr_complex* E_out, gr_complex* P_out, gr_complex* L_out); + correlator(); + ~correlator(); private: - std::string volk_32fc_x2_multiply_32fc_a_best_arch; - std::string volk_32fc_x2_dot_prod_32fc_a_best_arch; - - unsigned long next_power_2(unsigned long v); - void cpu_arch_test_volk_32fc_x2_dot_prod_32fc_a(); - void cpu_arch_test_volk_32fc_x2_multiply_32fc_a(); - - public: - void Carrier_wipeoff_and_EPL_generic(int signal_length_samples,const gr_complex* input, gr_complex* carrier,gr_complex* E_code, gr_complex* P_code, gr_complex* L_code,gr_complex* E_out, gr_complex* P_out, gr_complex* L_out); - void Carrier_wipeoff_and_EPL_volk(int signal_length_samples,const gr_complex* input, gr_complex* carrier,gr_complex* E_code, gr_complex* P_code, gr_complex* L_code,gr_complex* E_out, gr_complex* P_out, gr_complex* L_out); - correlator(); - ~correlator(); + std::string volk_32fc_x2_multiply_32fc_a_best_arch; + std::string volk_32fc_x2_dot_prod_32fc_a_best_arch; + unsigned long next_power_2(unsigned long v); + void cpu_arch_test_volk_32fc_x2_dot_prod_32fc_a(); + void cpu_arch_test_volk_32fc_x2_multiply_32fc_a(); }; #endif + diff --git a/src/core/interfaces/telemetry_decoder_interface.h b/src/core/interfaces/telemetry_decoder_interface.h index 289392f9c..97dbc1b31 100644 --- a/src/core/interfaces/telemetry_decoder_interface.h +++ b/src/core/interfaces/telemetry_decoder_interface.h @@ -38,6 +38,7 @@ #define GNSS_SDR_TELEMETRY_DECODER_INTERFACE_H_ #include "gnss_block_interface.h" +#include "gnss_satellite.h" /*! * \brief This abstract class represents an interface to a navigation GNSS block. @@ -53,7 +54,7 @@ class TelemetryDecoderInterface : public GNSSBlockInterface public: virtual void reset() = 0; - virtual void set_satellite(int satellite) = 0; + virtual void set_satellite(Gnss_Satellite sat) = 0; virtual void set_channel(int channel) = 0; }; diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index c5bbeae07..5cd2e3d93 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -347,7 +347,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) break; } - DLOG(INFO) << "available channels " + DLOG(INFO) << "Number of available satellites: " << available_GPS_satellites_IDs_->size(); } @@ -355,15 +355,13 @@ void GNSSFlowgraph::set_configuration(ConfigurationInterface* configuration) { if (running_) { - LOG_AT_LEVEL(WARNING) - << "Unable to update configuration while flowgraph running"; + LOG_AT_LEVEL(WARNING) << "Unable to update configuration while flowgraph running"; return; } if (connected_) { - LOG_AT_LEVEL(WARNING) - << "Unable to update configuration while flowgraph connected"; + LOG_AT_LEVEL(WARNING) << "Unable to update configuration while flowgraph connected"; } configuration_ = configuration; diff --git a/src/core/system_parameters/GPS_L1_CA.h b/src/core/system_parameters/GPS_L1_CA.h index 9d85ef0bc..1d6d5bd70 100644 --- a/src/core/system_parameters/GPS_L1_CA.h +++ b/src/core/system_parameters/GPS_L1_CA.h @@ -33,6 +33,7 @@ #define GNSS_SDR_GPS_L1_CA_H_ #include +#include // Physical constants const double GPS_C_m_s = 299792458.0; //!< The speed of light, [m/s] @@ -120,7 +121,7 @@ typedef struct gnss_pseudorange { double pseudorange_m; double timestamp_ms; - int SV_ID; + unsigned int SV_ID; bool valid; } gnss_pseudorange; diff --git a/src/core/system_parameters/gnss_satellite.cc b/src/core/system_parameters/gnss_satellite.cc index 02b6c9f4a..b1b3155de 100644 --- a/src/core/system_parameters/gnss_satellite.cc +++ b/src/core/system_parameters/gnss_satellite.cc @@ -92,6 +92,24 @@ bool operator== (const Gnss_Satellite &sat1, const Gnss_Satellite &sat2) return equal; } +/* +Gnss_Satellite& Gnss_Satellite::operator=(const Gnss_Satellite &rhs) { + + // Only do assignment if RHS is a different object from this. + if (this != &rhs) { + // Deallocate, allocate new space, copy values... + const std::string system_ = rhs.get_system(); + const unsigned int PRN_ = rhs.get_PRN(); + const std::string block_ = rhs.get_block(); + // const signed int rf_link_ = 0; + this->set_system(system_); + this->set_PRN(PRN_); + this->set_block(system_, PRN_); + //this.rf_link = rf_link_; + } + return *this; +}*/ + void Gnss_Satellite::set_system(std::string system_) { @@ -104,7 +122,7 @@ void Gnss_Satellite::set_system(std::string system_) } else { - LOG_AT_LEVEL(ERROR) << "System " << system_ << " is not defined {GPS, GLONASS, SBAS, Galileo, Compass}"; + DLOG(INFO) << "System " << system_ << " is not defined {GPS, GLONASS, SBAS, Galileo, Compass}. Initialization?"; system = std::string(""); } } @@ -117,14 +135,14 @@ void Gnss_Satellite::set_PRN(unsigned int PRN_) // Set satellite's PRN if (system.compare("") == 0) { - LOG_AT_LEVEL(ERROR) << "Trying to define PRN while system is not defined"; + DLOG(INFO) << "Trying to define PRN while system is not defined"; PRN = 0; } if (system.compare("GPS") == 0) { if (PRN_ < 1 or PRN > 32) { - LOG_AT_LEVEL(ERROR) << "This PRN is not defined"; + DLOG(INFO) << "This PRN is not defined"; PRN = 0; } else @@ -136,7 +154,7 @@ void Gnss_Satellite::set_PRN(unsigned int PRN_) { if (PRN_ < 1 or PRN > 24) { - LOG_AT_LEVEL(ERROR) << "This PRN is not defined"; + DLOG(INFO) << "This PRN is not defined"; PRN = 0; } else @@ -153,7 +171,7 @@ void Gnss_Satellite::set_PRN(unsigned int PRN_) else if (PRN_ == 126){ PRN = PRN_; } // EGNOS IOR-W currently used by Industry to perform various tests on the system. else { - LOG_AT_LEVEL(ERROR) << "This PRN is not defined"; + DLOG(INFO) << "This PRN is not defined"; PRN = 0; } } @@ -165,13 +183,13 @@ void Gnss_Satellite::set_PRN(unsigned int PRN_) } else { - LOG_AT_LEVEL(ERROR) << "This PRN is not defined"; + DLOG(INFO) << "This PRN is not defined"; PRN = 0; } } else { - LOG_AT_LEVEL(ERROR) << "System " << system << " is not defined"; + DLOG(INFO) << "System " << system << " is not defined"; PRN = 0; } } diff --git a/src/core/system_parameters/gnss_satellite.h b/src/core/system_parameters/gnss_satellite.h index fc3510bc4..eca827fcc 100644 --- a/src/core/system_parameters/gnss_satellite.h +++ b/src/core/system_parameters/gnss_satellite.h @@ -53,12 +53,13 @@ public: std::string get_block() const; //!< Gets the satellite block. If GPS, returns {"IIA", "IIR", "IIR-M", "IIF"} friend bool operator== (const Gnss_Satellite &, const Gnss_Satellite &); // operator== for comparison friend std::ostream& operator<<(std::ostream &, const Gnss_Satellite &); // operator<< for pretty printing + //Gnss_Satellite& operator=(const Gnss_Satellite &); private: unsigned int PRN; std::string system; std::string block; signed int rf_link; - void set_system(std::string system); // Sets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"}. Returns 1 if success. + void set_system(std::string system); // Sets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"}. void set_PRN(unsigned int PRN); // Sets satellite's PRN void set_block(std::string system_, unsigned int PRN_ ); std::set system_set; // = {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"}; diff --git a/src/core/system_parameters/gps_navigation_message.h b/src/core/system_parameters/gps_navigation_message.h index d449f51a1..21cc790d2 100644 --- a/src/core/system_parameters/gps_navigation_message.h +++ b/src/core/system_parameters/gps_navigation_message.h @@ -152,7 +152,7 @@ public: // satellite identification info int i_channel_ID; - int i_satellite_PRN; + unsigned int i_satellite_PRN; // time synchro double d_subframe1_timestamp_ms; //[ms]