From 2ce62706af525602306c99326e8185fc88d1f9c5 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 28 Dec 2011 21:36:45 +0000 Subject: [PATCH] Adding documentation and improving code formatting. git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@103 64b25241-fba3-4117-9849-534c7e92360d --- src/algorithms/PVT/adapters/gps_l1_ca_pvt.cc | 9 +- src/algorithms/PVT/adapters/gps_l1_ca_pvt.h | 6 +- .../PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.cc | 158 +++---- .../PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.h | 2 +- src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.cc | 393 +++++++++-------- src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.h | 4 +- src/algorithms/PVT/libs/kml_printer.cc | 141 +++--- src/algorithms/PVT/libs/kml_printer.h | 2 +- .../adapters/gps_l1_ca_gps_sdr_acquisition.cc | 20 +- .../adapters/gps_l1_ca_gps_sdr_acquisition.h | 4 +- .../adapters/gps_l1_ca_pcps_acquisition.cc | 5 +- .../adapters/gps_l1_ca_pcps_acquisition.h | 2 +- .../gps_l1_ca_pcps_acquisition_cc.h | 7 +- .../gps_l1_ca_tong_pcps_acquisition_cc.cc | 320 +++++++------- .../gps_l1_ca_tong_pcps_acquisition_cc.h | 6 +- src/algorithms/channel/adapters/channel.cc | 88 ++-- src/algorithms/channel/adapters/channel.h | 7 +- .../channel/libs/gps_l1_ca_channel_fsm.cc | 33 +- .../channel/libs/gps_l1_ca_channel_fsm.h | 3 +- .../adapters/direct_resampler_conditioner.cc | 79 ++-- .../adapters/direct_resampler_conditioner.h | 14 +- src/algorithms/libs/gnss_sdr_valve.h | 10 +- src/algorithms/libs/pass_through.cc | 7 +- src/algorithms/libs/pass_through.h | 9 +- .../adapters/gps_l1_ca_observables.cc | 18 +- .../adapters/gps_l1_ca_observables.h | 5 +- .../gps_l1_ca_observables_cc.cc | 9 +- .../gps_l1_ca_observables_cc.h | 2 +- .../adapters/file_output_filter.cc | 10 +- .../adapters/file_output_filter.h | 10 +- .../adapters/null_sink_output_filter.cc | 8 +- .../adapters/null_sink_output_filter.h | 3 +- .../adapters/file_signal_source.cc | 10 +- .../adapters/file_signal_source.h | 7 +- .../adapters/gps_l1_ca_telemetry_decoder.cc | 6 +- .../adapters/gps_l1_ca_telemetry_decoder.h | 3 +- .../gps_l1_ca_telemetry_decoder_cc.cc | 3 +- .../gps_l1_ca_telemetry_decoder_cc.h | 3 +- .../gps_l1_ca_dll_fll_pll_tracking.cc | 23 +- .../adapters/gps_l1_ca_dll_fll_pll_tracking.h | 10 +- .../adapters/gps_l1_ca_dll_pll_tracking.cc | 53 +-- .../adapters/gps_l1_ca_dll_pll_tracking.h | 33 +- .../gps_l1_ca_dll_fll_pll_tracking_cc.cc | 20 +- .../gps_l1_ca_dll_fll_pll_tracking_cc.h | 10 +- .../gps_l1_ca_dll_pll_tracking_cc.cc | 13 +- .../gps_l1_ca_dll_pll_tracking_cc.h | 9 +- src/algorithms/tracking/libs/CN_estimators.cc | 125 +++--- src/algorithms/tracking/libs/CN_estimators.h | 40 +- .../tracking/libs/tracking_2nd_DLL_filter.cc | 41 +- .../tracking/libs/tracking_2nd_DLL_filter.h | 8 +- .../tracking/libs/tracking_2nd_PLL_filter.cc | 9 +- .../tracking/libs/tracking_2nd_PLL_filter.h | 8 +- .../tracking/libs/tracking_FLL_PLL_filter.cc | 108 ++--- .../tracking/libs/tracking_FLL_PLL_filter.h | 4 +- .../tracking/libs/tracking_discriminators.cc | 46 +- .../tracking/libs/tracking_discriminators.h | 44 +- src/core/interfaces/channel_interface.h | 1 - src/core/interfaces/configuration_interface.h | 5 - src/core/interfaces/gnss_block_interface.h | 1 - src/core/interfaces/observables_interface.h | 4 +- src/core/interfaces/pvt_interface.h | 8 +- .../interfaces/telemetry_decoder_interface.h | 4 +- src/core/interfaces/tracking_interface.h | 2 +- src/core/libs/string_converter.cc | 102 ++--- src/core/libs/string_converter.h | 26 +- src/core/receiver/concurrent_queue.h | 14 +- src/core/receiver/control_message.h | 2 +- src/core/receiver/control_message_factory.cc | 47 +- src/core/receiver/control_message_factory.h | 2 +- src/core/receiver/control_thread.cc | 104 ++--- src/core/receiver/control_thread.h | 19 +- src/core/receiver/file_configuration.cc | 6 +- src/core/receiver/file_configuration.h | 2 +- src/core/receiver/gnss_block_factory.cc | 189 ++++---- src/core/receiver/gnss_block_factory.h | 7 +- src/core/receiver/gnss_flowgraph.cc | 406 +++++++++--------- src/core/receiver/gnss_flowgraph.h | 28 +- src/core/receiver/in_memory_configuration.cc | 9 +- src/core/receiver/in_memory_configuration.h | 2 +- src/main/main.cc | 46 +- 80 files changed, 1568 insertions(+), 1498 deletions(-) diff --git a/src/algorithms/PVT/adapters/gps_l1_ca_pvt.cc b/src/algorithms/PVT/adapters/gps_l1_ca_pvt.cc index aee21df2e..27d911289 100644 --- a/src/algorithms/PVT/adapters/gps_l1_ca_pvt.cc +++ b/src/algorithms/PVT/adapters/gps_l1_ca_pvt.cc @@ -1,6 +1,7 @@ /*! * \file gps_l1_ca_pvt.cc - * \brief Simple Least Squares implementation for GPS L1 C/A Position Velocity and Time + * \brief Implementation of an adapter of a GPS L1 C/A PVT solver block to a + * PVTInterface * \author Javier Arribas, 2011. jarribas(at)cttc.es * * @@ -56,8 +57,8 @@ GpsL1CaPvt::GpsL1CaPvt(ConfigurationInterface* configuration, DLOG(INFO) << "role " << role; - int averaging_depth; - averaging_depth=configuration->property(role + ".averaging_depth", 10); + int averaging_depth; + averaging_depth=configuration->property(role + ".averaging_depth", 10); bool flag_averaging; flag_averaging=configuration->property(role + ".flag_averaging", false); @@ -65,7 +66,7 @@ GpsL1CaPvt::GpsL1CaPvt(ConfigurationInterface* configuration, dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); - pvt_ = gps_l1_ca_make_pvt_cc(in_streams_, queue_, dump_, dump_filename_, averaging_depth, flag_averaging); + pvt_ = gps_l1_ca_make_pvt_cc(in_streams_, queue_, dump_, dump_filename_, averaging_depth, flag_averaging); DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")"; // set the navigation msg queue; diff --git a/src/algorithms/PVT/adapters/gps_l1_ca_pvt.h b/src/algorithms/PVT/adapters/gps_l1_ca_pvt.h index bcfdc9a7f..d9dac58e5 100644 --- a/src/algorithms/PVT/adapters/gps_l1_ca_pvt.h +++ b/src/algorithms/PVT/adapters/gps_l1_ca_pvt.h @@ -1,6 +1,8 @@ /*! * \file gps_l1_ca_pvt.h - * \brief Simple Least Squares implementation for GPS L1 C/A Position Velocity and Time + * \brief Interface of an adapter of a GPS L1 C/A PVT solver block to a + * PVTInterface + * Position Velocity and Time * \author Javier Arribas, 2011. jarribas(at)cttc.es * * @@ -48,7 +50,7 @@ class GpsL1CaPvt : public PvtInterface public: - GpsL1CaPvt(ConfigurationInterface* configuration, + GpsL1CaPvt(ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams, 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 60fb9d72f..03c4472f3 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 @@ -1,6 +1,6 @@ /*! * \file gps_l1_ca_pvt_cc.cc - * \brief Position Velocity and Time computation for GPS L1 C/A + * \brief Implementation of a Position Velocity and Time computation block for GPS L1 C/A * \author Javier Arribas, 2011. jarribas(at)cttc.es * ------------------------------------------------------------------------- * @@ -48,36 +48,36 @@ using google::LogMessage; gps_l1_ca_pvt_cc_sptr gps_l1_ca_make_pvt_cc(unsigned int nchannels, gr_msg_queue_sptr queue, bool dump, std::string dump_filename, int averaging_depth, bool flag_averaging) { - return gps_l1_ca_pvt_cc_sptr(new gps_l1_ca_pvt_cc(nchannels, queue, dump, dump_filename, averaging_depth, flag_averaging)); + return gps_l1_ca_pvt_cc_sptr(new gps_l1_ca_pvt_cc(nchannels, queue, dump, dump_filename, averaging_depth, flag_averaging)); } gps_l1_ca_pvt_cc::gps_l1_ca_pvt_cc(unsigned int nchannels, gr_msg_queue_sptr queue, bool dump, std::string dump_filename, int averaging_depth, bool flag_averaging) : - gr_block ("gps_l1_ca_pvt_cc", gr_make_io_signature (nchannels, nchannels, sizeof(gnss_pseudorange)), - gr_make_io_signature(1, 1, sizeof(gr_complex))) { + gr_block ("gps_l1_ca_pvt_cc", gr_make_io_signature (nchannels, nchannels, sizeof(gnss_pseudorange)), + gr_make_io_signature(1, 1, sizeof(gr_complex))) { - // initialize internal vars - d_queue = queue; - d_dump = dump; - d_nchannels = nchannels; - d_dump_filename=dump_filename; - std::string kml_dump_filename; - kml_dump_filename=d_dump_filename; - kml_dump_filename.append(".kml"); - d_kml_dump.set_headers(kml_dump_filename); - d_dump_filename.append(".dat"); + // initialize internal vars + d_queue = queue; + d_dump = dump; + d_nchannels = nchannels; + d_dump_filename=dump_filename; + std::string kml_dump_filename; + kml_dump_filename=d_dump_filename; + kml_dump_filename.append(".kml"); + d_kml_dump.set_headers(kml_dump_filename); + d_dump_filename.append(".dat"); - d_averaging_depth=averaging_depth; - d_flag_averaging=flag_averaging; - /*! - * \todo Enable RINEX printer: The current RINEX printer need a complete refactoring and some bug fixing work - */ - //d_rinex_printer.set_headers("GNSS-SDR"); - d_ls_pvt=new gps_l1_ca_ls_pvt(nchannels,d_dump_filename,d_dump); - d_ls_pvt->set_averaging_depth(d_averaging_depth); - d_ephemeris_clock_s=0.0; + d_averaging_depth=averaging_depth; + d_flag_averaging=flag_averaging; + /*! + * \todo Enable RINEX printer: The current RINEX printer need a complete refactoring and some bug fixing work + */ + //d_rinex_printer.set_headers("GNSS-SDR"); + d_ls_pvt=new gps_l1_ca_ls_pvt(nchannels,d_dump_filename,d_dump); + d_ls_pvt->set_averaging_depth(d_averaging_depth); + d_ephemeris_clock_s=0.0; - d_sample_counter=0; + d_sample_counter=0; } gps_l1_ca_pvt_cc::~gps_l1_ca_pvt_cc() { @@ -87,75 +87,75 @@ gps_l1_ca_pvt_cc::~gps_l1_ca_pvt_cc() { bool pseudoranges_pairCompare_min( std::pair a, std::pair b) { - return (a.second.pseudorange_m) < (b.second.pseudorange_m); + return (a.second.pseudorange_m) < (b.second.pseudorange_m); } int gps_l1_ca_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { - d_sample_counter++; + d_sample_counter++; - std::map gnss_pseudoranges_map; - std::map::iterator gnss_pseudoranges_iter; + std::map gnss_pseudoranges_map; + std::map::iterator gnss_pseudoranges_iter; - gnss_pseudorange **in = (gnss_pseudorange **) &input_items[0]; //Get the input pointer + gnss_pseudorange **in = (gnss_pseudorange **) &input_items[0]; //Get the input pointer - for (unsigned int i=0;i(in[i][0].SV_ID,in[i][0])); //record the valid pseudorange in a map - } - } + for (unsigned int i=0;i(in[i][0].SV_ID,in[i][0])); //record the valid pseudorange in a map + } + } - //debug print - std::cout << std::setprecision(16); - for(gnss_pseudoranges_iter = gnss_pseudoranges_map.begin(); - gnss_pseudoranges_iter != gnss_pseudoranges_map.end(); - gnss_pseudoranges_iter++) - { - std::cout<<"Pseudoranges(SV ID,pseudorange [m]) =("<first<<","<second.pseudorange_m<<")"<first<<","<second.pseudorange_m<<")"<try_pop(nav_msg)==true) - { - std::cout<<"New ephemeris record has arrived from SAT ID "<d_ephemeris[nav_msg.d_channel_ID]=nav_msg; - // **** update pseudoranges clock **** - if (nav_msg.d_satellite_PRN==gnss_pseudoranges_iter->second.SV_ID) - { - d_ephemeris_clock_s=d_last_nav_msg.d_TOW; - d_ephemeris_timestamp_ms=d_last_nav_msg.d_subframe1_timestamp_ms; - } - // **** write ephemeris to RINES NAV file - //d_rinex_printer.LogRinex2Nav(nav_msg); - } + gps_navigation_message nav_msg; + while (d_nav_queue->try_pop(nav_msg)==true) + { + std::cout<<"New ephemeris record has arrived from SAT ID "<d_ephemeris[nav_msg.d_channel_ID]=nav_msg; + // **** update pseudoranges clock **** + if (nav_msg.d_satellite_PRN==gnss_pseudoranges_iter->second.SV_ID) + { + d_ephemeris_clock_s=d_last_nav_msg.d_TOW; + d_ephemeris_timestamp_ms=d_last_nav_msg.d_subframe1_timestamp_ms; + } + // **** write ephemeris to RINES NAV file + //d_rinex_printer.LogRinex2Nav(nav_msg); + } - // ############ 2. COMPUTE THE PVT ################################ - // write the pseudoranges to RINEX OBS file - // 1- need a valid clock - if (d_ephemeris_clock_s>0 and d_last_nav_msg.d_satellite_PRN>0) - { - //d_rinex_printer.LogRinex2Obs(d_last_nav_msg,d_ephemeris_clock_s+((double)pseudoranges_timestamp_ms-d_ephemeris_timestamp_ms)/1000.0,pseudoranges); - // compute on the fly PVT solution - //std::cout<<"diff_clock_ephemerids="<<(gnss_pseudoranges_iter->second.timestamp_ms-d_ephemeris_timestamp_ms)/1000.0<<"\r\n"; - if (d_ls_pvt->get_PVT(gnss_pseudoranges_map, - d_ephemeris_clock_s+(gnss_pseudoranges_iter->second.timestamp_ms-d_ephemeris_timestamp_ms)/1000.0, - d_flag_averaging)==true) - { - d_kml_dump.print_position(d_ls_pvt,d_flag_averaging); - } - } + // ############ 2. COMPUTE THE PVT ################################ + // write the pseudoranges to RINEX OBS file + // 1- need a valid clock + if (d_ephemeris_clock_s>0 and d_last_nav_msg.d_satellite_PRN>0) + { + //d_rinex_printer.LogRinex2Obs(d_last_nav_msg,d_ephemeris_clock_s+((double)pseudoranges_timestamp_ms-d_ephemeris_timestamp_ms)/1000.0,pseudoranges); + // compute on the fly PVT solution + //std::cout<<"diff_clock_ephemerids="<<(gnss_pseudoranges_iter->second.timestamp_ms-d_ephemeris_timestamp_ms)/1000.0<<"\r\n"; + if (d_ls_pvt->get_PVT(gnss_pseudoranges_map, + d_ephemeris_clock_s+(gnss_pseudoranges_iter->second.timestamp_ms-d_ephemeris_timestamp_ms)/1000.0, + d_flag_averaging)==true) + { + d_kml_dump.print_position(d_ls_pvt,d_flag_averaging); + } + } - consume_each(1); //one by one - return 0; + consume_each(1); //one by one + return 0; } diff --git a/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.h index e223e8db8..ef1f3a427 100644 --- a/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.h @@ -1,6 +1,6 @@ /*! * \file gps_l1_ca_pvt_cc.h - * \brief Position Velocity and Time computation for GPS L1 C/A + * \brief Interface of a Position Velocity and Time computation block for GPS L1 C/A * \author Javier Arribas, 2011. jarribas(at)cttc.es * ------------------------------------------------------------------------- * 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 82961d4a7..60abb32b2 100644 --- a/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.cc +++ b/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.cc @@ -1,7 +1,7 @@ /*! * \file gps_l1_ca_ls_pvt.cc - * \brief Least Squares Position, Velocity, and Time (PVT) solver, based on - * K.Borre Matlab receiver. + * \brief Implementation of a Least Squares Position, Velocity, and Time + * (PVT) solver, based on K.Borre's Matlab receiver. * \author Javier Arribas, 2011. jarribas(at)cttc.es * ------------------------------------------------------------------------- * @@ -42,32 +42,32 @@ gps_l1_ca_ls_pvt::gps_l1_ca_ls_pvt(int nchannels,std::string dump_filename, bool d_flag_dump_enabled=flag_dump_to_file; d_averaging_depth=0; - // ############# ENABLE DATA FILE LOG ################# - if (d_flag_dump_enabled==true) - { - if (d_dump_file.is_open()==false) - { - try { - d_dump_file.exceptions ( std::ifstream::failbit | std::ifstream::badbit ); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - std::cout<<"PVT lib dump enabled Log file: "< gnss_pseudoranges_ int valid_obs=0; //valid observations counter for (int i=0; isecond.pseudorange_m+d_ephemeris[i].d_satClkCorr*GPS_C_m_s; - valid_obs++; - }else{ - // no valid pseudorange for the current channel - W(i,i)=0; // channel de-activated - obs(i)=1; // to avoid algorithm problems (divide by zero) - } - }else{ - // no valid ephemeris for the current channel - W(i,i)=0; // channel de-activated - obs(i)=1; // to avoid algorithm problems (divide by zero) + if (d_ephemeris[i].satellite_validation()==true) + { + gnss_pseudoranges_iter=gnss_pseudoranges_map.find(d_ephemeris[i].d_satellite_PRN); + if (gnss_pseudoranges_iter!=gnss_pseudoranges_map.end()) + { + /*! + * \todo Place here the satellite CN0 (power level, or weight factor) + */ + W(i,i)=1; + // compute the GPS master clock + d_ephemeris[i].master_clock(GPS_current_time); + // compute the satellite current ECEF position + d_ephemeris[i].satpos(); + // compute the clock error including relativistic effects + d_ephemeris[i].relativistic_clock_correction(GPS_current_time); + satpos(0,i)=d_ephemeris[i].d_satpos_X; + satpos(1,i)=d_ephemeris[i].d_satpos_Y; + satpos(2,i)=d_ephemeris[i].d_satpos_Z; + std::cout<<"ECEF satellite SV ID="<second.pseudorange_m+d_ephemeris[i].d_satClkCorr*GPS_C_m_s; + valid_obs++; + }else{ + // no valid pseudorange for the current channel + W(i,i)=0; // channel de-activated + obs(i)=1; // to avoid algorithm problems (divide by zero) + } + }else{ + // no valid ephemeris for the current channel + W(i,i)=0; // channel de-activated + obs(i)=1; // to avoid algorithm problems (divide by zero) + } } - } std::cout<<"PVT: valid observations="<=4) - { - arma::vec mypos; - mypos=leastSquarePos(satpos,obs,W); - std::cout << "Position at TOW="< 100) - { - std::cout<<"Failed to approximate h with desired precision. h-oldh= "< 100) + { + std::cout<<"Failed to approximate h with desired precision. h-oldh= "< 1.0e-12); d_latitude_d = phi*180.0/GPS_PI; d_longitude_d = lambda*180/GPS_PI; @@ -394,7 +393,7 @@ void gps_l1_ca_ls_pvt::cart2geo(double X, double Y, double Z, int elipsoid_selec //void gps_l1_ca_ls_pvt::topocent(traveltime, X_sat) //{ - /* +/* %function [Az, El, D] = topocent(X, dx) %TOPOCENT Transformation of vector dx into topocentric coordinate % system with origin at X. @@ -446,5 +445,5 @@ end D = sqrt(dx(1)^2 + dx(2)^2 + dx(3)^2); %%%%%%%%% end topocent.m %%%%%%%%% -*/ + */ //} diff --git a/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.h b/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.h index 85fe4c0a5..b22b49ff4 100644 --- a/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.h +++ b/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.h @@ -1,7 +1,7 @@ /*! * \file gps_l1_ca_ls_pvt.h - * \brief Least Squares Position, Velocity, and Time (PVT) solver, based on - * K.Borre Matlab receiver. + * \brief Interface of a Least Squares Position, Velocity, and Time (PVT) + * solver, based on K.Borre's Matlab receiver. * \author Javier Arribas, 2011. jarribas(at)cttc.es * ------------------------------------------------------------------------- * diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc index 7539f36c0..a29c308c4 100644 --- a/src/algorithms/PVT/libs/kml_printer.cc +++ b/src/algorithms/PVT/libs/kml_printer.cc @@ -1,6 +1,6 @@ /*! * \file kml_printer.cc - * \brief Prints PVT information to a GoogleEarth kml file + * \brief Implementation of a class that prints PVT information to a kml file * \author Javier Arribas, 2011. jarribas(at)cttc.es * * @@ -32,95 +32,92 @@ #include "kml_printer.h" #include #include - #include bool kml_printer::set_headers(std::string filename) { - time_t rawtime; - struct tm * timeinfo; + time_t rawtime; + struct tm * timeinfo; - time ( &rawtime ); - timeinfo = localtime ( &rawtime ); + time ( &rawtime ); + timeinfo = localtime ( &rawtime ); - kml_file.open(filename.c_str()); - if (kml_file.is_open()) + kml_file.open(filename.c_str()); + if (kml_file.is_open()) { - DLOG(INFO)<<"KML printer writting on "<\r\n" - <<"\r\n" - <<" \r\n" - <<" GNSS Track\r\n" - <<" GNSS-SDR Receiver position log file created at "<\r\n" - <<"\r\n" - <<"\r\n" - <<"GNSS-SDR PVT\r\n" - <<"GNSS-SDR position log\r\n" - <<"#yellowLineGreenPoly\r\n" - <<"\r\n" - <<"0\r\n" - <<"1\r\n" - <<"absolute\r\n" - <<"\r\n"; - return true; + DLOG(INFO)<<"KML printer writting on "<\r\n" + <<"\r\n" + <<" \r\n" + <<" GNSS Track\r\n" + <<" GNSS-SDR Receiver position log file created at "<\r\n" + <<"\r\n" + <<"\r\n" + <<"GNSS-SDR PVT\r\n" + <<"GNSS-SDR position log\r\n" + <<"#yellowLineGreenPoly\r\n" + <<"\r\n" + <<"0\r\n" + <<"1\r\n" + <<"absolute\r\n" + <<"\r\n"; + return true; }else{ - return false; + return false; } } bool kml_printer::print_position(gps_l1_ca_ls_pvt* position,bool print_average_values) { - double latitude; - double longitude; - double height; - if (print_average_values==false) - { - latitude=position->d_latitude_d; - longitude=position->d_longitude_d; - height=position->d_height_m; - }else{ - latitude=position->d_avg_latitude_d; - longitude=position->d_avg_longitude_d; - height=position->d_avg_height_m; - } + double latitude; + double longitude; + double height; + if (print_average_values==false) + { + latitude=position->d_latitude_d; + longitude=position->d_longitude_d; + height=position->d_height_m; + }else{ + latitude=position->d_avg_latitude_d; + longitude=position->d_avg_longitude_d; + height=position->d_avg_height_m; + } if (kml_file.is_open()) - { - kml_file<\r\n" - <<"\r\n" - <<"\r\n" - <<"\r\n" - <<""; - kml_file.close(); - return true; - }else{ - return false; - } -} -kml_printer::kml_printer () -{ + { + kml_file<<"\r\n" + <<"\r\n" + <<"\r\n" + <<"\r\n" + <<""; + kml_file.close(); + return true; + }else{ + return false; + } } -kml_printer::~kml_printer () -{ -} +kml_printer::kml_printer () {} + +kml_printer::~kml_printer () {} diff --git a/src/algorithms/PVT/libs/kml_printer.h b/src/algorithms/PVT/libs/kml_printer.h index f0548d5ca..76d5e8c5d 100644 --- a/src/algorithms/PVT/libs/kml_printer.h +++ b/src/algorithms/PVT/libs/kml_printer.h @@ -1,6 +1,6 @@ /*! * \file kml_printer.h - * \brief Prints PVT information to a GoogleEarth kml file + * \brief Interface of a class that prints PVT information to a kml file * \author Javier Arribas, 2011. jarribas(at)cttc.es * * diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_gps_sdr_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_gps_sdr_acquisition.cc index 9d57ce350..00b7a177b 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_gps_sdr_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_gps_sdr_acquisition.cc @@ -1,6 +1,8 @@ /*! * \file gps_l1_ca_gps_sdr_acquisition.cc - * \brief Brief description of the file here + * \brief Implementation of an adapter of an acquisition module based + * on the method in Gregory Heckler's GPS-SDR (see http://github.com/gps-sdr/gps-sdr) + * to an AcquisitionInterface * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Luis Esteve, 2011. luis(at)epsilon-formacion.com * @@ -32,19 +34,17 @@ #include "gps_l1_ca_gps_sdr_acquisition.h" #include "GPS_L1_CA.h" #include "configuration_interface.h" - #include #include #include #include #include - #include #include using google::LogMessage; -//! Constructor +// Constructor GpsL1CaGpsSdrAcquisition::GpsL1CaGpsSdrAcquisition( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams, @@ -108,11 +108,11 @@ GpsL1CaGpsSdrAcquisition::GpsL1CaGpsSdrAcquisition( } -//! Destructor +// Destructor GpsL1CaGpsSdrAcquisition::~GpsL1CaGpsSdrAcquisition() {} -//! Set satellite +// Set satellite void GpsL1CaGpsSdrAcquisition::set_satellite(unsigned int satellite) { satellite_ = satellite; @@ -128,7 +128,7 @@ void GpsL1CaGpsSdrAcquisition::set_satellite(unsigned int satellite) } -//! Set channel +// Set channel void GpsL1CaGpsSdrAcquisition::set_channel(unsigned int channel) { channel_ = channel; @@ -143,7 +143,7 @@ void GpsL1CaGpsSdrAcquisition::set_channel(unsigned int channel) } } -//! Set acquisition threshold +// Set acquisition threshold void GpsL1CaGpsSdrAcquisition::set_threshold(float threshold) { threshold_ = threshold; @@ -158,7 +158,7 @@ void GpsL1CaGpsSdrAcquisition::set_threshold(float threshold) } } -//! Set maximum Doppler shift +// Set maximum Doppler shift void GpsL1CaGpsSdrAcquisition::set_doppler_max(unsigned int doppler_max) { doppler_max_ = doppler_max; @@ -173,7 +173,7 @@ void GpsL1CaGpsSdrAcquisition::set_doppler_max(unsigned int doppler_max) } } -//! Set Channel Queue +// Set Channel Queue void GpsL1CaGpsSdrAcquisition::set_channel_queue( concurrent_queue *channel_internal_queue) { diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_gps_sdr_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_gps_sdr_acquisition.h index 0f327ba96..908c209fd 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_gps_sdr_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_gps_sdr_acquisition.h @@ -1,6 +1,8 @@ /*! * \file gps_l1_ca_gps_sdr_acquisition.h - * \brief Brief description of the file here + * \brief Interface of an adapter of an acquisition module based + * on the method in Gregory Heckler's GPS-SDR (see http://github.com/gps-sdr/gps-sdr) + * to an AcquisitionInterface * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Luis Esteve, 2011. luis(at)epsilon-formacion.com * 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 a3dfb4477..c98d6ffd3 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -1,11 +1,9 @@ /*! * \file gps_l1_ca_pcps_acquisition.cc - * \brief Brief description of the file here + * \brief Adapts a PCPS acquisition block for GPS L1 C/A to an AcquisitionInterface * \author Javier Arribas, 2011. jarribas(at)cttc.es * Luis Esteve, 2011. luis(at)epsilon-formacion.com * - * Detailed description of the file here if needed. - * * ------------------------------------------------------------------------- * * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) @@ -40,7 +38,6 @@ #include #include #include - #include #include diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h index a5f90b983..6f25c4a7c 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h @@ -1,6 +1,6 @@ /*! * \file gps_l1_ca_pcps_acquisition.h - * \brief Brief description of the file here + * \brief Adapts a PCPS acquisition block to an AcquisitionInterface for GPS L1 C/A * \author Javier Arribas, 2011. jarribas(at)cttc.es * Luis Esteve, 2011. luis(at)epsilon-formacion.com * diff --git a/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_pcps_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_pcps_acquisition_cc.h index 35acc04b5..16359b20e 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_pcps_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_pcps_acquisition_cc.h @@ -53,7 +53,7 @@ gps_l1_ca_pcps_make_acquisition_cc(unsigned int sampled_ms, gr_msg_queue_sptr queue, bool dump, std::string dump_filename); /*! - * \brief This class implements a PCPS acquisition block + * \brief This class implements a PCPS acquisition block for GPS L1 C/A */ class gps_l1_ca_pcps_acquisition_cc: public gr_block { @@ -130,22 +130,27 @@ public: } void set_satellite(unsigned int satellite); + void set_active(bool active) { d_active = active; } + void set_channel(unsigned int channel) { d_channel = channel; } + void set_threshold(float threshold) { d_threshold = threshold; } + void set_doppler_max(unsigned int doppler_max) { d_doppler_max = doppler_max; } + void set_doppler_step(unsigned int doppler_step) { d_doppler_step = doppler_step; diff --git a/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_tong_pcps_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_tong_pcps_acquisition_cc.cc index 74963a088..ef758d4a3 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_tong_pcps_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_tong_pcps_acquisition_cc.cc @@ -56,9 +56,9 @@ gps_l1_ca_tong_pcps_acquisition_cc::gps_l1_ca_tong_pcps_acquisition_cc( unsigned int sampled_ms, unsigned int doppler_max, long freq, long fs_in, int samples_per_ms, gr_msg_queue_sptr queue, bool dump, std::string dump_filename) : - gr_block("gps_l1_ca_tong_pcps_acquisition_cc", gr_make_io_signature(1, 1, - sizeof(gr_complex) * samples_per_ms), gr_make_io_signature(0, 0, - sizeof(gr_complex) * samples_per_ms)) + gr_block("gps_l1_ca_tong_pcps_acquisition_cc", gr_make_io_signature(1, 1, + sizeof(gr_complex) * samples_per_ms), gr_make_io_signature(0, 0, + sizeof(gr_complex) * samples_per_ms)) { // SAMPLE COUNTER @@ -130,9 +130,9 @@ gps_l1_ca_tong_pcps_acquisition_cc::~gps_l1_ca_tong_pcps_acquisition_cc() delete d_ifft; if (d_dump) - { - d_dump_file.close(); - } + { + d_dump_file.close(); + } } void gps_l1_ca_tong_pcps_acquisition_cc::set_satellite(unsigned int satellite) @@ -151,11 +151,11 @@ void gps_l1_ca_tong_pcps_acquisition_cc::set_satellite(unsigned int satellite) //Conjugate the local code //! \TODO Optimize it ! Try conj() or Armadillo for (unsigned int i = 0; i < d_samples; i++) - { - d_fft_codes[i] = std::complex( - d_fft_if->get_outbuf()[i].real(), - -d_fft_if->get_outbuf()[i].imag()); - } + { + d_fft_codes[i] = std::complex( + d_fft_if->get_outbuf()[i].real(), + -d_fft_if->get_outbuf()[i].imag()); + } } signed int gps_l1_ca_tong_pcps_acquisition_cc::prn_code_phase() { @@ -168,170 +168,170 @@ int gps_l1_ca_tong_pcps_acquisition_cc::general_work(int noutput_items, { if (!d_active) - { - // sample counter - d_sample_counter += d_samples * noutput_items; - consume_each(noutput_items); - } + { + // sample counter + d_sample_counter += d_samples * noutput_items; + consume_each(noutput_items); + } else - { - d_sample_counter += d_samples; - - // initialize acquisition algorithm - - bool positive_acquisition = false; - int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL - - //float noise_envelope = 0.0; - float vt = 20000; - //float peak = 0.0; - float magt = 0.0; - unsigned int max_freq_step = 2 * (unsigned int)(d_doppler_max - / d_doppler_step); - unsigned int indext = 0; - - // Get the input samples pointer - const gr_complex *in = (const gr_complex *)input_items[0]; - - // aux vars - std::stringstream filename; - //unsigned int consume_items = 1; - - // complex file write - // std::streamsize n = 2 * sizeof(float) * (d_samples); - - // 1 - Compute the input noise envelope estimation and the threshold vt - - // sine_gen_complex( d_if_sin, d_freq + doppler, d_fs_in, d_samples ); - // - // noise_envelope = calculate_envelope( in, d_aux_ca_code, d_if_sin ); - // vt = noise_envelope * sqrt( -2 * log( d_pfa ) ); - - - // 1- Compute the input signal power estimation - for (unsigned int i = 0; i < d_samples; i++) { - d_noise_power += std::abs(in[i]); - } - d_noise_power = sqrt(d_noise_power / (float)d_samples); + d_sample_counter += d_samples; - //2. Perform the carrier wipe-off - sine_gen_complex(d_if_sin, d_freq + d_doppler, d_fs_in, d_samples); - for (unsigned int i = 0; i < d_samples; i++) - { - d_fft_if->get_inbuf()[i] = in[i] * d_if_sin[i]; - } + // initialize acquisition algorithm - //3- Perform the FFT-based circular convolution (parallel time search) - d_fft_if->execute(); + bool positive_acquisition = false; + int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL - //TODO Optimize me: use Armadillo! - for (unsigned int i = 0; i < d_samples; i++) - { - d_ifft->get_inbuf()[i] = d_fft_if->get_outbuf()[i] - * d_fft_codes[i]; - } + //float noise_envelope = 0.0; + float vt = 20000; + //float peak = 0.0; + float magt = 0.0; + unsigned int max_freq_step = 2 * (unsigned int)(d_doppler_max + / d_doppler_step); + unsigned int indext = 0; - d_ifft->execute(); + // Get the input samples pointer + const gr_complex *in = (const gr_complex *)input_items[0]; - x86_gr_complex_mag(d_ifft->get_outbuf(), d_samples); // d_ifft->get_outbuf()=|abs(路)|^2 and the array is converted from CPX->Float - x86_float_max((float*)d_ifft->get_outbuf(), &d_indext, &magt, - d_samples); // find max of |abs(路)|^2 -> index and magt - magt = sqrt(magt) / (float)d_samples; - d_test_statistics = magt / d_noise_power; + // aux vars + std::stringstream filename; + //unsigned int consume_items = 1; - LOG_AT_LEVEL(INFO) << "Channel: " << d_channel - << ", doing Tong PCSS acquisition of satellite: " - << d_satellite << ", sample stamp: " << d_sample_counter - << ", bin_freq " << d_doppler << ", doppler_max: " - << d_doppler_max << ", K " << d_K << ", sigma: " - << d_noise_power << ", mag: " << d_test_statistics - << ", vt: " << vt; + // complex file write + // std::streamsize n = 2 * sizeof(float) * (d_samples); - if ((d_test_statistics > vt) && (indext = d_indext)) - { - d_K++; - if (d_K == d_A) - { - d_code_phase = d_indext; - positive_acquisition = true; - d_doppler_freq = d_doppler; - d_acq_sample_stamp = d_sample_counter; - LOG_AT_LEVEL(INFO) << "positive acquisition"; - LOG_AT_LEVEL(INFO) << "satellite " << d_satellite; - LOG_AT_LEVEL(INFO) << "sample_stamp " << d_sample_counter; - LOG_AT_LEVEL(INFO) << "test statistics value " - << d_test_statistics; - LOG_AT_LEVEL(INFO) << "test statistics threshold " << vt; - LOG_AT_LEVEL(INFO) << "code phase " << d_code_phase; - LOG_AT_LEVEL(INFO) << "doppler " << d_doppler_freq; - LOG_AT_LEVEL(INFO) << "magnitude " << magt; - LOG_AT_LEVEL(INFO) << "input signal power " << d_noise_power; - d_dwells = 0; - d_active = false; - } - else d_dwells++; - } - else - { - d_K--; - if ((d_K == 0) || (d_dwells > d_max_dwells)) - { - d_K = d_B; - d_dwells = 0; - d_fbins++; - if (d_fbins > max_freq_step) + // 1 - Compute the input noise envelope estimation and the threshold vt + + // sine_gen_complex( d_if_sin, d_freq + doppler, d_fs_in, d_samples ); + // + // noise_envelope = calculate_envelope( in, d_aux_ca_code, d_if_sin ); + // vt = noise_envelope * sqrt( -2 * log( d_pfa ) ); + + + // 1- Compute the input signal power estimation + for (unsigned int i = 0; i < d_samples; i++) { - d_fbins = 0; - LOG_AT_LEVEL(INFO) << "negative acquisition"; - LOG_AT_LEVEL(INFO) << "satellite " << d_satellite; - LOG_AT_LEVEL(INFO) << "sample_stamp" << d_sample_counter; - LOG_AT_LEVEL(INFO) << "test statistics value " - << d_test_statistics; - LOG_AT_LEVEL(INFO) << "test statistics threshold " << vt; - LOG_AT_LEVEL(INFO) << "input signal power " - << d_noise_power; - d_active = false; + d_noise_power += std::abs(in[i]); } - else + d_noise_power = sqrt(d_noise_power / (float)d_samples); + + //2. Perform the carrier wipe-off + sine_gen_complex(d_if_sin, d_freq + d_doppler, d_fs_in, d_samples); + for (unsigned int i = 0; i < d_samples; i++) { - d_doppler = d_doppler + pow(-1, d_fbins + 1) * d_fbins - * d_doppler_step; + d_fft_if->get_inbuf()[i] = in[i] * d_if_sin[i]; } - } - else d_dwells++; - } - // Record results to files - // if( d_dump ) - // { - // filename.str( "" ); - // filename << "./data/fft_" << doppler << "_.dat"; - // std::cout << filename.str().c_str(); - // std::cout << ".\n"; - // d_dump_file.open( filename.str().c_str(), std::ios::out - // | std::ios::binary ); - // d_dump_file.write( (char*) d_ifft->get_outbuf(), n ); //write directly |abs(路)|^2 in this Doppler bin - // d_dump_file.close(); - // } + //3- Perform the FFT-based circular convolution (parallel time search) + d_fft_if->execute(); + //TODO Optimize me: use Armadillo! + for (unsigned int i = 0; i < d_samples; i++) + { + d_ifft->get_inbuf()[i] = d_fft_if->get_outbuf()[i] + * d_fft_codes[i]; + } - if (d_active == false) - { - if (positive_acquisition) - { - acquisition_message = 1; - } + d_ifft->execute(); + + x86_gr_complex_mag(d_ifft->get_outbuf(), d_samples); // d_ifft->get_outbuf()=|abs(路)|^2 and the array is converted from CPX->Float + x86_float_max((float*)d_ifft->get_outbuf(), &d_indext, &magt, + d_samples); // find max of |abs(路)|^2 -> index and magt + magt = sqrt(magt) / (float)d_samples; + d_test_statistics = magt / d_noise_power; + + LOG_AT_LEVEL(INFO) << "Channel: " << d_channel + << ", doing Tong PCSS acquisition of satellite: " + << d_satellite << ", sample stamp: " << d_sample_counter + << ", bin_freq " << d_doppler << ", doppler_max: " + << d_doppler_max << ", K " << d_K << ", sigma: " + << d_noise_power << ", mag: " << d_test_statistics + << ", vt: " << vt; + + if ((d_test_statistics > vt) && (indext = d_indext)) + { + d_K++; + if (d_K == d_A) + { + d_code_phase = d_indext; + positive_acquisition = true; + d_doppler_freq = d_doppler; + d_acq_sample_stamp = d_sample_counter; + LOG_AT_LEVEL(INFO) << "positive acquisition"; + LOG_AT_LEVEL(INFO) << "satellite " << d_satellite; + LOG_AT_LEVEL(INFO) << "sample_stamp " << d_sample_counter; + LOG_AT_LEVEL(INFO) << "test statistics value " + << d_test_statistics; + LOG_AT_LEVEL(INFO) << "test statistics threshold " << vt; + LOG_AT_LEVEL(INFO) << "code phase " << d_code_phase; + LOG_AT_LEVEL(INFO) << "doppler " << d_doppler_freq; + LOG_AT_LEVEL(INFO) << "magnitude " << magt; + LOG_AT_LEVEL(INFO) << "input signal power " << d_noise_power; + d_dwells = 0; + d_active = false; + } + else d_dwells++; + } else - { - acquisition_message = 2; - } + { + d_K--; + if ((d_K == 0) || (d_dwells > d_max_dwells)) + { + d_K = d_B; + d_dwells = 0; + d_fbins++; + if (d_fbins > max_freq_step) + { + d_fbins = 0; + LOG_AT_LEVEL(INFO) << "negative acquisition"; + LOG_AT_LEVEL(INFO) << "satellite " << d_satellite; + LOG_AT_LEVEL(INFO) << "sample_stamp" << d_sample_counter; + LOG_AT_LEVEL(INFO) << "test statistics value " + << d_test_statistics; + LOG_AT_LEVEL(INFO) << "test statistics threshold " << vt; + LOG_AT_LEVEL(INFO) << "input signal power " + << d_noise_power; + d_active = false; + } + else + { + d_doppler = d_doppler + pow(-1, d_fbins + 1) * d_fbins + * d_doppler_step; + } + } + else d_dwells++; + } - d_channel_internal_queue->push(acquisition_message); + // Record results to files + // if( d_dump ) + // { + // filename.str( "" ); + // filename << "./data/fft_" << doppler << "_.dat"; + // std::cout << filename.str().c_str(); + // std::cout << ".\n"; + // d_dump_file.open( filename.str().c_str(), std::ios::out + // | std::ios::binary ); + // d_dump_file.write( (char*) d_ifft->get_outbuf(), n ); //write directly |abs(路)|^2 in this Doppler bin + // d_dump_file.close(); + // } + + + if (d_active == false) + { + if (positive_acquisition) + { + acquisition_message = 1; + } + else + { + acquisition_message = 2; + } + + d_channel_internal_queue->push(acquisition_message); + } + + consume_each(1); } - - consume_each(1); - } return 0; } @@ -344,10 +344,10 @@ float gps_l1_ca_tong_pcps_acquisition_cc::calculate_envelope( //std::cout << "tmp_cpx " << tmp_cpx << std::endl; for (unsigned int i = 0; i < d_samples; i++) - { - tmp_cpx = tmp_cpx + _input_signal[i] * _local_code[i] - * _local_if_sin[i]; - } + { + tmp_cpx = tmp_cpx + _input_signal[i] * _local_code[i] + * _local_if_sin[i]; + } //std::cout << "tmp_cpx " << tmp_cpx << std::endl; mag = abs(tmp_cpx); diff --git a/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_tong_pcps_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_tong_pcps_acquisition_cc.h index 9c6a733d7..b4d93e1f7 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_tong_pcps_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_tong_pcps_acquisition_cc.h @@ -44,10 +44,12 @@ #include "concurrent_queue.h" class gps_l1_ca_tong_pcps_acquisition_cc; + typedef boost::shared_ptr - gps_l1_ca_tong_pcps_acquisition_cc_sptr; + gps_l1_ca_tong_pcps_acquisition_cc_sptr; + gps_l1_ca_tong_pcps_acquisition_cc_sptr -gps_l1_ca_tong_pcps_make_acquisition_cc(unsigned int sampled_ms, + gps_l1_ca_tong_pcps_make_acquisition_cc(unsigned int sampled_ms, unsigned int doppler_max, long freq, long fs_in, int samples_per_ms, gr_msg_queue_sptr queue, bool dump, std::string dump_filename); diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index f2cd09683..657e6e696 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -4,8 +4,6 @@ * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Luis Esteve, 2011. luis(at)epsilon-formacion.com * - * Detailed description of the file here if needed. - * * ------------------------------------------------------------------------- * * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) @@ -32,34 +30,30 @@ */ #include "channel.h" - #include "acquisition_interface.h" #include "tracking_interface.h" #include "telemetry_decoder_interface.h" #include "configuration_interface.h" #include "gnss_flowgraph.h" - #include #include #include #include - #include #include - #include #include using google::LogMessage; -//! Constructor +// Constructor Channel::Channel(ConfigurationInterface *configuration, unsigned int channel, GNSSBlockInterface *pass_through, AcquisitionInterface *acq, TrackingInterface *trk, TelemetryDecoderInterface *nav, std::string role, std::string implementation, gr_msg_queue_sptr queue) : - pass_through_(pass_through), acq_(acq), trk_(trk), nav_(nav), - role_(role), implementation_(implementation), channel_(channel), - queue_(queue) + pass_through_(pass_through), acq_(acq), trk_(trk), nav_(nav), + role_(role), implementation_(implementation), channel_(channel), + queue_(queue) { stop_ = false; @@ -95,7 +89,7 @@ Channel::Channel(ConfigurationInterface *configuration, unsigned int channel, } -//! Destructor +// Destructor Channel::~Channel() { @@ -109,10 +103,10 @@ void Channel::connect(gr_top_block_sptr top_block) { if (connected_) - { - LOG_AT_LEVEL(WARNING) << "channel already connected internally"; - return; - } + { + LOG_AT_LEVEL(WARNING) << "channel already connected internally"; + return; + } pass_through_->connect(top_block); acq_->connect(top_block); @@ -140,10 +134,10 @@ void Channel::disconnect(gr_top_block_sptr top_block) { if (!connected_) - { - LOG_AT_LEVEL(WARNING) << "Channel already disconnected internally"; - return; - } + { + LOG_AT_LEVEL(WARNING) << "Channel already disconnected internally"; + return; + } top_block->disconnect(acq_->get_right_block(), 0, trk_->get_left_block(), 0); @@ -190,15 +184,15 @@ void Channel::run() { start_acquisition(); while (!stop_) - { - channel_internal_queue_.wait_and_pop(message_); - process_channel_messages(); - } + { + channel_internal_queue_.wait_and_pop(message_); + process_channel_messages(); + } } /* - * \brief Set stop_ to true and blocks the calling thread until + * Set stop_ to true and blocks the calling thread until * the thread of the constructor has completed */ void Channel::stop() @@ -224,46 +218,46 @@ void Channel::process_channel_messages() { switch (message_) { - case 0: + case 0: - LOG_AT_LEVEL(INFO) << "Stop channel " << channel_; + LOG_AT_LEVEL(INFO) << "Stop channel " << channel_; - break; + break; - case 1: + case 1: - LOG_AT_LEVEL(INFO) << "Channel " << channel_ - << " ACQ SUCCESS satellite " << satellite_; - channel_fsm_.Event_gps_valid_acquisition(); + LOG_AT_LEVEL(INFO) << "Channel " << channel_ + << " ACQ SUCCESS satellite " << satellite_; + channel_fsm_.Event_gps_valid_acquisition(); - break; + break; - case 2: + case 2: - LOG_AT_LEVEL(INFO) << "Channel " << channel_ - << " ACQ FAILED satellite " << satellite_; - if (repeat_ == true) + LOG_AT_LEVEL(INFO) << "Channel " << channel_ + << " ACQ FAILED satellite " << satellite_; + if (repeat_ == true) { channel_fsm_.Event_gps_failed_acquisition_repeat(); } - else + else { channel_fsm_.Event_gps_failed_acquisition_no_repeat(); } - break; + break; - case 3: - LOG_AT_LEVEL(INFO) << "Channel " << channel_ - << " TRACKING FAILED satellite " << satellite_ - << ", reacquisition."; - channel_fsm_.Event_gps_failed_tracking(); + case 3: + LOG_AT_LEVEL(INFO) << "Channel " << channel_ + << " TRACKING FAILED satellite " << satellite_ + << ", reacquisition."; + channel_fsm_.Event_gps_failed_tracking(); - break; + break; - default: + default: - LOG_AT_LEVEL(WARNING) << "Default case, invalid message."; - break; + LOG_AT_LEVEL(WARNING) << "Default case, invalid message."; + break; } } diff --git a/src/algorithms/channel/adapters/channel.h b/src/algorithms/channel/adapters/channel.h index 7aef4d561..279c2b487 100644 --- a/src/algorithms/channel/adapters/channel.h +++ b/src/algorithms/channel/adapters/channel.h @@ -1,6 +1,6 @@ /*! * \file channel.h - * \brief This class represents a GNSS channel. + * \brief Interface of a GNSS channel. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Luis Esteve, 2011. luis(at)epsilon-formacion.com * @@ -88,6 +88,11 @@ public: void start_acquisition(); void set_satellite(unsigned int satellite); void start(); + + /*! + * \brief Set stop_ to true and blocks the calling thread until + * the thread of the constructor has completed + */ void stop(); private: diff --git a/src/algorithms/channel/libs/gps_l1_ca_channel_fsm.cc b/src/algorithms/channel/libs/gps_l1_ca_channel_fsm.cc index 19b841cf1..f8b86798a 100644 --- a/src/algorithms/channel/libs/gps_l1_ca_channel_fsm.cc +++ b/src/algorithms/channel/libs/gps_l1_ca_channel_fsm.cc @@ -1,10 +1,8 @@ /*! * \file gps_l1_ca_channel_fsm.cc - * \briefState Machine for channel using boost::statechart + * \brief Implementation of a State Machine for channel using boost::statechart * \author Luis Esteve, 2011. luis(at)epsilon-formacion.com * - * Detailed description of the file here if needed. - * * ------------------------------------------------------------------------- * * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) @@ -33,32 +31,31 @@ #include "gps_l1_ca_channel_fsm.h" #include "control_message_factory.h" #include "channel.h" - #include #include struct Ev_gps_channel_start_acquisition: sc::event< - Ev_gps_channel_start_acquisition> +Ev_gps_channel_start_acquisition> {}; struct Ev_gps_channel_valid_acquisition: sc::event< - Ev_gps_channel_valid_acquisition> +Ev_gps_channel_valid_acquisition> {}; struct Ev_gps_channel_failed_acquisition_repeat: sc::event< - Ev_gps_channel_failed_acquisition_repeat> +Ev_gps_channel_failed_acquisition_repeat> {}; struct Ev_gps_channel_failed_acquisition_no_repeat: sc::event< - Ev_gps_channel_failed_acquisition_no_repeat> +Ev_gps_channel_failed_acquisition_no_repeat> {}; struct Ev_gps_channel_failed_tracking: sc::event< - Ev_gps_channel_failed_tracking> +Ev_gps_channel_failed_tracking> {}; struct gps_channel_idle_fsm_S0: public sc::state +GpsL1CaChannelFsm> { public: // sc::transition(event, next state) @@ -72,7 +69,7 @@ public: }; struct gps_channel_acquiring_fsm_S1: public sc::state< - gps_channel_acquiring_fsm_S1, GpsL1CaChannelFsm> +gps_channel_acquiring_fsm_S1, GpsL1CaChannelFsm> { public: typedef mpl::list, sc::transition< Ev_gps_channel_valid_acquisition, gps_channel_tracking_fsm_S2> > - reactions; + reactions; gps_channel_acquiring_fsm_S1(my_context ctx) : my_base(ctx) @@ -92,7 +89,7 @@ public: }; struct gps_channel_tracking_fsm_S2: public sc::state< - gps_channel_tracking_fsm_S2, GpsL1CaChannelFsm> +gps_channel_tracking_fsm_S2, GpsL1CaChannelFsm> { public: typedef sc::transition +gps_channel_waiting_fsm_S3, GpsL1CaChannelFsm> { public: typedef sc::transitionhandle(cmf->GetQueueMessage(channel_, 0)); - } + { + queue_->handle(cmf->GetQueueMessage(channel_, 0)); + } delete cmf; } diff --git a/src/algorithms/channel/libs/gps_l1_ca_channel_fsm.h b/src/algorithms/channel/libs/gps_l1_ca_channel_fsm.h index 6fe724058..a120974a8 100644 --- a/src/algorithms/channel/libs/gps_l1_ca_channel_fsm.h +++ b/src/algorithms/channel/libs/gps_l1_ca_channel_fsm.h @@ -59,8 +59,7 @@ struct gps_channel_waiting_fsm_S3; /*! * \brief This class implements a State Machine for channel using boost::statechart */ -class GpsL1CaChannelFsm: public sc::state_machine +class GpsL1CaChannelFsm: public sc::state_machine { public: diff --git a/src/algorithms/conditioner/adapters/direct_resampler_conditioner.cc b/src/algorithms/conditioner/adapters/direct_resampler_conditioner.cc index 7e34cb481..3784caddb 100644 --- a/src/algorithms/conditioner/adapters/direct_resampler_conditioner.cc +++ b/src/algorithms/conditioner/adapters/direct_resampler_conditioner.cc @@ -1,10 +1,9 @@ /*! * \file direct_resampler_conditioner.cc - * \brief Brief description of the file here + * \brief Implementation of an adapter of a direct resampler conditioner block + * to a SignalConditionerInterface * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * - * Detailed description of the file here if needed. - * * ------------------------------------------------------------------------- * * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) @@ -31,15 +30,11 @@ */ #include "direct_resampler_conditioner.h" - // #include #include - #include "direct_resampler_conditioner_cc.h" #include "direct_resampler_conditioner_ss.h" - #include "configuration_interface.h" - #include #include @@ -48,7 +43,7 @@ using google::LogMessage; DirectResamplerConditioner::DirectResamplerConditioner( ConfigurationInterface* configuration, std::string role, unsigned int in_stream, unsigned int out_stream) : - role_(role), in_stream_(in_stream), out_stream_(out_stream) + role_(role), in_stream_(in_stream), out_stream_(out_stream) { std::string default_item_type = "short"; @@ -65,64 +60,62 @@ DirectResamplerConditioner::DirectResamplerConditioner( default_dump_file); if (item_type_.compare("gr_complex") == 0) - { - item_size_ = sizeof(gr_complex); - resampler_ = direct_resampler_make_conditioner_cc(sample_freq_in_, - sample_freq_out_); - } + { + item_size_ = sizeof(gr_complex); + resampler_ = direct_resampler_make_conditioner_cc(sample_freq_in_, + sample_freq_out_); + } else if (item_type_.compare("short") == 0) - { - item_size_ = sizeof(short); - resampler_ = direct_resampler_make_conditioner_ss(sample_freq_in_, - sample_freq_out_); - } + { + item_size_ = sizeof(short); + resampler_ = direct_resampler_make_conditioner_ss(sample_freq_in_, + sample_freq_out_); + } else - { - LOG_AT_LEVEL(WARNING) << item_type_ - << " unrecognized item type. Using short"; - item_size_ = sizeof(short); - } + { + LOG_AT_LEVEL(WARNING) << item_type_ + << " unrecognized item type. Using short"; + item_size_ = sizeof(short); + } if (dump_) - { - DLOG(INFO) << "Dumping output into file " << dump_filename_; - file_sink_ = gr_make_file_sink(item_size_, dump_filename_.c_str()); - } + { + DLOG(INFO) << "Dumping output into file " << dump_filename_; + file_sink_ = gr_make_file_sink(item_size_, dump_filename_.c_str()); + } DLOG(INFO) << "sample_freq_in " << sample_freq_in_; DLOG(INFO) << "sample_freq_out" << sample_freq_out_; DLOG(INFO) << "Item size " << item_size_; DLOG(INFO) << "resampler(" << resampler_->unique_id() << ")"; if (dump_) - { - DLOG(INFO) << "file_sink(" << file_sink_->unique_id() << ")"; - } -} -DirectResamplerConditioner::~DirectResamplerConditioner() -{ + { + DLOG(INFO) << "file_sink(" << file_sink_->unique_id() << ")"; + } } +DirectResamplerConditioner::~DirectResamplerConditioner() {} void DirectResamplerConditioner::connect(gr_top_block_sptr top_block) { if (dump_) - { - top_block->connect(resampler_, 0, file_sink_, 0); - DLOG(INFO) << "connected resampler to file sink"; - } + { + top_block->connect(resampler_, 0, file_sink_, 0); + DLOG(INFO) << "connected resampler to file sink"; + } else - { - DLOG(INFO) << "nothing to connect internally"; - } + { + DLOG(INFO) << "nothing to connect internally"; + } } void DirectResamplerConditioner::disconnect(gr_top_block_sptr top_block) { if (dump_) - { - top_block->disconnect(resampler_, 0, file_sink_, 0); - } + { + top_block->disconnect(resampler_, 0, file_sink_, 0); + } } gr_basic_block_sptr DirectResamplerConditioner::get_left_block() diff --git a/src/algorithms/conditioner/adapters/direct_resampler_conditioner.h b/src/algorithms/conditioner/adapters/direct_resampler_conditioner.h index 249000bb6..e098e7487 100644 --- a/src/algorithms/conditioner/adapters/direct_resampler_conditioner.h +++ b/src/algorithms/conditioner/adapters/direct_resampler_conditioner.h @@ -1,10 +1,9 @@ /*! * \file direct_resampler_conditioner.h - * \brief This class represents a direct resampler. + * \brief Interface of an adapter of a direct resampler conditioner block + * to a SignalConditionerInterface * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * - * Detailed description of the file here if needed. - * * ------------------------------------------------------------------------- * * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) @@ -42,9 +41,10 @@ class DirectResamplerConditioner: public GNSSBlockInterface { public: - DirectResamplerConditioner(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, - unsigned int out_stream); + DirectResamplerConditioner(ConfigurationInterface* configuration, + std::string role, unsigned int in_stream, + unsigned int out_stream); + virtual ~DirectResamplerConditioner(); std::string role() @@ -70,7 +70,6 @@ private: std::string role_; unsigned int in_stream_; unsigned int out_stream_; - std::string item_type_; size_t item_size_; long samples_; @@ -78,7 +77,6 @@ private: std::string dump_filename_; double sample_freq_in_; double sample_freq_out_; - gr_block_sptr resampler_; gr_block_sptr file_sink_; }; diff --git a/src/algorithms/libs/gnss_sdr_valve.h b/src/algorithms/libs/gnss_sdr_valve.h index 705ddca7f..376c451fc 100644 --- a/src/algorithms/libs/gnss_sdr_valve.h +++ b/src/algorithms/libs/gnss_sdr_valve.h @@ -1,11 +1,9 @@ /*! * \file gnss_sdr_valve.h - * \brief This class implements a GNU Radio block that sends a STOP message to the + * \brief Interface of a GNU Radio block that sends a STOP message to the * control queue right after a specific number of samples have passed through it. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * - * Detailed description of the file here if needed. - * * ------------------------------------------------------------------------- * * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) @@ -34,8 +32,8 @@ -#ifndef GNSS_SDR_VALVE_H_ -#define GNSS_SDR_VALVE_H_ +#ifndef GNSS_SDR_GNSS_SDR_VALVE_H_ +#define GNSS_SDR_GNSS_SDR_VALVE_H_ #include #include @@ -66,4 +64,4 @@ public: gr_vector_void_star &output_items); }; -#endif /*GNSS_SDR_VALVE_H_*/ +#endif /*GNSS_SDR_GNSS_SDR_VALVE_H_*/ diff --git a/src/algorithms/libs/pass_through.cc b/src/algorithms/libs/pass_through.cc index c4b861d48..ab5477c65 100644 --- a/src/algorithms/libs/pass_through.cc +++ b/src/algorithms/libs/pass_through.cc @@ -1,6 +1,7 @@ /*! * \file pass_through.cc - * \brief Brief description of the file here + * \brief Implementation of a block that just puts its input in its + * output. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * * Detailed description of the file here if needed. @@ -33,14 +34,10 @@ #include "pass_through.h" - #include - #include - #include #include - #include "configuration_interface.h" using google::LogMessage; diff --git a/src/algorithms/libs/pass_through.h b/src/algorithms/libs/pass_through.h index 303855cd6..25f51e333 100644 --- a/src/algorithms/libs/pass_through.h +++ b/src/algorithms/libs/pass_through.h @@ -1,6 +1,6 @@ /*! * \file pass_through.h - * \brief This class represent a block that just puts its input in its + * \brief Interface of a block that just puts its input in its * output. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * @@ -33,13 +33,12 @@ -#ifndef PASS_THROUGH_H_ -#define PASS_THROUGH_H_ +#ifndef GNSS_SDR_PASS_THROUGH_H_ +#define GNSS_SDR_PASS_THROUGH_H_ #include #include #include - #include "gnss_block_interface.h" class ConfigurationInterface; @@ -94,4 +93,4 @@ private: size_t item_size_; }; -#endif /*PASS_THROUGH_H_*/ +#endif /*GNSS_SDR_PASS_THROUGH_H_*/ diff --git a/src/algorithms/observables/adapters/gps_l1_ca_observables.cc b/src/algorithms/observables/adapters/gps_l1_ca_observables.cc index 7e7b994fd..3d23c38e4 100644 --- a/src/algorithms/observables/adapters/gps_l1_ca_observables.cc +++ b/src/algorithms/observables/adapters/gps_l1_ca_observables.cc @@ -1,10 +1,9 @@ /*! * \file gps_l1_ca_observables.cc - * \brief Brief description of the file here + * \brief Implementation of an adapter of a GPS L1 C/A observables block + * to a SignalConditionerInterface * \author Javier Arribas, 2011. jarribas(at)cttc.es * - * Detailed description of the file here if needed. - * * ------------------------------------------------------------------------- * * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) @@ -31,17 +30,12 @@ */ - #include "gps_l1_ca_observables.h" - #include "configuration_interface.h" - #include "gps_l1_ca_observables_cc.h" - #include #include #include - #include #include @@ -60,8 +54,8 @@ GpsL1CaObservables::GpsL1CaObservables(ConfigurationInterface* configuration, queue_(queue) { - int output_rate_ms; - output_rate_ms=configuration->property(role + ".output_rate_ms", 500); + int output_rate_ms; + output_rate_ms=configuration->property(role + ".output_rate_ms", 500); std::string default_dump_filename = "./observables.dat"; @@ -74,8 +68,8 @@ GpsL1CaObservables::GpsL1CaObservables(ConfigurationInterface* configuration, dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); fs_in_ = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); - observables_ = gps_l1_ca_make_observables_cc(in_streams_, queue_, dump_,dump_filename_,output_rate_ms,flag_averaging); - observables_->set_fs_in(fs_in_); + observables_ = gps_l1_ca_make_observables_cc(in_streams_, queue_, dump_,dump_filename_,output_rate_ms,flag_averaging); + observables_->set_fs_in(fs_in_); DLOG(INFO) << "pseudorange(" << observables_->unique_id() << ")"; // set the navigation msg queue; diff --git a/src/algorithms/observables/adapters/gps_l1_ca_observables.h b/src/algorithms/observables/adapters/gps_l1_ca_observables.h index 965106e79..62dde1b32 100644 --- a/src/algorithms/observables/adapters/gps_l1_ca_observables.h +++ b/src/algorithms/observables/adapters/gps_l1_ca_observables.h @@ -1,10 +1,9 @@ /*! * \file gps_l1_ca_observables.h - * \brief Brief description of the file here + * \brief Interface of an adapter of a GPS L1 C/A observables block + * to a SignalConditionerInterface * \author Javier Arribas, 2011. jarribas(at)cttc.es * - * Detailed description of the file here if needed. - * * ------------------------------------------------------------------------- * * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) diff --git a/src/algorithms/observables/gnuradio_blocks/gps_l1_ca_observables_cc.cc b/src/algorithms/observables/gnuradio_blocks/gps_l1_ca_observables_cc.cc index 9b569581c..746583d09 100644 --- a/src/algorithms/observables/gnuradio_blocks/gps_l1_ca_observables_cc.cc +++ b/src/algorithms/observables/gnuradio_blocks/gps_l1_ca_observables_cc.cc @@ -1,6 +1,6 @@ /*! * \file gps_l1_ca_observables_cc.cc - * \brief Pseudorange computation module for GPS L1 C/A + * \brief Implementation of the pseudorange computation block for GPS L1 C/A * \author Javier Arribas, 2011. jarribas(at)cttc.es * ------------------------------------------------------------------------- * @@ -32,17 +32,12 @@ #include #include #include -# include - +#include #include #include "math.h" - #include "gps_l1_ca_observables_cc.h" - #include "control_message_factory.h" - #include - #include #include diff --git a/src/algorithms/observables/gnuradio_blocks/gps_l1_ca_observables_cc.h b/src/algorithms/observables/gnuradio_blocks/gps_l1_ca_observables_cc.h index 1c2e8aa9b..b776a8417 100644 --- a/src/algorithms/observables/gnuradio_blocks/gps_l1_ca_observables_cc.h +++ b/src/algorithms/observables/gnuradio_blocks/gps_l1_ca_observables_cc.h @@ -1,6 +1,6 @@ /*! * \file gps_l1_ca_observables_cc.h - * \brief Interface of the pseudorange computation module for GPS L1 C/A + * \brief Interface of the pseudorange computation block for GPS L1 C/A * \author Javier Arribas, 2011. jarribas(at)cttc.es * ------------------------------------------------------------------------- * diff --git a/src/algorithms/output_filter/adapters/file_output_filter.cc b/src/algorithms/output_filter/adapters/file_output_filter.cc index da1fb1b5c..9e8a32732 100644 --- a/src/algorithms/output_filter/adapters/file_output_filter.cc +++ b/src/algorithms/output_filter/adapters/file_output_filter.cc @@ -1,10 +1,9 @@ /*! * \file file_output_filter.cc - * \brief Brief description of the file here + * \brief Implementation of an adapter of a file output filter block + * to an OutputFilterInterface * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * - * Detailed description of the file here if needed. - * * ------------------------------------------------------------------------- * * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) @@ -30,15 +29,10 @@ * ------------------------------------------------------------------------- */ - - #include "file_output_filter.h" - #include #include - #include - #include "configuration_interface.h" using google::LogMessage; diff --git a/src/algorithms/output_filter/adapters/file_output_filter.h b/src/algorithms/output_filter/adapters/file_output_filter.h index 2db50c34d..1b3dddcae 100644 --- a/src/algorithms/output_filter/adapters/file_output_filter.h +++ b/src/algorithms/output_filter/adapters/file_output_filter.h @@ -1,11 +1,10 @@ /*! * \file file_output_filter.h - * \brief This class represents an output filter that sends its output - * to a file without any change in the data format. + * \brief Interface of an adapter of a file output filter block to an + * OutputFilterInterface * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * * - * * ------------------------------------------------------------------------- * * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) @@ -41,6 +40,10 @@ class ConfigurationInterface; +/*! + * \brief An output filter that sends its output + * to a file without any change in the data format. + */ class FileOutputFilter : public GNSSBlockInterface { @@ -74,7 +77,6 @@ private: gr_file_sink_sptr file_sink_; size_t item_size_; - std::string filename_; std::string item_type_; std::string role_; diff --git a/src/algorithms/output_filter/adapters/null_sink_output_filter.cc b/src/algorithms/output_filter/adapters/null_sink_output_filter.cc index 8961b3237..c453cc2cb 100644 --- a/src/algorithms/output_filter/adapters/null_sink_output_filter.cc +++ b/src/algorithms/output_filter/adapters/null_sink_output_filter.cc @@ -1,10 +1,9 @@ /*! * \file null_sink_output_filter.cc - * \brief Brief description of the file here + * \brief Implementation of an adapter of a null sink output filter block to an + * OutputFilterInterface * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * - * Detailed description of the file here if needed. - * * ------------------------------------------------------------------------- * * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) @@ -33,12 +32,9 @@ #include "null_sink_output_filter.h" - #include #include - #include - #include "configuration_interface.h" using google::LogMessage; diff --git a/src/algorithms/output_filter/adapters/null_sink_output_filter.h b/src/algorithms/output_filter/adapters/null_sink_output_filter.h index c05c916ba..c54da6d4b 100644 --- a/src/algorithms/output_filter/adapters/null_sink_output_filter.h +++ b/src/algorithms/output_filter/adapters/null_sink_output_filter.h @@ -1,6 +1,7 @@ /*! * \file null_sink_output_filter.h - * \brief Interface of a null sink output filter + * \brief Interface of an adapter of a null sink output filter block to an + * OutputFilterInterface * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * * This class represents an implementation of an output filter that diff --git a/src/algorithms/signal_source/adapters/file_signal_source.cc b/src/algorithms/signal_source/adapters/file_signal_source.cc index 661a08e5b..38d2b31e3 100644 --- a/src/algorithms/signal_source/adapters/file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/file_signal_source.cc @@ -1,11 +1,10 @@ /*! * \file file_signal_source.cc - * \brief Brief description of the file here + * \brief Implementation of a class that reads signals samples from a file + * and adapts it to a SignalSourceInterface * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Javier Arribas, 2011 jarribas(at)cttc.es * - * Detailed description of the file here if needed. - * * ------------------------------------------------------------------------- * * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) @@ -32,10 +31,8 @@ */ #include "file_signal_source.h" - #include "gnss_sdr_valve.h" #include "configuration_interface.h" - #include #include #include @@ -43,7 +40,6 @@ #include #include #include - #include using google::LogMessage; @@ -106,7 +102,7 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration, { /*! * BUG workaround: The GNURadio file source does not stop the receiver after reaching the End of File. - * A possible solution is to compute the file lenght in samples using file size, excluding the last 100 milliseconds, and enable always the + * A possible solution is to compute the file length in samples using file size, excluding the last 100 milliseconds, and enable always the * valve block */ std::ifstream file (filename_.c_str(), std::ios::in|std::ios::binary|std::ios::ate); diff --git a/src/algorithms/signal_source/adapters/file_signal_source.h b/src/algorithms/signal_source/adapters/file_signal_source.h index 9d9a6d158..4d0c52870 100644 --- a/src/algorithms/signal_source/adapters/file_signal_source.h +++ b/src/algorithms/signal_source/adapters/file_signal_source.h @@ -1,10 +1,11 @@ /*! * \file file_signal_source.h - * \brief This class reads signals samples from a file + * \brief Interface of a class that reads signals samples from a file + * and adapts it to a SignalSourceInterface * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * - * This class represents a file signal source. Internally it uses a GNU Radio's gr_file_source - * a a connector to the data. + * This class represents a file signal source. Internally it uses a GNU Radio's + * gr_file_source as a connector to the data. * * ------------------------------------------------------------------------- * 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 ef6e30d7e..8243e1f47 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 @@ -1,10 +1,9 @@ /*! * \file gps_l1_ca_telemetry_decoder.cc - * \brief This class implements a NAV data decoder for GPS L1 C/A + * \brief Implementation of an adapter of a GPS L1 C/A NAV data decoder block + * to a TelemetryDecoderInterface * \author Javier Arribas, 2011. jarribas(at)cttc.es * - * Detailed description of the file here if needed. - * * ------------------------------------------------------------------------- * * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) @@ -31,7 +30,6 @@ */ - #include "gps_l1_ca_telemetry_decoder.h" #include "configuration_interface.h" #include "gps_l1_ca_telemetry_decoder_cc.h" 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 2fc3a6bd7..cd052952a 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 @@ -1,6 +1,7 @@ /*! * \file gps_l1_ca_telemetry_decoder.h - * \brief This class implements a NAV data decoder for GPS L1 C/A + * \brief Interface of an adapter of a GPS L1 C/A NAV data decoder block + * to a TelemetryDecoderInterface * \author Javier Arribas, 2011. jarribas(at)cttc.es * * ------------------------------------------------------------------------- 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 e5597e6d7..c2078a039 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 @@ -1,6 +1,7 @@ /*! * \file gps_l1_ca_telemetry_decoder_cc.cc - * \brief Navigation message demodulator based on the Kay Borre book MATLAB-based GPS receiver + * \brief Implementation of a NAV message demodulator block based on + * Kay Borre book MATLAB-based GPS receiver * \author Javier Arribas, 2011. jarribas(at)cttc.es * * ------------------------------------------------------------------------- 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 30af61842..765bdd7ce 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 @@ -1,6 +1,7 @@ /*! * \file gps_l1_ca_telemetry_decoder_cc.h - * \brief Navigation message demodulator based on the Kay Borre book MATLAB-based GPS receiver + * \brief Interface of a NAV message demodulator block based on + * Kay Borre book MATLAB-based GPS receiver * \author Javier Arribas, 2011. jarribas(at)cttc.es * ------------------------------------------------------------------------- * 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 3dc740344..4ef998faa 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 @@ -1,11 +1,13 @@ /*! * \file gps_l1_ca_dll_fll_pll_tracking.cc - * \brief code DLL + carrier FLL/PLL tracking + * \brief Implementation of an adapter of a code DLL + carrier FLL/PLL tracking + * loop for GPS L1 C/A to a TrackingInterface * \author Javier Arribas, 2011. jarribas(at)cttc.es * - * This file implements the code Delay Locked Loop (DLL) + carrier Phase Locked Loop (PLL) helped with a carrier Frequency Locked Loop (FLL) stage - * according to the algorithms described in [1] - * [1] E.D. Kaplan and C. Hegarty, Understanding GPS. Principles and + * This file implements the code Delay Locked Loop (DLL) + carrier Phase + * Locked Loop (PLL) helped with a carrier Frequency Locked Loop (FLL) + * according to the algorithms described in: + * E.D. Kaplan and C. Hegarty, Understanding GPS. Principles and * Applications, Second Edition, Artech House Publishers, 2005. * * ------------------------------------------------------------------------- @@ -40,18 +42,21 @@ #include #endif #include - #include #include using google::LogMessage; GpsL1CaDllFllPllTracking::GpsL1CaDllFllPllTracking( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams, + ConfigurationInterface* configuration, + std::string role, + unsigned int in_streams, unsigned int + out_streams, gr_msg_queue_sptr queue) : - role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_( - queue) + role_(role), + in_streams_(in_streams), + out_streams_(out_streams), + queue_(queue) { DLOG(INFO) << "role " << role; diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_fll_pll_tracking.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_fll_pll_tracking.h index 3f86a90a4..ba9fd4c38 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_fll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_fll_pll_tracking.h @@ -1,11 +1,13 @@ /*! * \file gps_l1_ca_dll_fll_pll_tracking.h - * \brief code DLL + carrier FLL/PLL tracking + * \brief Interface of an adapter of a code DLL + carrier FLL/PLL tracking + * loop for GPS L1 C/A to a TrackingInterface * \author Javier Arribas, 2011. jarribas(at)cttc.es * - * This file implements the code Delay Locked Loop (DLL) + carrier Phase Locked Loop (PLL) helped with a carrier Frequency Locked Loop (FLL) stage - * according to the algorithms described in [1] - * [1] E.D. Kaplan and C. Hegarty, Understanding GPS. Principles and + * This is the interface of a code Delay Locked Loop (DLL) + carrier + * Phase Locked Loop (PLL) helped with a carrier Frequency Locked Loop (FLL) + * according to the algorithms described in: + * E.D. Kaplan and C. Hegarty, Understanding GPS. Principles and * Applications, Second Edition, Artech House Publishers, 2005. * * ------------------------------------------------------------------------- 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 092582e55..938675855 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 @@ -1,12 +1,14 @@ /*! * \file gps_l1_ca_dll_pll_tracking.cc - * \brief code DLL + carrier PLL + * \brief Implementation of an adapter of a DLL+PLL tracking loop block + * for GPS L1 C/A to a TrackingInterface * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Javier Arribas, 2011. jarribas(at)cttc.es * - * Code DLL + carrier PLL according to the algorithms described in [1] - * [1] K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen, - * A Software-Defined GPS and Galileo Receiver. A Single-Frequency Approach, Birkha user, 2007 + * Code DLL + carrier PLL according to the algorithms described in: + * K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen, + * A Software-Defined GPS and Galileo Receiver. A Single-Frequency + * Approach, Birkhauser, 2007 * * ------------------------------------------------------------------------- * @@ -40,7 +42,6 @@ #include #endif #include - #include #include @@ -50,8 +51,8 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams, gr_msg_queue_sptr queue) : - role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_( - queue) + role_(role), in_streams_(in_streams), out_streams_(out_streams), + queue_(queue) { DLOG(INFO) << "role " << role; @@ -82,22 +83,22 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( std::string default_dump_filename = "./track_ch"; dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused! - #ifdef GNSS_SDR_USE_BOOST_ROUND +#ifdef GNSS_SDR_USE_BOOST_ROUND vector_length = round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); - #else +#else vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); - #endif +#endif //################# MAKE TRACKING GNURadio object ################### if (item_type.compare("gr_complex") == 0) - { - item_size_ = sizeof(gr_complex); - tracking_ = gps_l1_ca_dll_pll_make_tracking_cc(satellite_, f_if, - fs_in, vector_length, queue_, dump, dump_filename, pll_bw_hz,dll_bw_hz,early_late_space_chips); - } + { + item_size_ = sizeof(gr_complex); + tracking_ = gps_l1_ca_dll_pll_make_tracking_cc(satellite_, f_if, + fs_in, vector_length, queue_, dump, dump_filename, pll_bw_hz,dll_bw_hz,early_late_space_chips); + } else - { - LOG_AT_LEVEL(WARNING) << item_type << " unknown tracking item type."; - } + { + LOG_AT_LEVEL(WARNING) << item_type << " unknown tracking item type."; + } DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")"; } @@ -111,7 +112,7 @@ void GpsL1CaDllPllTracking::start_tracking() tracking_->start_tracking(); } -/*! +/* * Set satellite ID */ void GpsL1CaDllPllTracking::set_satellite(unsigned int satellite) @@ -121,7 +122,7 @@ void GpsL1CaDllPllTracking::set_satellite(unsigned int satellite) DLOG(INFO) << "satellite set to " << satellite_; } -/*! +/* * Set tracking channel unique ID */ void GpsL1CaDllPllTracking::set_channel(unsigned int channel) @@ -130,7 +131,7 @@ void GpsL1CaDllPllTracking::set_channel(unsigned int channel) tracking_->set_channel(channel); } -/*! +/* * Set tracking channel internal queue */ void GpsL1CaDllPllTracking::set_channel_queue( @@ -141,21 +142,24 @@ void GpsL1CaDllPllTracking::set_channel_queue( tracking_->set_channel_queue(channel_internal_queue_); } -/*! + +/* * Set acquisition code phase in samples */ void GpsL1CaDllPllTracking::set_prn_code_phase(signed int phase_samples) { return tracking_->set_acq_code_phase((float)phase_samples); } -/*! + +/* * Set acquisition Doppler frequency in Hz. */ void GpsL1CaDllPllTracking::set_doppler_freq_shift(float doppler_freq_hz) { return tracking_->set_acq_doppler(doppler_freq_hz); } -/*! + +/* * Set acquisition sample stamp in samples, in order to detect the delay between acquisition and tracking */ void GpsL1CaDllPllTracking::set_acq_sample_stamp( @@ -163,6 +167,7 @@ void GpsL1CaDllPllTracking::set_acq_sample_stamp( { return tracking_->set_acq_sample_stamp(sample_stamp); } + void GpsL1CaDllPllTracking::connect(gr_top_block_sptr top_block) { //nothing to connect, now the tracking uses gr_sync_decimator diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h index 4e0bd0249..ab34ba94a 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h @@ -1,12 +1,14 @@ /*! * \file gps_l1_ca_dll_pll_tracking.h - * \brief code DLL + carrier PLL + * \brief Interface of an adapter of a DLL+PLL tracking loop block + * for GPS L1 C/A to a TrackingInterface * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Javier Arribas, 2011. jarribas(at)cttc.es * - * Code DLL + carrier PLL according to the algorithms described in [1] - * [1] K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen, - * A Software-Defined GPS and Galileo Receiver. A Single-Frequency Approach, Birkha user, 2007 + * Code DLL + carrier PLL according to the algorithms described in: + * K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen, + * A Software-Defined GPS and Galileo Receiver. A Single-Frequency + * Approach, Birkha user, 2007 * * ------------------------------------------------------------------------- * @@ -76,14 +78,37 @@ public: gr_basic_block_sptr get_left_block(); gr_basic_block_sptr get_right_block(); + /*! + * \brief Set satellite ID + */ void set_satellite(unsigned int satellite); + + /*! + * \brief Set tracking channel unique ID + */ void set_channel(unsigned int channel); + + /*! + * \brief Set acquisition code phase in samples + */ void set_prn_code_phase(signed int phase_samples); + + /*! + * \brief Set acquisition Doppler frequency in Hz. + */ void set_doppler_freq_shift(float doppler_freq_hz); + + /*! + * \brief Set tracking channel internal queue + */ void set_channel_queue(concurrent_queue *channel_internal_queue); void start_tracking(); + /*! + * \brief Set acquisition sample stamp in samples, in order to detect + * the delay between acquisition and tracking + */ void set_acq_sample_stamp(unsigned long int sample_stamp); private: 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 ef1d9ac60..ad434282f 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 @@ -1,11 +1,12 @@ /*! * \file gps_l1_ca_dll_fll_pll_tracking_cc.cc - * \brief code DLL + carrier FLL/PLL tracking + * \brief Implementation of a code DLL + carrier FLL/PLL tracking block * \author Javier Arribas, 2011. jarribas(at)cttc.es * - * This file implements the code Delay Locked Loop (DLL) + carrier Phase Locked Loop (PLL) helped with a carrier Frequency Locked Loop (FLL) stage - * according to the algorithms described in [1] - * [1] E.D. Kaplan and C. Hegarty, Understanding GPS. Principles and + * This file implements the code Delay Locked Loop (DLL) + carrier + * Phase Locked Loop (PLL) helped with a carrier Frequency Locked Loop (FLL) + * according to the algorithms described in: + * E.D. Kaplan and C. Hegarty, Understanding GPS. Principles and * Applications, Second Edition, Artech House Publishers, 2005. * * ------------------------------------------------------------------------- @@ -39,16 +40,13 @@ #include "tracking_discriminators.h" #include "CN_estimators.h" #include "tracking_FLL_PLL_filter.h" - #include "control_message_factory.h" #include #include #include #include #include "math.h" - #include - #include #include @@ -124,7 +122,7 @@ gps_l1_ca_dll_fll_pll_tracking_cc::gps_l1_ca_dll_fll_pll_tracking_cc(unsigned in void gps_l1_ca_dll_fll_pll_tracking_cc::start_tracking(){ - /*! + /* * correct the code phase according to the delay between acq and trk */ unsigned long int acq_trk_diff_samples; @@ -242,7 +240,7 @@ gps_l1_ca_dll_fll_pll_tracking_cc::~gps_l1_ca_dll_fll_pll_tracking_cc() { delete[] d_Prompt_buffer; } -/*! Tracking signal processing +/* Tracking signal processing * Notice that this is a class derived from gr_sync_decimator, so each of the ninput_items has vector_length samples */ @@ -268,7 +266,7 @@ int gps_l1_ca_dll_fll_pll_tracking_cc::general_work (int noutput_items, gr_vecto d_Late=gr_complex(0,0); if (d_enable_tracking==true){ - /*! + /* * Receiver signal alignment */ if (d_pull_in==true) @@ -329,7 +327,7 @@ int gps_l1_ca_dll_fll_pll_tracking_cc::general_work (int noutput_items, gr_vecto d_Late += bb_signal_sample*d_late_code[i]; } - /*! + /* * DLL, FLL, and PLL discriminators */ // Compute DLL error diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_fll_pll_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_fll_pll_tracking_cc.h index a54b4fa65..c427bf999 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_fll_pll_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_fll_pll_tracking_cc.h @@ -1,12 +1,12 @@ /*! * \file gps_l1_ca_dll_fll_pll_tracking_cc.h - * \brief code DLL + carrier FLL/PLL tracking + * \brief Interface of a code DLL + carrier FLL/PLL tracking block * \author Javier Arribas, 2011. jarribas(at)cttc.es * - * This file implements the code Delay Locked Loop (DLL) + - * carrier Phase Locked Loop (PLL) helped with a carrier Frequency Locked Loop (FLL) stage - * according to the algorithms described in [1] - * [1] E.D. Kaplan and C. Hegarty, Understanding GPS. Principles and + * This is the interface of a code Delay Locked Loop (DLL) + + * carrier Phase Locked Loop (PLL) helped with a carrier Frequency Locked + * Loop (FLL) according to the algorithms described in: + * E.D. Kaplan and C. Hegarty, Understanding GPS. Principles and * Applications, Second Edition, Artech House Publishers, 2005. * * ------------------------------------------------------------------------- diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc index 1c0aad5a1..8ff1f468a 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc @@ -1,12 +1,13 @@ /*! * \file gps_l1_ca_dll_pll_tracking_cc.cc - * \brief code DLL + carrier PLL + * \brief Implementation of a code DLL + carrier PLL tracking block * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Javier Arribas, 2011. jarribas(at)cttc.es * - * Code DLL + carrier PLL according to the algorithms described in [1] + * Code DLL + carrier PLL according to the algorithms described in: * [1] K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen, - * A Software-Defined GPS and Galileo Receiver. A Single-Frequency Approach, Birkha user, 2007 + * A Software-Defined GPS and Galileo Receiver. A Single-Frequency + * Approach, Birkha user, 2007 * * ------------------------------------------------------------------------- * @@ -139,7 +140,7 @@ gps_l1_ca_dll_pll_tracking_cc::gps_l1_ca_dll_pll_tracking_cc(unsigned int satell } void gps_l1_ca_dll_pll_tracking_cc::start_tracking(){ - /*! + /* * correct the code phase according to the delay between acq and trk */ unsigned long int acq_trk_diff_samples; @@ -270,7 +271,7 @@ gps_l1_ca_dll_pll_tracking_cc::~gps_l1_ca_dll_pll_tracking_cc() { delete[] d_Prompt_buffer; } -/*! Tracking signal processing +/* Tracking signal processing * Notice that this is a class derived from gr_sync_decimator, so each of the ninput_items has vector_length samples */ @@ -295,7 +296,7 @@ int gps_l1_ca_dll_pll_tracking_cc::general_work (int noutput_items, gr_vector_in d_Late=gr_complex(0,0); if (d_enable_tracking==true){ - /*! + /* * Receiver signal alignment */ if (d_pull_in==true) diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.h index 7e4e7b967..08f439e8b 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.h @@ -1,12 +1,13 @@ /*! * \file gps_l1_ca_dll_pll_tracking_cc.h - * \brief code DLL + carrier PLL + * \brief Interface of a code DLL + carrier PLL tracking block * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Javier Arribas, 2011. jarribas(at)cttc.es * - * Code DLL + carrier PLL according to the algorithms described in [1] - * [1] K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen, - * A Software-Defined GPS and Galileo Receiver. A Single-Frequency Approach, Birkha user, 2007 + * Code DLL + carrier PLL according to the algorithms described in: + * K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen, + * A Software-Defined GPS and Galileo Receiver. A Single-Frequency Approach, + * Birkhauser, 2007 * * ------------------------------------------------------------------------- * diff --git a/src/algorithms/tracking/libs/CN_estimators.cc b/src/algorithms/tracking/libs/CN_estimators.cc index c0d88a142..25e5bc56b 100644 --- a/src/algorithms/tracking/libs/CN_estimators.cc +++ b/src/algorithms/tracking/libs/CN_estimators.cc @@ -1,25 +1,18 @@ /*! * \file CN_estimators.cc - * \brief Library with a set of Carrier to Noise estimators and lock detectors. - * SNV_CN0 is a Carrier-to-Noise (CN0) estimator based on the Signal-to-Noise Variance (SNV) estimator [1]. - * + * \brief Implementation of a library with a set of Carrier to Noise + * estimators and lock detectors. SNV_CN0 is a Carrier-to-Noise (CN0) estimator + * based on the Signal-to-Noise Variance (SNV) estimator [1]. * Carrier lock detector using normalised estimate of the cosine * of twice the carrier phase error [2]. - * - * * [1] Marco Pini, Emanuela Falletti and Maurizio Fantino, "Performance * Evaluation of C/N0 Estimators using a Real Time GNSS Software Receiver," * IEEE 10th International Symposium on Spread Spectrum Techniques and * Applications, pp.28-30, August 2008. - * - * - * * [2] Van Dierendonck, A.J. (1996), Global Positioning System: Theory and * Applications, * Volume I, Chapter 8: GPS Receivers, AJ Systems, Los Altos, CA 94024. * Inc.: 329-407. - * - * * \author Javier Arribas, 2011. jarribas(at)cttc.es * * @@ -52,7 +45,7 @@ #include #include -/*! +/* * Signal-to-Noise (SNR) (\f$\rho\f$) estimator using the Signal-to-Noise Variance (SNV) estimator: * \f{equation} * \hat{\rho}=\frac{\hat{P}_s}{\hat{P}_n}=\frac{\hat{P}_s}{\hat{P}_{tot}-\hat{P}_s}, @@ -66,36 +59,37 @@ * CN0_{dB}=10*log(\hat{\rho})+10*log(\frac{f_s}{2})-10*log(L_{PRN}), * \f} * where \f$f_s\f$ is the sampling frequency and \f$L_{PRN}\f$ is the PRN sequence length. + * */ float gps_l1_ca_CN0_SNV(gr_complex* Prompt_buffer, int length, long fs_in) { - // estimate CN0 using buffered values - // MATLAB CODE - //Psig=((1/N)*sum(abs(imag(x((n-N+1):n)))))^2; - //Ptot=(1/N)*sum(abs(x((n-N+1):n)).^2); - //SNR_SNV(count)=Psig/(Ptot-Psig); - //CN0_SNV_dB=10*log10(SNR_SNV)+10*log10(BW)-10*log10(PRN_length); - float SNR, SNR_dB_Hz; - float tmp_abs_I,tmp_abs_Q; - float Psig,Ptot; - //float M2,M4; - Psig=0; - Ptot=0; - for (int i=0;i +/*! brief SNV_CN0 is a Carrier-to-Noise (CN0) estimator + * based on the Signal-to-Noise Variance (SNV) estimator + * + * Signal-to-Noise (SNR) (\f$\rho\f$) estimator using the Signal-to-Noise Variance (SNV) estimator: + * \f{equation} + * \hat{\rho}=\frac{\hat{P}_s}{\hat{P}_n}=\frac{\hat{P}_s}{\hat{P}_{tot}-\hat{P}_s}, + * \f} + * where \f$\hat{P}_s=\left(\frac{1}{N}\sum^{N-1}_{i=0}|Re(Pc(i))|\right)^2\f$ is the estimation of the signal power, + * \f$\hat{P}_{tot}=\frac{1}{N}\sum^{N-1}_{i=0}|Pc(i)|^2\f$ is the estimator of the total power, \f$|\cdot|\f$ is the absolute value, + * \f$Re(\cdot)\f$ stands for the real part of the value, and \f$Pc(i)\f$ is the prompt correlator output for the sample index i. + * + * The SNR value is converted to CN0 [dB-Hz], taking to account the receiver bandwidth and the PRN code gain, using the following formula: + * \f{equation} + * CN0_{dB}=10*log(\hat{\rho})+10*log(\frac{f_s}{2})-10*log(L_{PRN}), + * \f} + * where \f$f_s\f$ is the sampling frequency and \f$L_{PRN}\f$ is the PRN sequence length. + * Ref: Marco Pini, Emanuela Falletti and Maurizio Fantino, "Performance + * Evaluation of C/N0 Estimators using a Real Time GNSS Software Receiver," + * IEEE 10th International Symposium on Spread Spectrum Techniques and + * Applications, pp.28-30, August 2008. + */ float gps_l1_ca_CN0_SNV(gr_complex* Prompt_buffer, int length, long fs_in); +/*! \brief A carrier lock detector + * + * The Carrier Phase Lock Detector block uses the normalised estimate of the cosine of twice the carrier phase error is given by + * \f{equation} + * C2\phi=\frac{NBD}{NBP}, + * \f} + * where \f$NBD=(\sum^{N-1}_{i=0}|Im(Pc(i))|)^2+(\sum^{N-1}_{i=0}|Re(Pc(i))|)^2\f$, + * \f$NBP=\sum^{N-1}_{i=0}Im(Pc(i))^2-\sum^{N-1}_{i=0}Re(Pc(i))^2\f$, and + * \f$Pc(i)\f$ is the prompt correlator output for the sample index i. + * Ref: Van Dierendonck, A.J. (1996), Global Positioning System: Theory and + * Applications, + * Volume I, Chapter 8: GPS Receivers, AJ Systems, Los Altos, CA 94024. + * Inc.: 329-407. + */ float carrier_lock_detector(gr_complex* Prompt_buffer, int length); #endif diff --git a/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.cc b/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.cc index 5917f6f82..347ad5dd4 100644 --- a/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.cc +++ b/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.cc @@ -1,11 +1,12 @@ /*! * \file tracking_2nd_DLL_filter.cc - * \brief Class that implements 2 order DLL filter for code tracking loop. + * \brief Implementation of a 2nd order DLL filter for code tracking loop. * \author Javier Arribas, 2011. jarribas(at)cttc.es * - * Class that implements 2 order PLL filter for code tracking loop. The algorithm is described in [1] - * - * [1] K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.~H.~Jensen, A Software-Defined GPS and Galileo Receiver. A Single-Frequency Approach, + * Class that implements 2 order PLL filter for code tracking loop. + * The algorithm is described in : + * K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.~H.~Jensen, A Software-Defined + * GPS and Galileo Receiver. A Single-Frequency Approach, * Birkhauser, 2007, Applied and Numerical Harmonic Analysis. * * ------------------------------------------------------------------------- @@ -38,19 +39,19 @@ void tracking_2nd_DLL_filter::calculate_lopp_coef(float* tau1,float* tau2, float lbw, float zeta, float k){ - // Solve natural frequency - float Wn; - Wn = lbw*8*zeta / (4*zeta*zeta + 1); - // solve for t1 & t2 - *tau1 = k / (Wn * Wn); - *tau2 = (2.0 * zeta) / Wn; + // Solve natural frequency + float Wn; + Wn = lbw*8*zeta / (4*zeta*zeta + 1); + // solve for t1 & t2 + *tau1 = k / (Wn * Wn); + *tau2 = (2.0 * zeta) / Wn; } void tracking_2nd_DLL_filter::set_DLL_BW(float dll_bw_hz) { - //Calculate filter coefficient values - d_dllnoisebandwidth=dll_bw_hz; - calculate_lopp_coef(&d_tau1_code, &d_tau2_code, d_dllnoisebandwidth, d_dlldampingratio,1.0);// Calculate filter coefficient values + //Calculate filter coefficient values + d_dllnoisebandwidth=dll_bw_hz; + calculate_lopp_coef(&d_tau1_code, &d_tau2_code, d_dllnoisebandwidth, d_dlldampingratio,1.0);// Calculate filter coefficient values } void tracking_2nd_DLL_filter::initialize(float d_acq_code_phase_samples) { @@ -62,17 +63,17 @@ void tracking_2nd_DLL_filter::initialize(float d_acq_code_phase_samples) float tracking_2nd_DLL_filter::get_code_nco(float DLL_discriminator) { - float code_nco; - code_nco = d_old_code_nco + (d_tau2_code/d_tau1_code)*(DLL_discriminator - d_old_code_error) + DLL_discriminator * (d_pdi_code/d_tau1_code); - d_old_code_nco = code_nco; - d_old_code_error = DLL_discriminator; //[chips] - return code_nco; + float code_nco; + code_nco = d_old_code_nco + (d_tau2_code/d_tau1_code)*(DLL_discriminator - d_old_code_error) + DLL_discriminator * (d_pdi_code/d_tau1_code); + d_old_code_nco = code_nco; + d_old_code_error = DLL_discriminator; //[chips] + return code_nco; } tracking_2nd_DLL_filter::tracking_2nd_DLL_filter () { - d_pdi_code = 0.001;// Summation interval for code - d_dlldampingratio=0.7; + d_pdi_code = 0.001;// Summation interval for code + d_dlldampingratio=0.7; } tracking_2nd_DLL_filter::~tracking_2nd_DLL_filter () diff --git a/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.h b/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.h index e3c009563..00f61d5f6 100644 --- a/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.h +++ b/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.h @@ -1,10 +1,12 @@ /*! * \file tracking_2nd_DLL_filter.h - * \brief Class that implements 2 order DLL filter for code tracking loop. + * \brief Interface of a 2nd order DLL filter for code tracking loop. * \author Javier Arribas, 2011. jarribas(at)cttc.es * - * Class that implements 2 order PLL filter for code tracking loop. The algorithm is described in: - * K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S. H. Jensen, A Software-Defined GPS and Galileo Receiver. A Single-Frequency Approach, + * Class that implements a 2nd order PLL filter for code tracking loop. + * The algorithm is described in: + * K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S. H. Jensen, + * A Software-Defined GPS and Galileo Receiver. A Single-Frequency Approach, * Birkhauser, 2007, Applied and Numerical Harmonic Analysis. * * ------------------------------------------------------------------------- diff --git a/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc b/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc index c851ca2a8..f73b0ae2f 100644 --- a/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc +++ b/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc @@ -1,11 +1,12 @@ /*! * \file tracking_2nd_PLL_filter.cc - * \brief Class that implements 2 order PLL filter for tracking carrier loop. + * \brief Implementation of a 2nd order PLL filter for tracking carrier loop. * \author Javier Arribas, 2011. jarribas(at)cttc.es * - * Class that implements 2 order PLL filter for tracking carrier loop. The algorithm is described in [1] - * - * [1] K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.~H.~Jensen, A Software-Defined GPS and Galileo Receiver. A Single-Frequency Approach, + * Class that implements 2 order PLL filter for tracking carrier loop. The algorithm + * is described in: + * K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.~H.~Jensen, A Software-Defined + * GPS and Galileo Receiver. A Single-Frequency Approach, * Birkhauser, 2007, Applied and Numerical Harmonic Analysis. * * ------------------------------------------------------------------------- diff --git a/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.h b/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.h index 42c57c83e..48e5ddc54 100644 --- a/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.h +++ b/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.h @@ -1,10 +1,12 @@ /*! * \file tracking_2nd_PLL_filter.h - * \brief Class that implements 2 order PLL filter for carrier tracking loop + * \brief Interface of a 2nd order PLL filter for carrier tracking loop * \author Javier Arribas, 2011. jarribas(at)cttc.es * - * Class that implements 2 order PLL filter for tracking carrier loop. The algorithm is described in - * K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.~H.~Jensen, A Software-Defined GPS and Galileo Receiver. A Single-Frequency Approach, + * Class that implements 2 order PLL filter for tracking carrier loop. + * The algorithm is described in + * K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H. Jensen, + * A Software-Defined GPS and Galileo Receiver. A Single-Frequency Approach, * Birkhauser, 2007, Applied and Numerical Harmonic Analysis. * * ------------------------------------------------------------------------- diff --git a/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc b/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc index 203f49aaf..318ed9565 100644 --- a/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc +++ b/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc @@ -1,6 +1,6 @@ /*! * \file tracking_FLL_PLL_filter.cc - * \brief Class that implements hybrid FLL and PLL filter for tracking carrier loop + * \brief Implementation of a hybrid FLL and PLL filter for tracking carrier loop * \author Javier Arribas, 2011. jarribas(at)cttc.es * * Class that implements hybrid FLL and PLL filter for tracking carrier loop @@ -36,76 +36,76 @@ void tracking_FLL_PLL_filter::set_params(float fll_bw_hz,float pll_bw_hz, int order) { - /*! + /* * Filter design (Kaplan 2nd ed., Pag. 181 Fig. 181) */ - d_order=order; + d_order=order; if (d_order==3) - { - /*! - * 3rd order PLL with 2nd order FLL assist - */ - d_pll_b3 = 2.400; - d_pll_a3 = 1.100; - d_pll_a2 = 1.414; - d_pll_w0p = pll_bw_hz/0.7845; - d_pll_w0p2 = d_pll_w0p*d_pll_w0p; - d_pll_w0p3 = d_pll_w0p2*d_pll_w0p; + { + /* + * 3rd order PLL with 2nd order FLL assist + */ + d_pll_b3 = 2.400; + d_pll_a3 = 1.100; + d_pll_a2 = 1.414; + d_pll_w0p = pll_bw_hz/0.7845; + d_pll_w0p2 = d_pll_w0p*d_pll_w0p; + d_pll_w0p3 = d_pll_w0p2*d_pll_w0p; - d_pll_w0f = fll_bw_hz/0.53; - d_pll_w0f2 = d_pll_w0f*d_pll_w0f; - }else - { - /*! - * 2rd order PLL with 1st order FLL assist - */ - d_pll_a2 = 1.414; - d_pll_w0p = pll_bw_hz/0.53; - d_pll_w0p2 = d_pll_w0p*d_pll_w0p; - d_pll_w0f = fll_bw_hz/0.25; - } + d_pll_w0f = fll_bw_hz/0.53; + d_pll_w0f2 = d_pll_w0f*d_pll_w0f; + }else + { + /* + * 2nd order PLL with 1st order FLL assist + */ + d_pll_a2 = 1.414; + d_pll_w0p = pll_bw_hz/0.53; + d_pll_w0p2 = d_pll_w0p*d_pll_w0p; + d_pll_w0f = fll_bw_hz/0.25; + } } void tracking_FLL_PLL_filter::initialize(float d_acq_carrier_doppler_hz) { - if (d_order==3) - { - d_pll_x = 2.0*d_acq_carrier_doppler_hz; - d_pll_w = 0; - }else{ - d_pll_w = d_acq_carrier_doppler_hz; - d_pll_x = 0; - } + if (d_order==3) + { + d_pll_x = 2.0*d_acq_carrier_doppler_hz; + d_pll_w = 0; + }else{ + d_pll_w = d_acq_carrier_doppler_hz; + d_pll_x = 0; + } } float tracking_FLL_PLL_filter::get_carrier_error(float FLL_discriminator, float PLL_discriminator, float correlation_time_s) { - float carrier_error_hz; - if (d_order==3) - { - /*! - * 3rd order PLL with 2nd order FLL assist - */ - d_pll_w = d_pll_w + correlation_time_s * (d_pll_w0p3 * PLL_discriminator + d_pll_w0f2 * FLL_discriminator); - d_pll_x = d_pll_x + correlation_time_s * (0.5*d_pll_w + d_pll_a2 * d_pll_w0f * FLL_discriminator + d_pll_a3 * d_pll_w0p2 * PLL_discriminator); - carrier_error_hz = 0.5*d_pll_x + d_pll_b3 * d_pll_w0p * PLL_discriminator; - }else - { - /*! - * 2rd order PLL with 1st order FLL assist - */ - float pll_w_new; - pll_w_new = d_pll_w + PLL_discriminator*d_pll_w0p2*correlation_time_s + FLL_discriminator*d_pll_w0f*correlation_time_s ; - carrier_error_hz = 0.5*(pll_w_new + d_pll_w)+d_pll_a2 * d_pll_w0p*PLL_discriminator; - d_pll_w =pll_w_new; - /*std::cout<<" d_pll_w = "< // All the outputs are in RADIANS -/*! +/* * FLL four quadrant arctan discriminator: * \f{equation} * \frac{\phi_2-\phi_1}{t_2-t1}=\frac{ATAN2(cross,dot)}{t_1-t_2}, @@ -45,13 +46,14 @@ float fll_four_quadrant_atan(gr_complex prompt_s1, gr_complex prompt_s2,float t1, float t2) { - float cross,dot; - dot=prompt_s1.imag()*prompt_s2.imag()+prompt_s1.real()*prompt_s2.real(); - cross=prompt_s1.imag()*prompt_s2.real()-prompt_s2.imag()*prompt_s1.real(); - return atan2(cross,dot)/(t2-t1); + float cross,dot; + dot=prompt_s1.imag()*prompt_s2.imag()+prompt_s1.real()*prompt_s2.real(); + cross=prompt_s1.imag()*prompt_s2.real()-prompt_s2.imag()*prompt_s1.real(); + return atan2(cross,dot)/(t2-t1); } -/*! + +/* * PLL four quadrant arctan discriminator: * \f{equation} * \phi=ATAN2(Q_{PS},I_{PS}), @@ -60,27 +62,29 @@ float fll_four_quadrant_atan(gr_complex prompt_s1, gr_complex prompt_s2,float t1 */ float pll_four_quadrant_atan(gr_complex prompt_s1) { - return atan2(prompt_s1.real(),prompt_s1.imag()); + return atan2(prompt_s1.real(),prompt_s1.imag()); } -/*! + +/* * PLL Costas loop two quadrant arctan discriminator: * \f{equation} * \phi=ATAN\left(\frac{Q_{PS}}{I_{PS}}\right), * \f} * where \f$I_{PS1},Q_{PS1}\f$ are the inphase and quadrature prompt correlator outputs respectively. The output is in [radians]. */ - float pll_cloop_two_quadrant_atan(gr_complex prompt_s1) { - if (prompt_s1.imag()!=0.0) - { - return atan(prompt_s1.real()/prompt_s1.imag()); - }else{ - return 0; - } + if (prompt_s1.imag()!=0.0) + { + return atan(prompt_s1.real()/prompt_s1.imag()); + }else{ + return 0; + } } -/*! + + +/* * DLL Noncoherent Early minus Late envelope normalized discriminator: * \f{equation} * error=\frac{E-L}{E+L}, @@ -90,8 +94,8 @@ float pll_cloop_two_quadrant_atan(gr_complex prompt_s1) */ float dll_nc_e_minus_l_normalized(gr_complex early_s1, gr_complex late_s1) { - float P_early, P_late; - P_early=std::abs(early_s1); - P_late=std::abs(late_s1); - return (P_early-P_late)/((P_early+P_late)); + float P_early, P_late; + P_early=std::abs(early_s1); + P_late=std::abs(late_s1); + return (P_early-P_late)/((P_early+P_late)); } diff --git a/src/algorithms/tracking/libs/tracking_discriminators.h b/src/algorithms/tracking/libs/tracking_discriminators.h index 2af472224..4ab1172f0 100644 --- a/src/algorithms/tracking/libs/tracking_discriminators.h +++ b/src/algorithms/tracking/libs/tracking_discriminators.h @@ -1,9 +1,11 @@ /*! * \file tracking_discriminators.h - * \brief Library with a set of code tracking and carrier tracking disctiminators + * \brief Interface of a library with a set of code tracking and carrier + * tracking discriminators. * \author Javier Arribas, 2011. jarribas(at)cttc.es * - * Library with a set of code tracking and carrier tracking disctiminators that is used by the tracking algorithms + * Library with a set of code tracking and carrier tracking discriminators + * that is used by the tracking algorithms. * * ------------------------------------------------------------------------- * @@ -35,12 +37,50 @@ #include +/*! brief FLL four quadrant arctan discriminator + * + * FLL four quadrant arctan discriminator: + * \f{equation} + * \frac{\phi_2-\phi_1}{t_2-t1}=\frac{ATAN2(cross,dot)}{t_1-t_2}, + * \f} + * where \f$cross=I_{PS1}Q_{PS2}-I_{PS2}Q_{PS1}\f$ and \f$dot=I_{PS1}I_{PS2}+Q_{PS1}Q_{PS2}\f$, + * \f$I_{PS1},Q_{PS1}\f$ are the inphase and quadrature prompt correlator outputs respectively at sample time \f$t_1\f$, and + * \f$I_{PS2},Q_{PS2}\f$ are the inphase and quadrature prompt correlator outputs respectively at sample time \f$t_2\f$. The output is in [radians/second]. + */ float fll_four_quadrant_atan(gr_complex prompt_s1, gr_complex prompt_s2,float t1, float t2); + +/*! \brief PLL four quadrant arctan discriminator + * + * PLL four quadrant arctan discriminator: + * \f{equation} + * \phi=ATAN2(Q_{PS},I_{PS}), + * \f} + * where \f$I_{PS1},Q_{PS1}\f$ are the inphase and quadrature prompt correlator outputs respectively. The output is in [radians]. + */ float pll_four_quadrant_atan(gr_complex prompt_s1); + +/*! \brief PLL Costas loop two quadrant arctan discriminator + * + * PLL Costas loop two quadrant arctan discriminator: + * \f{equation} + * \phi=ATAN\left(\frac{Q_{PS}}{I_{PS}}\right), + * \f} + * where \f$I_{PS1},Q_{PS1}\f$ are the inphase and quadrature prompt correlator outputs respectively. The output is in [radians]. + */ float pll_cloop_two_quadrant_atan(gr_complex prompt_s1); + +/*! \brief DLL Noncoherent Early minus Late envelope normalized discriminator + * + * DLL Noncoherent Early minus Late envelope normalized discriminator: + * \f{equation} + * error=\frac{E-L}{E+L}, + * \f} + * where \f$E=\sqrt{I_{ES}^2,Q_{ES}^2}\f$ is the Early correlator output absolute value and + * \f$L=\sqrt{I_{LS}^2,Q_{LS}^2}\f$ is the Late correlator output absolute value. The output is in [chips]. + */ float dll_nc_e_minus_l_normalized(gr_complex early_s1, gr_complex late_s1); diff --git a/src/core/interfaces/channel_interface.h b/src/core/interfaces/channel_interface.h index 8dd7f4981..2f3c959d2 100644 --- a/src/core/interfaces/channel_interface.h +++ b/src/core/interfaces/channel_interface.h @@ -47,7 +47,6 @@ * instantiated directly if all inherited pure virtual methods have been * implemented by that class or a parent class. */ - class ChannelInterface: public GNSSBlockInterface { diff --git a/src/core/interfaces/configuration_interface.h b/src/core/interfaces/configuration_interface.h index 51dea61cc..4d3b25df1 100644 --- a/src/core/interfaces/configuration_interface.h +++ b/src/core/interfaces/configuration_interface.h @@ -6,10 +6,6 @@ * The interface defines an accessor method that gets a parameter name as input * and returns the value of this parameter, a string, as output. * Property names are defined here. This is an abstract class for interfaces. - * Since all its methods are virtual, - * this class cannot be instantiated directly, and a subclass can only be - * instantiated directly if all inherited pure virtual methods have been - * implemented by that class or a parent class. * * ------------------------------------------------------------------------- * @@ -69,7 +65,6 @@ public: unsigned int default_value) = 0; virtual float property(std::string property_name, float default_value) = 0; virtual double property(std::string property_name, double default_value) = 0; - virtual void set_property(std::string property_name, std::string value) = 0; }; diff --git a/src/core/interfaces/gnss_block_interface.h b/src/core/interfaces/gnss_block_interface.h index 1933542e5..5d397f008 100644 --- a/src/core/interfaces/gnss_block_interface.h +++ b/src/core/interfaces/gnss_block_interface.h @@ -59,7 +59,6 @@ public: virtual std::string role() = 0; virtual std::string implementation() = 0; virtual size_t item_size() = 0; - virtual void connect(gr_top_block_sptr top_block) = 0; virtual void disconnect(gr_top_block_sptr top_block) = 0; virtual gr_basic_block_sptr get_left_block() = 0; diff --git a/src/core/interfaces/observables_interface.h b/src/core/interfaces/observables_interface.h index 9c776885d..70486cd73 100644 --- a/src/core/interfaces/observables_interface.h +++ b/src/core/interfaces/observables_interface.h @@ -1,9 +1,9 @@ /*! * \file pseudorange_interface.h - * \brief This class represents an interface to a navigation gnss block. + * \brief This class represents an interface to an Observables block. * \author Javier Arribas, 2011. jarribas(at)cttc.es * - * Abstract class for pseudorange_intefaces. Since all its methods are virtual, + * Abstract class for Observables modules. Since all its methods are virtual, * this class cannot be instantiated directly, and a subclass can only be * instantiated directly if all inherited pure virtual methods have been * implemented by that class or a parent class. diff --git a/src/core/interfaces/pvt_interface.h b/src/core/interfaces/pvt_interface.h index a4836f675..4cb6cb1c4 100644 --- a/src/core/interfaces/pvt_interface.h +++ b/src/core/interfaces/pvt_interface.h @@ -1,9 +1,9 @@ /*! * \file pvt_interface.h - * \brief This class represents an interface to a PVT gnss block. + * \brief This class represents an interface to a PVT block. * \author Javier Arribas, 2011. jarribas(at)cttc.es * - * Abstract class for pseudorange_intefaces. Since all its methods are virtual, + * Abstract class for PVT solvers. Since all its methods are virtual, * this class cannot be instantiated directly, and a subclass can only be * instantiated directly if all inherited pure virtual methods have been * implemented by that class or a parent class. @@ -40,9 +40,9 @@ #include "gnss_block_interface.h" /*! - * \brief This class represents an interface to a PVT gnss block. + * \brief This class represents an interface to a PVT block. * - * Abstract class for PVT intefaces, derived from GNSSBlockInterface. + * Abstract class for PVT interfaces, derived from GNSSBlockInterface. * Since all its methods are virtual, * this class cannot be instantiated directly, and a subclass can only be * instantiated directly if all inherited pure virtual methods have been diff --git a/src/core/interfaces/telemetry_decoder_interface.h b/src/core/interfaces/telemetry_decoder_interface.h index e0232667d..289392f9c 100644 --- a/src/core/interfaces/telemetry_decoder_interface.h +++ b/src/core/interfaces/telemetry_decoder_interface.h @@ -1,9 +1,9 @@ /*! * \file navigation_interface.h - * \brief This class represents an interface to a navigation GNSS block. + * \brief This class represents an interface to a telemetry decoder block. * \author Javier Arribas, 2011. jarribas(at)cttc.es * - * Abstract class for navigation interfaces. Since all its methods are virtual, + * Abstract class for telemetry decoders. Since all its methods are virtual, * this class cannot be instantiated directly, and a subclass can only be * instantiated directly if all inherited pure virtual methods have been * implemented by that class or a parent class. diff --git a/src/core/interfaces/tracking_interface.h b/src/core/interfaces/tracking_interface.h index fbc961238..9eb1a36d9 100644 --- a/src/core/interfaces/tracking_interface.h +++ b/src/core/interfaces/tracking_interface.h @@ -1,6 +1,6 @@ /*! * \file tracking_interface.h - * \brief This class represents an interface to an tracking GNSS block. + * \brief This class represents an interface to a tracking block. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * * Abstract class for tracking interfaces. Since all its methods are virtual, diff --git a/src/core/libs/string_converter.cc b/src/core/libs/string_converter.cc index e5abd3111..5b90d71de 100644 --- a/src/core/libs/string_converter.cc +++ b/src/core/libs/string_converter.cc @@ -1,7 +1,7 @@ /*! * \file string_converter.cc - * \brief This class interprets the contents of a string and converts it into - * different types. + * \brief Implementation of a class that interprets the contents of a string + * and converts it into different types. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * * ------------------------------------------------------------------------- @@ -29,8 +29,8 @@ * ------------------------------------------------------------------------- */ -#include "string_converter.h" +#include "string_converter.h" #include #include @@ -42,82 +42,84 @@ StringConverter::~StringConverter() { bool StringConverter::convert(std::string value, bool default_value) { - if(value.compare("true") == 0) { - return true; - } else if(value.compare("false") == 0) { - return false; - } else { - return default_value; - } + if(value.compare("true") == 0) { + return true; + } else if(value.compare("false") == 0) { + return false; + } else { + return default_value; + } } long StringConverter::convert(std::string value, long default_value) { - std::stringstream stream(value); + std::stringstream stream(value); - long result; - stream >> result; + long result; + stream >> result; - if(stream.fail()) { - return default_value; - } else { - return result; - } + if(stream.fail()) { + return default_value; + } else { + return result; + } } int StringConverter::convert(std::string value, int default_value) { - std::stringstream stream(value); + std::stringstream stream(value); - int result; - stream >> result; + int result; + stream >> result; - if(stream.fail()) { - return default_value; - } else { - return result; - } + if(stream.fail()) { + return default_value; + } else { + return result; + } } unsigned int StringConverter::convert(std::string value, unsigned int default_value) { - std::stringstream stream(value); + std::stringstream stream(value); - unsigned int result; - stream >> result; + unsigned int result; + stream >> result; - if(stream.fail()) { - return default_value; - } else { - return result; - } + if(stream.fail()) { + return default_value; + } else { + return result; + } } float StringConverter::convert(std::string value, float default_value) { - std::stringstream stream(value); + std::stringstream stream(value); - float result; - stream >> result; + float result; + stream >> result; - if(stream.fail()) { - return default_value; - } else { - return result; - } + if(stream.fail()) { + return default_value; + } else { + return result; + } } double StringConverter::convert(std::string value, double default_value) { - std::stringstream stream(value); + std::stringstream stream(value); - double result; - stream >> result; + double result; + stream >> result; - if(stream.fail()) { - return default_value; - } else { - return result; - } + if(stream.fail()) { + return default_value; + } else { + return result; + } } + + diff --git a/src/core/libs/string_converter.h b/src/core/libs/string_converter.h index 7857d2d27..4fb336835 100644 --- a/src/core/libs/string_converter.h +++ b/src/core/libs/string_converter.h @@ -1,7 +1,7 @@ /*! * \file string_converter.h - * \brief This class interprets the contents of a string and converts it into - * different types. + * \brief Interface of a class that interprets the contents of a string + * and converts it into different types. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * * ------------------------------------------------------------------------- @@ -30,23 +30,23 @@ */ -#ifndef STRING_CONVERTER_H_ -#define STRING_CONVERTER_H_ +#ifndef GNSS_SDR_STRING_CONVERTER_H_ +#define GNSS_SDR_STRING_CONVERTER_H_ #include class StringConverter { public: - StringConverter(); - virtual ~StringConverter(); + StringConverter(); + virtual ~StringConverter(); - bool convert(std::string value, bool default_value); - long convert(std::string value, long default_value); - int convert(std::string value, int default_value); - unsigned int convert(std::string value, unsigned int default_value); - float convert(std::string value, float default_value); - double convert(std::string value, double default_value); + bool convert(std::string value, bool default_value); + long convert(std::string value, long default_value); + int convert(std::string value, int default_value); + unsigned int convert(std::string value, unsigned int default_value); + float convert(std::string value, float default_value); + double convert(std::string value, double default_value); }; -#endif /*STRING_CONVERTER_H_*/ +#endif /*GNSS_SDR_STRING_CONVERTER_H_*/ diff --git a/src/core/receiver/concurrent_queue.h b/src/core/receiver/concurrent_queue.h index e6cc7c75d..d13b578f5 100644 --- a/src/core/receiver/concurrent_queue.h +++ b/src/core/receiver/concurrent_queue.h @@ -1,6 +1,6 @@ /*! * \file concurrent_queue.h - * \brief This class implements a thread-safe std::queue + * \brief Interface of a thread-safe std::queue * \author Javier Arribas, 2011. jarribas(at)cttc.es * * ------------------------------------------------------------------------- @@ -65,9 +65,9 @@ public: { boost::mutex::scoped_lock lock(the_mutex); if(the_queue.empty()) - { - return false; - } + { + return false; + } popped_value=the_queue.front(); the_queue.pop(); @@ -78,9 +78,9 @@ public: { boost::mutex::scoped_lock lock(the_mutex); while(the_queue.empty()) - { - the_condition_variable.wait(lock); - } + { + the_condition_variable.wait(lock); + } popped_value=the_queue.front(); the_queue.pop(); diff --git a/src/core/receiver/control_message.h b/src/core/receiver/control_message.h index 5968cb457..4e392edd3 100644 --- a/src/core/receiver/control_message.h +++ b/src/core/receiver/control_message.h @@ -1,6 +1,6 @@ /*! * \file control_message.h - * \brief This class represents the different control messages. + * \brief Interface for the different control messages. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * * ------------------------------------------------------------------------- diff --git a/src/core/receiver/control_message_factory.cc b/src/core/receiver/control_message_factory.cc index fbddf4237..777fdbf19 100644 --- a/src/core/receiver/control_message_factory.cc +++ b/src/core/receiver/control_message_factory.cc @@ -29,55 +29,52 @@ */ #include "control_message_factory.h" - #include #include - #include - #include "string.h" using google::LogMessage; -//! Constructor +// Constructor ControlMessageFactory::ControlMessageFactory() {} -//! Destructor +// Destructor ControlMessageFactory::~ControlMessageFactory() {} gr_message_sptr ControlMessageFactory::GetQueueMessage(unsigned int who, unsigned int what) { - ControlMessage *control_message = new ControlMessage; + ControlMessage *control_message = new ControlMessage; - control_message->who = who; - control_message->what = what; + control_message->who = who; + control_message->what = what; - gr_message_sptr queue_message = gr_make_message(0, 0, 0, sizeof(ControlMessage)); - memcpy(queue_message->msg(), control_message, sizeof(ControlMessage)); + gr_message_sptr queue_message = gr_make_message(0, 0, 0, sizeof(ControlMessage)); + memcpy(queue_message->msg(), control_message, sizeof(ControlMessage)); - delete control_message; + delete control_message; - return queue_message; + return queue_message; } std::vector* ControlMessageFactory::GetControlMessages(gr_message_sptr queue_message) { - std::vector* control_messages = new std::vector(); - unsigned int control_messages_count = queue_message->length() / sizeof(ControlMessage); - if(queue_message->length() % sizeof(ControlMessage) != 0) { - LOG_AT_LEVEL(WARNING) << "Queue message has size " << queue_message->length() << " which is not" << - " multiple of control message size " << sizeof(ControlMessage); - LOG_AT_LEVEL(WARNING) << "Ignoring this queue message to prevent unexpected results."; - return control_messages; - } - for(unsigned int i=0;ipush_back(new ControlMessage); - memcpy(control_messages->at(i), queue_message->msg() + (i*sizeof(ControlMessage)), sizeof(ControlMessage)); - } + std::vector* control_messages = new std::vector(); + unsigned int control_messages_count = queue_message->length() / sizeof(ControlMessage); + if(queue_message->length() % sizeof(ControlMessage) != 0) { + LOG_AT_LEVEL(WARNING) << "Queue message has size " << queue_message->length() << " which is not" << + " multiple of control message size " << sizeof(ControlMessage); + LOG_AT_LEVEL(WARNING) << "Ignoring this queue message to prevent unexpected results."; + return control_messages; + } + for(unsigned int i=0;ipush_back(new ControlMessage); + memcpy(control_messages->at(i), queue_message->msg() + (i*sizeof(ControlMessage)), sizeof(ControlMessage)); + } - return control_messages; + return control_messages; } diff --git a/src/core/receiver/control_message_factory.h b/src/core/receiver/control_message_factory.h index 18e062187..597ae634e 100644 --- a/src/core/receiver/control_message_factory.h +++ b/src/core/receiver/control_message_factory.h @@ -1,6 +1,6 @@ /*! * \file control_message_factory.h - * \brief This class implements a factory for control messages. + * \brief Interface of a factory for control messages. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * * ------------------------------------------------------------------------- diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 839c2fbf3..86cdf23d5 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -82,33 +82,33 @@ void ControlThread::run() flowgraph_->connect(); if (flowgraph_->connected()) - { - LOG_AT_LEVEL(INFO) << "Flowgraph connected"; - } + { + LOG_AT_LEVEL(INFO) << "Flowgraph connected"; + } else - { - LOG_AT_LEVEL(ERROR) << "Unable to connect flowgraph"; - return; - } + { + LOG_AT_LEVEL(ERROR) << "Unable to connect flowgraph"; + return; + } flowgraph_->start(); if (flowgraph_->running()) - { - LOG_AT_LEVEL(INFO) << "Flowgraph started"; - } + { + LOG_AT_LEVEL(INFO) << "Flowgraph started"; + } else - { - LOG_AT_LEVEL(ERROR) << "Unable to start flowgraph"; - return; - } + { + LOG_AT_LEVEL(ERROR) << "Unable to start flowgraph"; + return; + } // Main loop to read and process the control messages while (flowgraph_->running() && !stop_) - { - //TODO re-enable the blocking read messages functions and fork the process - read_control_messages(); - if (control_messages_ != 0) process_control_messages(); - } + { + //TODO re-enable the blocking read messages functions and fork the process + read_control_messages(); + if (control_messages_ != 0) process_control_messages(); + } flowgraph_->stop(); @@ -118,11 +118,11 @@ void ControlThread::run() void ControlThread::set_control_queue(gr_msg_queue_sptr control_queue) { if (flowgraph_->running()) - { - LOG_AT_LEVEL(WARNING) - << "Unable to set control queue while flowgraph is running"; - return; - } + { + LOG_AT_LEVEL(WARNING) + << "Unable to set control queue while flowgraph is running"; + return; + } control_queue_ = control_queue; } @@ -130,7 +130,7 @@ void ControlThread::set_control_queue(gr_msg_queue_sptr control_queue) void ControlThread::init() { - // Instantiates a control queue, a GNSS flowgraph, and a control message factory + // Instantiates a control queue, a GNSS flowgraph, and a control message factory control_queue_ = gr_make_msg_queue(0); flowgraph_ = new GNSSFlowgraph(configuration_, control_queue_); control_message_factory_ = new ControlMessageFactory(); @@ -145,14 +145,14 @@ void ControlThread::read_control_messages() DLOG(INFO) << "Reading control messages from queue"; gr_message_sptr queue_message = control_queue_->delete_head(); if (queue_message != 0) - { - control_messages_ = control_message_factory_->GetControlMessages( - queue_message); - } + { + control_messages_ = control_message_factory_->GetControlMessages( + queue_message); + } else - { - control_messages_ = 0; - } + { + control_messages_ = 0; + } } // Apply the corresponding control actions @@ -161,21 +161,21 @@ void ControlThread::process_control_messages() { for (unsigned int i = 0; i < control_messages_->size(); i++) - { - if (stop_) break; - if (control_messages_->at(i)->who == 200) { - apply_action(control_messages_->at(i)->what); - } - else - { - flowgraph_->apply_action(control_messages_->at(i)->who, - control_messages_->at(i)->what); - } + if (stop_) break; + if (control_messages_->at(i)->who == 200) + { + apply_action(control_messages_->at(i)->what); + } + else + { + flowgraph_->apply_action(control_messages_->at(i)->who, + control_messages_->at(i)->what); + } - delete control_messages_->at(i); - processed_control_messages_++; - } + delete control_messages_->at(i); + processed_control_messages_++; + } control_messages_->clear(); delete control_messages_; @@ -188,13 +188,13 @@ void ControlThread::apply_action(unsigned int what) switch (what) { - case 0: - DLOG(INFO) << "Received action STOP"; - stop_ = true; - applied_actions_++; - break; - default: - DLOG(INFO) << "Unrecognized action."; + case 0: + DLOG(INFO) << "Received action STOP"; + stop_ = true; + applied_actions_++; + break; + default: + DLOG(INFO) << "Unrecognized action."; } } diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h index e0e895abe..44a98444e 100644 --- a/src/core/receiver/control_thread.h +++ b/src/core/receiver/control_thread.h @@ -66,14 +66,14 @@ public: //! \brief Virtual destructor. Derived classes must implement the destructor virtual ~ControlThread(); - /*! \brief Runs the control thread - * - * This is the main loop that reads and process the control messages - * 1- Connect the GNSS receiver flowgraph - * 2- Start the GNSS receiver flowgraph - * while (flowgraph_->running() && !stop)_{ - * 3- Read control messages and process them } - */ + /*! \brief Runs the control thread + * + * This is the main loop that reads and process the control messages: + * - Connect the GNSS receiver flowgraph; + * - Start the GNSS receiver flowgraph; + * while (flowgraph_->running() && !stop)_{ + * - Read control messages and process them; } + */ void run(); /*! @@ -101,9 +101,8 @@ public: */ GNSSFlowgraph* flowgraph() { - return flowgraph_; - } + } private: diff --git a/src/core/receiver/file_configuration.cc b/src/core/receiver/file_configuration.cc index 539609a0a..d0f477ee2 100644 --- a/src/core/receiver/file_configuration.cc +++ b/src/core/receiver/file_configuration.cc @@ -1,6 +1,7 @@ /*! * \file file_configuration.cc - * \brief This class is an implementation of the interface ConfigurationInterface. + * \brief Implementation of the interface ConfigurationInterface that reads the + * configuration from a file. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * * This implementation has a text file as the source for the values of the parameters. @@ -35,12 +36,9 @@ #include "file_configuration.h" - #include - #include #include - #include "INIReader.h" #include "string_converter.h" #include "in_memory_configuration.h" diff --git a/src/core/receiver/file_configuration.h b/src/core/receiver/file_configuration.h index b615cfbe7..d7310759f 100644 --- a/src/core/receiver/file_configuration.h +++ b/src/core/receiver/file_configuration.h @@ -1,6 +1,6 @@ /*! * \file file_configuration.h - * \brief This class is an implementation of the interface ConfigurationInterface. + * \brief A ConfigurationInterface that reads the configuration from a file. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * * This implementation has a text file as the source for the values of the parameters. diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index f5d098bd6..a44e44756 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -34,15 +34,12 @@ */ #include "gnss_block_factory.h" - #include #include #include #include - #include #include - #include "configuration_interface.h" #include "gnss_block_interface.h" #include "pass_through.h" @@ -169,10 +166,10 @@ GNSSBlockInterface* GNSSBlockFactory::GetChannel( "SignalConditioner", "Pass_Through", 1, 1, queue), (AcquisitionInterface*)GetBlock(configuration, "Acquisition", acq, 1, 1, queue), (TrackingInterface*)GetBlock( - configuration, "Tracking", trk, 1, 1, queue), - (TelemetryDecoderInterface*)GetBlock(configuration, - "TelemetryDecoder", tlm, 1, 1, queue), "Channel", - "Channel", queue); + configuration, "Tracking", trk, 1, 1, queue), + (TelemetryDecoderInterface*)GetBlock(configuration, + "TelemetryDecoder", tlm, 1, 1, queue), "Channel", + "Channel", queue); } std::vector* GNSSBlockFactory::GetChannels( @@ -190,141 +187,143 @@ std::vector* GNSSBlockFactory::GetChannels( std::string telemetry_decoder = configuration->property( "TelemetryDecoder.implementation", default_implementation); for (unsigned int i = 0; i < channel_count; i++) - { + { - std::string acquisition_implementation_name = "Acquisition" - + boost::lexical_cast(i) + ".implementation"; - std::string acquisition_implementation = configuration->property( - acquisition_implementation_name, default_implementation); - channels->push_back(GetChannel(configuration, - acquisition_implementation, tracking, telemetry_decoder, i, - queue)); - //std::cout << "getchannel_" << i << ", acq_implementation_name: " - //<< acquisition_implementation_name << ", implementation: " - //<< acquisition_implementation << std::endl; + std::string acquisition_implementation_name = "Acquisition" + + boost::lexical_cast(i) + ".implementation"; + std::string acquisition_implementation = configuration->property( + acquisition_implementation_name, default_implementation); + channels->push_back(GetChannel(configuration, + acquisition_implementation, tracking, telemetry_decoder, i, + queue)); + //std::cout << "getchannel_" << i << ", acq_implementation_name: " + //<< acquisition_implementation_name << ", implementation: " + //<< acquisition_implementation << std::endl; - } + } DLOG(INFO) << "Getting " << channel_count << " channels"; return channels; } + + + + + /* + * Returns the block with the required configuration and implementation + * + * PLEASE ADD YOUR NEW BLOCK HERE!! + */ GNSSBlockInterface* GNSSBlockFactory::GetBlock( ConfigurationInterface *configuration, std::string role, std::string implementation, unsigned int in_streams, unsigned int out_streams, gr_msg_queue_sptr queue) { - /*! - * \brief Returns the block with the required configuration and implementation - * - * PLEASE ADD YOUR NEW BLOCK HERE!! - */ - - GNSSBlockInterface* block = NULL; //Change to nullptr when available in compilers (C++11) - // SIGNAL SOURCES + // SIGNAL SOURCES ------------------------------------------------------------- if (implementation.compare("File_Signal_Source") == 0) - { - block = new FileSignalSource(configuration, role, in_streams, - out_streams, queue); - } + { + block = new FileSignalSource(configuration, role, in_streams, + out_streams, queue); + } -// else if (implementation.compare("USRP1_Signal_Source") == 0) -// { -// block = new Usrp1SignalSource(configuration, role, in_streams, -// out_streams, queue); -// } + // else if (implementation.compare("USRP1_Signal_Source") == 0) + // { + // block = new Usrp1SignalSource(configuration, role, in_streams, + // out_streams, queue); + // } //! \todo Create a UHD block - // SIGNAL CONDITIONERS + // SIGNAL CONDITIONERS --------------------------------------------------------- else if (implementation.compare("Pass_Through") == 0) - { - block = new PassThrough(configuration, role, in_streams, out_streams); + { + block = new PassThrough(configuration, role, in_streams, out_streams); - } + } else if (implementation.compare("Direct_Resampler") == 0) - { - block = new DirectResamplerConditioner(configuration, role, - in_streams, out_streams); - } + { + block = new DirectResamplerConditioner(configuration, role, + in_streams, out_streams); + } - // ACQUISITION BLOCKS + // ACQUISITION BLOCKS --------------------------------------------------------- else if (implementation.compare("GPS_L1_CA_GPS_SDR_Acquisition") == 0) - { - block = new GpsL1CaGpsSdrAcquisition(configuration, role, in_streams, - out_streams, queue); - } + { + block = new GpsL1CaGpsSdrAcquisition(configuration, role, in_streams, + out_streams, queue); + } else if (implementation.compare("GPS_L1_CA_PCPS_Acquisition") == 0) - { - block = new GpsL1CaPcpsAcquisition(configuration, role, in_streams, - out_streams, queue); - } + { + block = new GpsL1CaPcpsAcquisition(configuration, role, in_streams, + out_streams, queue); + } else if (implementation.compare("GPS_L1_CA_TONG_PCPS_Acquisition") == 0) - { - block = new GpsL1CaTongPcpsAcquisition(configuration, role, - in_streams, out_streams, queue); - } + { + block = new GpsL1CaTongPcpsAcquisition(configuration, role, + in_streams, out_streams, queue); + } - // TRACKING BLOCKS + // TRACKING BLOCKS ------------------------------------------------------------- else if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking") == 0) - { - block = new GpsL1CaDllPllTracking(configuration, role, in_streams, - out_streams, queue); - } + { + block = new GpsL1CaDllPllTracking(configuration, role, in_streams, + out_streams, queue); + } else if (implementation.compare("GPS_L1_CA_DLL_FLL_PLL_Tracking") == 0) - { - block = new GpsL1CaDllFllPllTracking(configuration, role, in_streams, - out_streams, queue); - } + { + block = new GpsL1CaDllFllPllTracking(configuration, role, in_streams, + out_streams, queue); + } - // TELEMETRY DECODERS + // TELEMETRY DECODERS ---------------------------------------------------------- else if (implementation.compare("GPS_L1_CA_Telemetry_Decoder") == 0) - { - block = new GpsL1CaTelemetryDecoder(configuration, role, in_streams, - out_streams, queue); - } + { + block = new GpsL1CaTelemetryDecoder(configuration, role, in_streams, + out_streams, queue); + } - // OBSERVABLES + // OBSERVABLES ----------------------------------------------------------------- else if (implementation.compare("GPS_L1_CA_Observables") == 0) - { - block = new GpsL1CaObservables(configuration, role, in_streams, - out_streams, queue); - } + { + block = new GpsL1CaObservables(configuration, role, in_streams, + out_streams, queue); + } - // PVT + // PVT ------------------------------------------------------------------------- else if (implementation.compare("GPS_L1_CA_PVT") == 0) - { - block = new GpsL1CaPvt(configuration, role, in_streams, - out_streams, queue); - } + { + block = new GpsL1CaPvt(configuration, role, in_streams, + out_streams, queue); + } - // OUTPUT FILTERS + // OUTPUT FILTERS -------------------------------------------------------------- else if (implementation.compare("Null_Sink_Output_Filter") == 0) - { - block = new NullSinkOutputFilter(configuration, role, in_streams, - out_streams); - } + { + block = new NullSinkOutputFilter(configuration, role, in_streams, + out_streams); + } else if (implementation.compare("File_Output_Filter") == 0) - { - block = new FileOutputFilter(configuration, role, in_streams, - out_streams); - } + { + block = new FileOutputFilter(configuration, role, in_streams, + out_streams); + } else - { - // Log fatal. This causes execution to stop. - LOG_AT_LEVEL(ERROR) << implementation - << ": Undefined implementation for block"; - } + { + // Log fatal. This causes execution to stop. + LOG_AT_LEVEL(ERROR) << implementation + << ": Undefined implementation for block"; + } return block; } diff --git a/src/core/receiver/gnss_block_factory.h b/src/core/receiver/gnss_block_factory.h index d0b6b5200..ff18f762d 100644 --- a/src/core/receiver/gnss_block_factory.h +++ b/src/core/receiver/gnss_block_factory.h @@ -1,6 +1,6 @@ /*! * \file gnss_block_factory.h - * \brief This class implements a factory that returns instances of GNSS blocks. + * \brief Interface of a factory that returns instances of GNSS blocks. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Luis Esteve, 2011. luis(at)epsilon-formacion.com * Javier Arribas, 2011. jarribas(at)cttc.es @@ -38,7 +38,6 @@ #include #include - #include class ConfigurationInterface; @@ -67,6 +66,10 @@ public: gr_msg_queue_sptr queue); std::vector* GetChannels( ConfigurationInterface *configuration, gr_msg_queue_sptr queue); + + /* + * \brief Returns the block with the required configuration and implementation + */ GNSSBlockInterface* GetBlock(ConfigurationInterface* configuration, std::string role, std::string implementation, unsigned int in_streams, unsigned int out_streams, diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 7c7160755..979e681b0 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -1,6 +1,6 @@ /*! * \file gnss_flowgraph.cc - * \brief Brief description of the file here + * \brief Implementation of a GNSS receiver flowgraph * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Luis Esteve, 2011. luis(at)epsilon-formacion.com * @@ -64,9 +64,9 @@ GNSSFlowgraph::~GNSSFlowgraph() delete block_factory_; for (unsigned int i = 0; i < blocks_->size(); i++) - { - delete blocks_->at(i); - } + { + delete blocks_->at(i); + } blocks_->clear(); delete blocks_; @@ -75,20 +75,20 @@ GNSSFlowgraph::~GNSSFlowgraph() void GNSSFlowgraph::start() { if (running_) - { - LOG_AT_LEVEL(WARNING) << "Already running"; - return; - } + { + LOG_AT_LEVEL(WARNING) << "Already running"; + return; + } try { - top_block_->start(); + top_block_->start(); } catch (std::exception& e) { - LOG_AT_LEVEL(ERROR) << "Unable to start flowgraph"; - LOG_AT_LEVEL(ERROR) << e.what(); - return; + LOG_AT_LEVEL(ERROR) << "Unable to start flowgraph"; + LOG_AT_LEVEL(ERROR) << e.what(); + return; } running_ = true; @@ -97,9 +97,9 @@ void GNSSFlowgraph::start() void GNSSFlowgraph::stop() { for (unsigned int i = 0; i < channels_count_; i++) - { - channel(i)->stop(); - } + { + channel(i)->stop(); + } DLOG(INFO) << "Threads finished. Return to main program."; top_block_->stop(); running_ = false; @@ -107,184 +107,184 @@ void GNSSFlowgraph::stop() void GNSSFlowgraph::connect() { - /* Connects the blocks in the flowgraph - * - * Signal Source > Signal conditioner > Channels >> Observables >> PVT > Output filter - */ - DLOG(INFO) << "Connecting flowgraph"; + /* Connects the blocks in the flowgraph + * + * Signal Source > Signal conditioner > Channels >> Observables >> PVT > Output filter + */ + DLOG(INFO) << "Connecting flowgraph"; if (connected_) - { - LOG_AT_LEVEL(WARNING) << "flowgraph already connected"; - return; - } + { + LOG_AT_LEVEL(WARNING) << "flowgraph already connected"; + return; + } // Connect GNSS block internally try { - signal_source()->connect(top_block_); + signal_source()->connect(top_block_); } catch (std::exception& e) { - LOG_AT_LEVEL(ERROR) << "Can't connect signal source block internally"; - LOG_AT_LEVEL(ERROR) << e.what(); - top_block_->disconnect_all(); - return; - } - - try - { - signal_conditioner()->connect(top_block_); - } - catch (std::exception& e) - { - LOG_AT_LEVEL(ERROR) - << "Can't connect signal conditioner block internally"; - LOG_AT_LEVEL(ERROR) << e.what(); - top_block_->disconnect_all(); - return; - } - - for (unsigned int i = 0; i < channels_count_; i++) - { - try - { - channel(i)->connect(top_block_); - } - catch (std::exception& e) - { - LOG_AT_LEVEL(ERROR) << "Can't connect channel " << i - << " internally"; + LOG_AT_LEVEL(ERROR) << "Can't connect signal source block internally"; LOG_AT_LEVEL(ERROR) << e.what(); top_block_->disconnect_all(); return; + } + + try + { + signal_conditioner()->connect(top_block_); + } + catch (std::exception& e) + { + LOG_AT_LEVEL(ERROR) + << "Can't connect signal conditioner block internally"; + LOG_AT_LEVEL(ERROR) << e.what(); + top_block_->disconnect_all(); + return; + } + + for (unsigned int i = 0; i < channels_count_; i++) + { + try + { + channel(i)->connect(top_block_); + } + catch (std::exception& e) + { + LOG_AT_LEVEL(ERROR) << "Can't connect channel " << i + << " internally"; + LOG_AT_LEVEL(ERROR) << e.what(); + top_block_->disconnect_all(); + return; + } } + + try + { + observables()->connect(top_block_); + } + catch (std::exception& e) + { + LOG_AT_LEVEL(ERROR) << "Can't connect observables block internally"; + LOG_AT_LEVEL(ERROR) << e.what(); + top_block_->disconnect_all(); + return; } try { - observables()->connect(top_block_); + pvt()->connect(top_block_); } catch (std::exception& e) { - LOG_AT_LEVEL(ERROR) << "Can't connect observables block internally"; - LOG_AT_LEVEL(ERROR) << e.what(); - top_block_->disconnect_all(); - return; + LOG_AT_LEVEL(ERROR) << "Can't connect PVT block internally"; + LOG_AT_LEVEL(ERROR) << e.what(); + top_block_->disconnect_all(); + return; } try { - pvt()->connect(top_block_); + output_filter()->connect(top_block_); } catch (std::exception& e) { - LOG_AT_LEVEL(ERROR) << "Can't connect PVT block internally"; - LOG_AT_LEVEL(ERROR) << e.what(); - top_block_->disconnect_all(); - return; - } - - try - { - output_filter()->connect(top_block_); - } - catch (std::exception& e) - { - LOG_AT_LEVEL(ERROR) << "Can't connect output filter block internally"; - LOG_AT_LEVEL(ERROR) << e.what(); - top_block_->disconnect_all(); - return; + LOG_AT_LEVEL(ERROR) << "Can't connect output filter block internally"; + LOG_AT_LEVEL(ERROR) << e.what(); + top_block_->disconnect_all(); + return; } DLOG(INFO) << "blocks connected internally"; try { - top_block_->connect(signal_source()->get_right_block(), 0, - signal_conditioner()->get_left_block(), 0); + top_block_->connect(signal_source()->get_right_block(), 0, + signal_conditioner()->get_left_block(), 0); } catch (std::exception& e) { - LOG_AT_LEVEL(ERROR) - << "Can't connect signal source to signal conditioner"; - LOG_AT_LEVEL(ERROR) << e.what(); - top_block_->disconnect_all(); - return; + LOG_AT_LEVEL(ERROR) + << "Can't connect signal source to signal conditioner"; + LOG_AT_LEVEL(ERROR) << e.what(); + top_block_->disconnect_all(); + return; } DLOG(INFO) << "Signal source connected to signal conditioner"; for (unsigned int i = 0; i < channels_count_; i++) - { - try { - top_block_->connect(signal_conditioner()->get_right_block(), 0, - channel(i)->get_left_block(), 0); - } - catch (std::exception& e) - { - LOG_AT_LEVEL(ERROR) - << "Can't connect signal conditioner to channel " << i; - LOG_AT_LEVEL(ERROR) << e.what(); - top_block_->disconnect_all(); - return; - } + try + { + top_block_->connect(signal_conditioner()->get_right_block(), 0, + channel(i)->get_left_block(), 0); + } + catch (std::exception& e) + { + LOG_AT_LEVEL(ERROR) + << "Can't connect signal conditioner to channel " << i; + LOG_AT_LEVEL(ERROR) << e.what(); + top_block_->disconnect_all(); + return; + } - DLOG(INFO) << "signal conditioner connected to channel " << i; + DLOG(INFO) << "signal conditioner connected to channel " << i; - try - { - top_block_->connect(channel(i)->get_right_block(), 0, - observables()->get_left_block(), i); + try + { + top_block_->connect(channel(i)->get_right_block(), 0, + observables()->get_left_block(), i); + } + catch (std::exception& e) + { + LOG_AT_LEVEL(ERROR) << "Can't connect channel " << i + << " to observables"; + LOG_AT_LEVEL(ERROR) << e.what(); + top_block_->disconnect_all(); + return; + } + + channel(i)->set_satellite(available_GPS_satellites_IDs_->front()); + std::cout << "Channel " << i << " satellite " + << available_GPS_satellites_IDs_->front() << std::endl; + available_GPS_satellites_IDs_->pop_front(); + channel(i)->start(); + //channel(i)->start_acquisition(); + + DLOG(INFO) << "Channel " << i + << " connected to observables and ready for acquisition"; } - catch (std::exception& e) - { - LOG_AT_LEVEL(ERROR) << "Can't connect channel " << i - << " to observables"; - LOG_AT_LEVEL(ERROR) << e.what(); - top_block_->disconnect_all(); - return; - } - - channel(i)->set_satellite(available_GPS_satellites_IDs_->front()); - std::cout << "Channel " << i << " satellite " - << available_GPS_satellites_IDs_->front() << std::endl; - available_GPS_satellites_IDs_->pop_front(); - channel(i)->start(); - //channel(i)->start_acquisition(); - - DLOG(INFO) << "Channel " << i - << " connected to observables and ready for acquisition"; - } /* * Connect the observables output of each channel to the PVT block */ try { - for (unsigned int i = 0; i < channels_count_; i++) - { - top_block_->connect(observables()->get_right_block(), i, - pvt()->get_left_block(), i); - } + for (unsigned int i = 0; i < channels_count_; i++) + { + top_block_->connect(observables()->get_right_block(), i, + pvt()->get_left_block(), i); + } } catch (std::exception& e) { - LOG_AT_LEVEL(ERROR) << "Can't connect observables to PVT"; - LOG_AT_LEVEL(ERROR) << e.what(); - top_block_->disconnect_all(); - return; + LOG_AT_LEVEL(ERROR) << "Can't connect observables to PVT"; + LOG_AT_LEVEL(ERROR) << e.what(); + top_block_->disconnect_all(); + return; } try { - top_block_->connect(pvt()->get_right_block(), 0, - output_filter()->get_left_block(), 0); + top_block_->connect(pvt()->get_right_block(), 0, + output_filter()->get_left_block(), 0); } catch (std::exception& e) { - LOG_AT_LEVEL(ERROR) << "Can't connect PVT to output filter"; - LOG_AT_LEVEL(ERROR) << e.what(); - top_block_->disconnect_all(); - return; + LOG_AT_LEVEL(ERROR) << "Can't connect PVT to output filter"; + LOG_AT_LEVEL(ERROR) << e.what(); + top_block_->disconnect_all(); + return; } DLOG(INFO) << "PVT connected to output filter"; @@ -298,42 +298,42 @@ void GNSSFlowgraph::connect() void GNSSFlowgraph::wait() { if (!running_) - { - LOG_AT_LEVEL(WARNING) << "Can't apply wait. Flowgraph is not running"; - return; - } + { + LOG_AT_LEVEL(WARNING) << "Can't apply wait. Flowgraph is not running"; + return; + } top_block_->wait(); DLOG(INFO) << "Flowgraph finished calculations"; running_ = false; } +/* + * Applies an action to the flowgraph + * + * \param[in] who Who generated the action + * \param[in] what What is the action 0: acquisition failed + */ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) { - /*! - * \brief Applies an action to the flowgraph - * - * \param[in] who Who generated the action - * \param[in] what What is the action 0: acquisition failed - */ DLOG(INFO) << "received " << what << " from " << who; switch (what) { - case 0: + case 0: - LOG_AT_LEVEL(INFO) << "Channel " << who - << " ACQ FAILED satellite " << channel(who)->satellite(); - available_GPS_satellites_IDs_->push_back( - channel(who)->satellite()); - channel(who)->set_satellite( - available_GPS_satellites_IDs_->front()); - available_GPS_satellites_IDs_->pop_front(); - channel(who)->start_acquisition(); - break; - // TODO: Tracking messages + LOG_AT_LEVEL(INFO) << "Channel " << who + << " ACQ FAILED satellite " << channel(who)->satellite(); + available_GPS_satellites_IDs_->push_back( + channel(who)->satellite()); + channel(who)->set_satellite( + available_GPS_satellites_IDs_->front()); + available_GPS_satellites_IDs_->pop_front(); + channel(who)->start_acquisition(); + break; + // TODO: Tracking messages - default: - break; + default: + break; } DLOG(INFO) << "available channels " @@ -343,17 +343,17 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) void GNSSFlowgraph::set_configuration(ConfigurationInterface* configuration) { if (running_) - { - LOG_AT_LEVEL(WARNING) - << "Unable to update configuration while flowgraph running"; - return; - } + { + 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; } @@ -390,9 +390,9 @@ GNSSBlockInterface* GNSSFlowgraph::output_filter() void GNSSFlowgraph::init() { - /*! - * \brief Instantiates the receiver blocks - */ + /* + * Instantiates the receiver blocks + */ blocks_->push_back( block_factory_->GetSignalSource(configuration_, queue_)); blocks_->push_back(block_factory_->GetSignalConditioner(configuration_, @@ -408,9 +408,9 @@ void GNSSFlowgraph::init() channels_count_ = channels->size(); for (unsigned int i = 0; i < channels_count_; i++) - { - blocks_->push_back(channels->at(i)); - } + { + blocks_->push_back(channels->at(i)); + } top_block_ = gr_make_top_block("GNSSFlowgraph"); @@ -429,45 +429,45 @@ void GNSSFlowgraph::init() void GNSSFlowgraph::set_satellites_list() { - /* - * Sets a sequential list of satellites (1...33) - */ + /* + * Sets a sequential list of satellites (1...33) + */ - /*! - * \TODO Describe GNSS satellites more nicely, with RINEX notation - * See http://igscb.jpl.nasa.gov/igscb/data/format/rinex301.pdf (page 5) - */ - for (unsigned int id = 1; id < 33; id++) - { - available_GPS_satellites_IDs_->push_back(id); - } + /*! + * \TODO Describe GNSS satellites more nicely, with RINEX notation + * See http://igscb.jpl.nasa.gov/igscb/data/format/rinex301.pdf (page 5) + */ + for (unsigned int id = 1; id < 33; id++) + { + available_GPS_satellites_IDs_->push_back(id); + } std::list::iterator it = available_GPS_satellites_IDs_->begin(); for (unsigned int i = 0; i < channels_count_; i++) - { - unsigned int sat = configuration_->property("Acquisition" - + boost::lexical_cast(i) + ".satellite", 0); - if ((sat == 0) || (sat==*it)) // 0 = not PRN in configuration file { - it++; + unsigned int sat = configuration_->property("Acquisition" + + boost::lexical_cast(i) + ".satellite", 0); + if ((sat == 0) || (sat==*it)) // 0 = not PRN in configuration file + { + it++; + } + else + { + available_GPS_satellites_IDs_->remove(sat); + available_GPS_satellites_IDs_->insert(it, sat); + } } - else - { - available_GPS_satellites_IDs_->remove(sat); - available_GPS_satellites_IDs_->insert(it, sat); - } - } -// std::cout << "Satellite queue: "; -// for (std::list::iterator it = -// available_GPS_satellites_IDs_->begin(); it -// != available_GPS_satellites_IDs_->end(); it++) -// { -// std::cout << *it << ", "; -// } -// std::cout << std::endl; + // std::cout << "Satellite queue: "; + // for (std::list::iterator it = + // available_GPS_satellites_IDs_->begin(); it + // != available_GPS_satellites_IDs_->end(); it++) + // { + // std::cout << *it << ", "; + // } + // std::cout << std::endl; } diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index 370721610..aa5ff4704 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -1,6 +1,6 @@ /*! * \file gnss_flowgraph.h - * \brief This class represents a GNSS flowgraph. + * \brief Interface of a GNSS receiver flowgraph. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Luis Esteve, 2011. luis(at)epsilon-formacion.com * @@ -55,15 +55,15 @@ class GNSSFlowgraph { public: - /*! - * \brief Constructor that initializes the receiver flowgraph + /*! + * \brief Constructor that initializes the receiver flowgraph */ GNSSFlowgraph(ConfigurationInterface* configuration, gr_msg_queue_sptr queue); - /*! - * \brief Virtual destructor - */ + /*! + * \brief Virtual destructor + */ virtual ~GNSSFlowgraph(); //! \brief Start the flowgraph @@ -72,15 +72,21 @@ public: //! \brief Stop the flowgraph void stop(); - /*! - * \brief Connects the defined blocks in the flowgraph - * - * Signal Source > Signal conditioner > Channels >> Observables >> PVT > Output filter - */ + /*! + * \brief Connects the defined blocks in the flowgraph + * + * Signal Source > Signal conditioner > Channels >> Observables >> PVT > Output filter + */ void connect(); void wait(); + /*! + * \brief Applies an action to the flowgraph + * + * \param[in] who Who generated the action + * \param[in] what What is the action 0: acquisition failed + */ void apply_action(unsigned int who, unsigned int what); void set_configuration(ConfigurationInterface* configuration); diff --git a/src/core/receiver/in_memory_configuration.cc b/src/core/receiver/in_memory_configuration.cc index a06c8e49e..a96e6a0de 100644 --- a/src/core/receiver/in_memory_configuration.cc +++ b/src/core/receiver/in_memory_configuration.cc @@ -1,10 +1,9 @@ /*! - * \file - * \brief Brief description of the file here + * \file in_memory_configuration.cc + * \brief This implementation accepts configuration parameters upon instantiation and + * it is intended to be used in unit testing. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * - * Detailed description of the file here if needed. - * * ------------------------------------------------------------------------- * * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) @@ -32,9 +31,7 @@ #include "in_memory_configuration.h" - #include - #include "string_converter.h" InMemoryConfiguration::InMemoryConfiguration() diff --git a/src/core/receiver/in_memory_configuration.h b/src/core/receiver/in_memory_configuration.h index fd33deb3e..e49ffd1c4 100644 --- a/src/core/receiver/in_memory_configuration.h +++ b/src/core/receiver/in_memory_configuration.h @@ -1,6 +1,6 @@ /*! * \file in_memory_configuration.h - * \brief This class is an implementation of the interface ConfigurationInterface. + * \brief A ConfigurationInterface for testing purposes. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * * This implementation accepts configuration parameters upon instantiation and diff --git a/src/main/main.cc b/src/main/main.cc index 1f9ff97da..c4adaa8a5 100644 --- a/src/main/main.cc +++ b/src/main/main.cc @@ -3,8 +3,8 @@ * \brief Main file of the GNSS-SDR program. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * - * It creates a ControlThread object, makes it run, and releases memory - * back when the main thread has ended. + * It sets up the logging system, creates a ControlThread object, + * makes it run, and releases memory back when the main thread has ended. * * ------------------------------------------------------------------------- * @@ -51,8 +51,8 @@ DECLARE_string(log_dir); * \todo make this queue generic for all the GNSS systems (javi) */ -/*! - * \brief Concurrent queue that communicates the Telemetry Decoder +/* + * Concurrent queue that communicates the Telemetry Decoder * to the Observables modules */ concurrent_queue global_gps_nav_msg_queue; @@ -61,12 +61,12 @@ int main(int argc, char** argv) { const std::string intro_help( std::string("\nGNSS-SDR is an Open Source GNSS Software Defined Receiver\n") - + - "Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors)\n" - + - "This program comes with ABSOLUTELY NO WARRANTY;\n" - + - "See COPYING file to see a copy of the General Public License\n \n"); + + + "Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors)\n" + + + "This program comes with ABSOLUTELY NO WARRANTY;\n" + + + "See COPYING file to see a copy of the General Public License\n \n"); google::SetUsageMessage(intro_help); @@ -77,20 +77,20 @@ int main(int argc, char** argv) google::InitGoogleLogging(argv[0]); if (FLAGS_log_dir.empty()) - { - std::cout << "Logging will be done at " << boost::filesystem::temp_directory_path() << std::endl - << "Use gnss-sdr --log_dir=/path/to/log to change that."<< std::endl; - } + { + std::cout << "Logging will be done at " << boost::filesystem::temp_directory_path() << std::endl + << "Use gnss-sdr --log_dir=/path/to/log to change that."<< std::endl; + } else - { - const boost::filesystem::path p (FLAGS_log_dir); - if (!boost::filesystem::exists(p)) - { - std::cout << "The path " << FLAGS_log_dir << " does not exist, attepting to create it" << std::endl; - boost::filesystem::create_directory(p); - } - std::cout << "Logging with be done at " << FLAGS_log_dir << std::endl; - } + { + const boost::filesystem::path p (FLAGS_log_dir); + if (!boost::filesystem::exists(p)) + { + std::cout << "The path " << FLAGS_log_dir << " does not exist, attempting to create it" << std::endl; + boost::filesystem::create_directory(p); + } + std::cout << "Logging with be done at " << FLAGS_log_dir << std::endl; + }