diff --git a/src/algorithms/PVT/adapters/gps_l1_ca_pvt.h b/src/algorithms/PVT/adapters/gps_l1_ca_pvt.h index b7afd653f..bcfdc9a7f 100644 --- a/src/algorithms/PVT/adapters/gps_l1_ca_pvt.h +++ b/src/algorithms/PVT/adapters/gps_l1_ca_pvt.h @@ -31,17 +31,18 @@ -#ifndef GPS_L1_CA_PVT_H_ -#define GPS_L1_CA_PVT_H_ +#ifndef GNSS_SDR_GPS_L1_CA_PVT_H_ +#define GNSS_SDR_GPS_L1_CA_PVT_H_ #include "pvt_interface.h" - #include "gps_l1_ca_pvt_cc.h" - #include class ConfigurationInterface; +/*! + * \brief This class implements a PVT interface for GPS L1 C/A + */ class GpsL1CaPvt : public PvtInterface { 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 888b7f85a..60fb9d72f 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 using Least Squares algorithm + * \brief Position Velocity and Time computation for GPS L1 C/A * \author Javier Arribas, 2011. jarribas(at)cttc.es * ------------------------------------------------------------------------- * @@ -33,23 +33,17 @@ #include #include #include - #include #include "math.h" - -#include "gps_l1_ca_pvt_cc.h" - -#include "control_message_factory.h" - #include - #include #include +#include "gps_l1_ca_pvt_cc.h" +#include "control_message_factory.h" + using google::LogMessage; -using namespace std; - 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) { @@ -91,7 +85,7 @@ gps_l1_ca_pvt_cc::~gps_l1_ca_pvt_cc() { delete d_ls_pvt; } -bool pseudoranges_pairCompare_min( pair a, pair b) +bool pseudoranges_pairCompare_min( std::pair a, std::pair b) { return (a.second.pseudorange_m) < (b.second.pseudorange_m); } @@ -101,8 +95,8 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_ite d_sample_counter++; - map gnss_pseudoranges_map; - 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 @@ -110,28 +104,28 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_ite { if (in[i][0].valid==true) { - gnss_pseudoranges_map.insert(pair(in[i][0].SV_ID,in[i][0])); //record the valid psudorrange in a map + gnss_pseudoranges_map.insert(std::pair(in[i][0].SV_ID,in[i][0])); //record the valid pseudorange in a map } } //debug print - cout << setprecision(16); + std::cout << std::setprecision(16); for(gnss_pseudoranges_iter = gnss_pseudoranges_map.begin(); gnss_pseudoranges_iter != gnss_pseudoranges_map.end(); gnss_pseudoranges_iter++) { - cout<<"Pseudoranges(SV ID,pseudorange [m]) =("<first<<","<second.pseudorange_m<<")"<first<<","<second.pseudorange_m<<")"<try_pop(nav_msg)==true) { - cout<<"New ephemeris record has arrived from SAT ID "<d_ephemeris[nav_msg.d_channel_ID]=nav_msg; // **** update pseudoranges clock **** 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 35b7f3a46..e223e8db8 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 using Least Squares algorithm + * \brief Position Velocity and Time computation for GPS L1 C/A * \author Javier Arribas, 2011. jarribas(at)cttc.es * ------------------------------------------------------------------------- * @@ -27,26 +27,20 @@ * ------------------------------------------------------------------------- */ -#ifndef GPS_L1_CA_PVT_CC_H -#define GPS_L1_CA_PVT_CC_H +#ifndef GNSS_SDR_GPS_L1_CA_PVT_CC_H +#define GNSS_SDR_GPS_L1_CA_PVT_CC_H #include - #include #include - #include #include #include - #include "concurrent_queue.h" - #include "gps_navigation_message.h" #include "kml_printer.h" - #include "rinex_2_1_printer.h" #include "gps_l1_ca_ls_pvt.h" - #include "GPS_L1_CA.h" class gps_l1_ca_pvt_cc; @@ -54,7 +48,9 @@ typedef boost::shared_ptr gps_l1_ca_pvt_cc_sptr; gps_l1_ca_pvt_cc_sptr gps_l1_ca_make_pvt_cc(unsigned int n_channels, gr_msg_queue_sptr queue, bool dump, std::string dump_filename, int averaging_depth, bool flag_averaging); - +/*! + * \brief This class implements a block that computes the PVT solution + */ class gps_l1_ca_pvt_cc : public gr_block { private: 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 edf456e81..82961d4a7 100644 --- a/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.cc +++ b/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.cc @@ -27,24 +27,10 @@ * * ------------------------------------------------------------------------- */ -/*! - * Using ITPP - */ -//#include -//#include -//#include - -//using namespace itpp; - -/*! - * Using armadillo - */ #include "armadillo" - -//using namespace arma; - #include "gps_l1_ca_ls_pvt.h" +#include "GPS_L1_CA.h" gps_l1_ca_ls_pvt::gps_l1_ca_ls_pvt(int nchannels,std::string dump_filename, bool flag_dump_to_file) @@ -87,24 +73,22 @@ gps_l1_ca_ls_pvt::~gps_l1_ca_ls_pvt() arma::vec gps_l1_ca_ls_pvt::e_r_corr(double traveltime, arma::vec X_sat) { /* - %E_R_CORR Returns rotated satellite ECEF coordinates due to Earth - %rotation during signal travel time - % - %X_sat_rot = e_r_corr(traveltime, X_sat); - % - % Inputs: - % travelTime - signal travel time - % X_sat - satellite's ECEF coordinates - % - % Outputs: - % X_sat_rot - rotated satellite's coordinates (ECEF) + * Returns rotated satellite ECEF coordinates due to Earth + * rotation during signal travel time + * + * Inputs: + * travelTime - signal travel time + * X_sat - satellite's ECEF coordinates + * + * Returns: + * X_sat_rot - rotated satellite's coordinates (ECEF) */ - double Omegae_dot = 7.292115147e-5; // rad/sec + //const double Omegae_dot = 7.292115147e-5; // rad/sec //--- Find rotation angle -------------------------------------------------- double omegatau; - omegatau = Omegae_dot * traveltime; + omegatau = OMEGA_EARTH_DOT * traveltime; //--- Make a rotation matrix ----------------------------------------------- arma::mat R3=arma::zeros(3,3); @@ -124,24 +108,17 @@ arma::vec gps_l1_ca_ls_pvt::e_r_corr(double traveltime, arma::vec X_sat) { } arma::vec gps_l1_ca_ls_pvt::leastSquarePos(arma::mat satpos, arma::vec obs, arma::mat w) { - //Function calculates the Least Square Solution. - - //pos= leastSquarePos(satpos, obs, w); - - // Inputs: - // satpos - Satellites positions (in ECEF system: [X; Y; Z;] - // obs - Observations - the pseudorange measurements to each - // satellite - // w - weigths vector - - // Outputs: - // pos - receiver position and receiver clock error - // (in ECEF system: [X, Y, Z, dt]) - - ////////////////////////////////////////////////////////////////////////// - // el - Satellites elevation angles (degrees) - // az - Satellites azimuth angles (degrees) - // dop - Dilutions Of Precision ([GDOP PDOP HDOP VDOP TDOP]) + /*Function calculates the Least Square Solution. + * Inputs: + * satpos - Satellites positions in ECEF system: [X; Y; Z;] + * obs - Observations - the pseudorange measurements to each + * satellite + * w - weigths vector + * + * Returns: + * pos - receiver position and receiver clock error + * (in ECEF system: [X, Y, Z, dt]) + */ //=== Initialization ======================================================= int nmbOfIterations = 10; // TODO: include in config @@ -150,7 +127,6 @@ arma::vec gps_l1_ca_ls_pvt::leastSquarePos(arma::mat satpos, arma::vec obs, arma int nmbOfSatellites; - //nmbOfSatellites = satpos.cols(); //ITPP nmbOfSatellites = satpos.n_cols; //Armadillo arma::vec pos = "0.0 0.0 0.0 0.0"; arma::mat A; @@ -183,7 +159,6 @@ arma::vec gps_l1_ca_ls_pvt::leastSquarePos(arma::mat satpos, arma::vec obs, arma for (int i = 0; i < nmbOfSatellites; i++) { if (iter == 0) { //--- Initialize variables at the first iteration -------------- - //Rot_X=X.get_col(i); //ITPP Rot_X=X.col(i); //Armadillo trop = 0.0; } else { @@ -191,22 +166,16 @@ arma::vec gps_l1_ca_ls_pvt::leastSquarePos(arma::mat satpos, arma::vec obs, arma rho2 = (X(0, i) - pos(0))*(X(0, i) - pos(0)) + (X(1, i) - pos(1))*(X(1, i) - pos(1))+ (X(2,i) - pos(2))*(X(2,i) - pos(2)); traveltime = sqrt(rho2) / GPS_C_m_s; //--- Correct satellite position (do to earth rotation) -------- - //Rot_X = e_r_corr(traveltime, X.get_col(i)); //ITPP + Rot_X = e_r_corr(traveltime, X.col(i)); //armadillo //--- Find the elevation angel of the satellite ---------------- //[az(i), el(i), dist] = topocent(pos(1:3, :), Rot_X - pos(1:3, :)); } //--- Apply the corrections ---------------------------------------- - //omc(i) = (obs(i) - norm(Rot_X - pos(3)) - pos(4) - trop); //ITPP omc(i) = (obs(i) - norm(Rot_X - pos.subvec(0,2),2) - pos(3) - trop); // Armadillo - //--- Construct the A matrix --------------------------------------- - //ITPP - //A.set(i, 0, (-(Rot_X(0) - pos(0))) / obs(i)); - //A.set(i, 1, (-(Rot_X(1) - pos(1))) / obs(i)); - //A.set(i, 2, (-(Rot_X(2) - pos(2))) / obs(i)); - //A.set(i, 3, 1.0); + //--- Construct the A matrix --------------------------------------- //Armadillo A(i,0)=(-(Rot_X(0) - pos(0))) / obs(i); A(i,1)=(-(Rot_X(1) - pos(1))) / obs(i); @@ -222,7 +191,6 @@ arma::vec gps_l1_ca_ls_pvt::leastSquarePos(arma::mat satpos, arma::vec obs, arma //} //--- Find position update --------------------------------------------- - // x = ls_solve_od(w*A,w*omc); // ITPP x = arma::solve(w*A,w*omc); // Armadillo //--- Apply position update -------------------------------------------- @@ -235,12 +203,7 @@ arma::vec gps_l1_ca_ls_pvt::leastSquarePos(arma::mat satpos, arma::vec obs, arma bool gps_l1_ca_ls_pvt::get_PVT(std::map gnss_pseudoranges_map,double GPS_current_time,bool flag_averaging) { std::map::iterator gnss_pseudoranges_iter; - //ITPP - //mat W=eye(d_nchannels); //channels weights matrix - //vec obs=zeros(d_nchannels); // pseudoranges observation vector - //mat satpos=zeros(3,d_nchannels); //satellite positions matrix - // Armadillo arma::mat W=arma::eye(d_nchannels,d_nchannels); //channels weights matrix arma::vec obs=arma::zeros(d_nchannels); // pseudoranges observation vector arma::mat satpos=arma::zeros(3,d_nchannels); //satellite positions matrix @@ -288,7 +251,7 @@ bool gps_l1_ca_ls_pvt::get_PVT(std::map gnss_pseudoranges_ mypos=leastSquarePos(satpos,obs,W); std::cout << "Position at TOW="< gnss_pseudoranges_ } void gps_l1_ca_ls_pvt::cart2geo(double X, double Y, double Z, int elipsoid_selection) { - //function [phi, lambda, h] = cart2geo(X, Y, Z, i) - //CART2GEO Conversion of Cartesian coordinates (X,Y,Z) to geographical - //coordinates (phi, lambda, h) on a selected reference ellipsoid. + // Conversion of Cartesian coordinates (X,Y,Z) to geographical + // coordinates (latitude, longitude, h) on a selected reference ellipsoid. // - //[phi, lambda, h] = cart2geo(X, Y, Z, i); // - // Choices i of Reference Ellipsoid for Geographical Coordinates + // Choices of Reference Ellipsoid for Geographical Coordinates // 0. International Ellipsoid 1924 // 1. International Ellipsoid 1967 // 2. World Geodetic System 1972 // 3. Geodetic Reference System 1980 // 4. World Geodetic System 1984 - double a[5] = {6378388, 6378160, 6378135, 6378137, 6378137}; - double f[5] = {1/297, 1/298.247, 1/298.26, 1/298.257222101, 1/298.257223563}; + const double a[5] = {6378388, 6378160, 6378135, 6378137, 6378137}; + const double f[5] = {1/297, 1/298.247, 1/298.26, 1/298.257222101, 1/298.257223563}; double lambda; lambda = atan2(Y,X); 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 c8f364404..85fe4c0a5 100644 --- a/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.h +++ b/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.h @@ -27,8 +27,8 @@ * * ------------------------------------------------------------------------- */ -#ifndef GPS_L1_CA_LS_PVT_H_ -#define GPS_L1_CA_LS_PVT_H_ +#ifndef GNSS_SDR_GPS_L1_CA_LS_PVT_H_ +#define GNSS_SDR_GPS_L1_CA_LS_PVT_H_ #include #include @@ -43,17 +43,11 @@ #include #include "gps_navigation_message.h" #include "GPS_L1_CA.h" - -//#include -//#include -//#include - #include "armadillo" -//using namespace arma; - -//using namespace itpp; - +/*! + * \brief This class implements a simple PVT Least Squares solution + */ class gps_l1_ca_ls_pvt { private: @@ -62,21 +56,21 @@ private: //void cart2geo(); //void topocent(); public: - int d_nchannels; + int d_nchannels; //! Number of available channels for positioning gps_navigation_message* d_ephemeris; double d_pseudoranges_time_ms; - double d_latitude_d; - double d_longitude_d; - double d_height_m; + double d_latitude_d; //! Latitude in degrees + double d_longitude_d; //! Longitude in degrees + double d_height_m; //! Height [m] //averaging std::deque d_hist_latitude_d; std::deque d_hist_longitude_d; std::deque d_hist_height_m; - int d_averaging_depth; + int d_averaging_depth; //! Length of averaging window - double d_avg_latitude_d; - double d_avg_longitude_d; - double d_avg_height_m; + double d_avg_latitude_d; //! Averaged latitude in degrees + double d_avg_longitude_d; //! Averaged longitude in degrees + double d_avg_height_m; //! Averaged height [m] double d_x_m; double d_y_m; @@ -92,6 +86,22 @@ public: ~gps_l1_ca_ls_pvt(); bool get_PVT(std::map pseudoranges,double GPS_current_time,bool flag_averaging); + + /*! + * \brief Conversion of Cartesian coordinates (X,Y,Z) to geographical + * coordinates (d_latitude_d, d_longitude_d, d_height_m) on a selected reference ellipsoid. + * + * \param[in] X [m] Cartesian coordinate + * \param[in] Y [m] Cartesian coordinate + * \param[in] Z [m] Cartesian coordinate + * \param[in] elipsoid_selection Choices of Reference Ellipsoid for Geographical Coordinates + * 0 - International Ellipsoid 1924 + * 1 - International Ellipsoid 1967 + * 2 - World Geodetic System 1972 + * 3 - Geodetic Reference System 1980 + * 4 - World Geodetic System 1984 + * + */ void cart2geo(double X, double Y, double Z, int elipsoid_selection); }; diff --git a/src/algorithms/PVT/libs/kml_printer.h b/src/algorithms/PVT/libs/kml_printer.h index d3b3864bd..f0548d5ca 100644 --- a/src/algorithms/PVT/libs/kml_printer.h +++ b/src/algorithms/PVT/libs/kml_printer.h @@ -30,14 +30,16 @@ */ -#ifndef KML_PRINTER_H_ -#define KML_PRINTER_H_ +#ifndef GNSS_SDR_KML_PRINTER_H_ +#define GNSS_SDR_KML_PRINTER_H_ #include #include - #include "gps_l1_ca_ls_pvt.h" +/*! + * \brief Prints PVT information to a GoogleEarth .kml file + */ class kml_printer { private: 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 ddb2d5ba6..0f327ba96 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 @@ -29,14 +29,12 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_ACQUISITION_H_ -#define GNSS_SDR_ACQUISITION_H_ +#ifndef GNSS_SDR_GPS_L1_CA_GPS_SDR_ACQUISITION_H_ +#define GNSS_SDR_GPS_L1_CA_GPS_SDR_ACQUISITION_H_ #include "acquisition_interface.h" - #include "gps_l1_ca_gps_sdr_acquisition_cc.h" #include "gps_l1_ca_gps_sdr_acquisition_ss.h" - #include class ConfigurationInterface; 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 3681b18de..a5f90b983 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h @@ -31,13 +31,11 @@ * ------------------------------------------------------------------------- */ -#ifndef GPS_L1_CA_PCPS_ACQUISITION_H_ -#define GPS_L1_CA_PCPS_ACQUISITION_H_ +#ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_H_ +#define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_H_ #include "acquisition_interface.h" - #include "gps_l1_ca_pcps_acquisition_cc.h" - #include class ConfigurationInterface; @@ -114,4 +112,4 @@ private: }; -#endif /* GPS_L1_CA_PCPS_ACQUISITION_H_ */ +#endif /* GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_H_ */ diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_tong_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_tong_pcps_acquisition.h index e0919175d..3a52b1c3d 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_tong_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_tong_pcps_acquisition.h @@ -30,13 +30,11 @@ * ------------------------------------------------------------------------- */ -#ifndef GPS_L1_CA_TONG_PCPS_ACQUISITION_H_ -#define GPS_L1_CA_TONG_PCPS_ACQUISITION_H_ +#ifndef GNSS_SDR_L1_CA_TONG_PCPS_ACQUISITION_H_ +#define GNSS_SDR_L1_CA_TONG_PCPS_ACQUISITION_H_ #include "acquisition_interface.h" - #include "gps_l1_ca_tong_pcps_acquisition_cc.h" - #include class ConfigurationInterface; @@ -72,10 +70,7 @@ public: void set_satellite(unsigned int satellite); void set_channel(unsigned int channel); - void set_threshold(float threshold) - { - } - ; + void set_threshold(float threshold){}; void set_doppler_max(unsigned int doppler_max); void set_doppler_step(unsigned int doppler_step); void set_channel_queue(concurrent_queue *channel_internal_queue); @@ -116,4 +111,4 @@ private: }; -#endif /* GPS_L1_CA_TONG_PCPS_ACQUISITION_H_ */ +#endif /* GNSS_SDR_L1_CA_TONG_PCPS_ACQUISITION_H_ */ diff --git a/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_gps_sdr_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_gps_sdr_acquisition_cc.h index be6e50dda..89c1e2246 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_gps_sdr_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_gps_sdr_acquisition_cc.h @@ -31,16 +31,14 @@ * ------------------------------------------------------------------------- */ -#ifndef INCLUDED_GPS_L1_CA_GPS_SDR_ACQUISITION_CC_H -#define INCLUDED_GPS_L1_CA_GPS_SDR_ACQUISITION_CC_H +#ifndef GNSS_SDR_GPS_L1_CA_GPS_SDR_ACQUISITION_CC_H +#define GNSS_SDR_GPS_L1_CA_GPS_SDR_ACQUISITION_CC_H #include - #include #include #include #include - #include #include #include @@ -163,4 +161,4 @@ public: gr_vector_void_star &output_items); }; -#endif /* INCLUDED_GPS_L1_CA_GPS_SDR_ACQUISITION_CC_H */ +#endif /* GNSS_SDR_GPS_L1_CA_GPS_SDR_ACQUISITION_CC_H */ diff --git a/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_gps_sdr_acquisition_ss.cc b/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_gps_sdr_acquisition_ss.cc index 001797f38..b4b94bdc7 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_gps_sdr_acquisition_ss.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_gps_sdr_acquisition_ss.cc @@ -180,7 +180,7 @@ int gps_l1_ca_gps_sdr_acquisition_ss::general_work(int noutput_items, << " bytes into buffer (" << d_fft_size << " samples)"; memcpy(d_baseband_signal, in, d_fft_size * sizeof(CPX)); #ifdef NO_SIMD - x86_cmulsc(d_baseband_signal, d_sine_250, + x86_cmulsc(d_baseband_signal, d_sine_250, &d_baseband_signal[d_fft_size], d_fft_size, 14); x86_cmulsc(d_baseband_signal, d_sine_500, &d_baseband_signal[2 * d_fft_size], d_fft_size, 14); @@ -226,7 +226,7 @@ int gps_l1_ca_gps_sdr_acquisition_ss::general_work(int noutput_items, + 100 + i], d_fft_codes[d_satellite], buffer, d_fft_size, 10); #endif - d_piFFT->doiFFT(buffer, true); + d_piFFT->doiFFT(buffer, true); x86_cmag(buffer, d_fft_size); x86_max((unsigned int *)buffer, &indext, &magt, d_fft_size); diff --git a/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_gps_sdr_acquisition_ss.h b/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_gps_sdr_acquisition_ss.h index 6ba2d1b7b..6c3a1deed 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_gps_sdr_acquisition_ss.h +++ b/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_gps_sdr_acquisition_ss.h @@ -31,15 +31,13 @@ * ------------------------------------------------------------------------- */ -#ifndef INCLUDED_GPS_L1_CA_GPS_SDR_ACQUISITION_SS_H -#define INCLUDED_GPS_L1_CA_GPS_SDR_ACQUISITION_SS_H +#ifndef GNSS_SDR_GPS_L1_CA_GPS_SDR_ACQUISITION_SS_H +#define GNSS_SDR_GPS_L1_CA_GPS_SDR_ACQUISITION_SS_H #include - #include #include #include "gps_sdr_signal_processing.h" - #include #include #include @@ -152,4 +150,4 @@ public: gr_vector_void_star &output_items); }; -#endif /* INCLUDED_GPS_L1_CA_GPS_SDR_ACQUISITION_SS_H */ +#endif /* GNSS_SDR_GPS_L1_CA_GPS_SDR_ACQUISITION_SS_H */ diff --git a/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_pcps_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_pcps_acquisition_cc.cc index 0b38c0e1b..126ec3942 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_pcps_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_pcps_acquisition_cc.cc @@ -35,11 +35,8 @@ #include "gps_sdr_signal_processing.h" #include "control_message_factory.h" #include "gps_sdr_x86.h" - #include - #include - #include #include 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 f1512a43a..35acc04b5 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 @@ -31,16 +31,14 @@ * ------------------------------------------------------------------------- */ -#ifndef GPS_L1_CA_PCPS_ACQUISITION_A_CC_H -#define GPS_L1_CA_PCPS_ACQUISITION_A_CC_H +#ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_A_CC_H +#define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_A_CC_H #include - #include #include #include #include - #include #include #include @@ -54,6 +52,9 @@ gps_l1_ca_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); +/*! + * \brief This class implements a PCPS acquisition block + */ class gps_l1_ca_pcps_acquisition_cc: public gr_block { @@ -160,4 +161,4 @@ public: gr_vector_void_star &output_items); }; -#endif /* GPS_L1_CA_PCPS_ACQUISITION_CC_H*/ +#endif /* GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_CC_H*/ 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 7168a95b8..74963a088 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 @@ -34,11 +34,8 @@ #include "gps_sdr_signal_processing.h" #include "control_message_factory.h" #include "gps_sdr_x86.h" - #include - #include - #include #include 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 3ed8b0c9b..9c6a733d7 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 @@ -30,16 +30,14 @@ * ------------------------------------------------------------------------- */ -#ifndef GPS_L1_CA_TONG_PCPS_ACQUISITION_CC_H -#define GPS_L1_CA_TONG_PCPS_ACQUISITION_CC_H +#ifndef GNSS_SDR_GPS_L1_CA_TONG_PCPS_ACQUISITION_CC_H +#define GNSS_SDR_GPS_L1_CA_TONG_PCPS_ACQUISITION_CC_H #include - #include #include #include #include - #include #include #include @@ -183,4 +181,4 @@ public: gr_vector_void_star &output_items); }; -#endif /* GPS_L1_CA_TONG_PCPS_ACQUISITION_CC_H*/ +#endif /* GNSS_SDR_GPS_L1_CA_TONG_PCPS_ACQUISITION_CC_H*/ diff --git a/src/algorithms/channel/adapters/channel.h b/src/algorithms/channel/adapters/channel.h index 51646303d..7aef4d561 100644 --- a/src/algorithms/channel/adapters/channel.h +++ b/src/algorithms/channel/adapters/channel.h @@ -32,12 +32,11 @@ * ------------------------------------------------------------------------- */ -#ifndef CHANNEL_H_ -#define CHANNEL_H_ +#ifndef GNSS_SDR_CHANNEL_H_ +#define GNSS_SDR_CHANNEL_H_ #include #include - #include "channel_interface.h" #include "gps_l1_ca_channel_fsm.h" #include "control_message_factory.h" @@ -118,4 +117,4 @@ private: }; -#endif /*CHANNEL_H_*/ +#endif /*GNSS_SDR_CHANNEL_H_*/ 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 182d4d130..6fe724058 100644 --- a/src/algorithms/channel/libs/gps_l1_ca_channel_fsm.h +++ b/src/algorithms/channel/libs/gps_l1_ca_channel_fsm.h @@ -1,6 +1,6 @@ /*! * \file gps_l1_ca_channel_fsm.h - * \brief State Machine for channel using boost::statechart + * \brief Interface of the State Machine for channel using boost::statechart * \author Luis Esteve, 2011. luis(at)epsilon-formacion.com * * @@ -41,12 +41,10 @@ #include #include #include - #include "acquisition_interface.h" #include "tracking_interface.h" #include "telemetry_decoder_interface.h" #include - #include #include diff --git a/src/algorithms/conditioner/adapters/direct_resampler_conditioner.h b/src/algorithms/conditioner/adapters/direct_resampler_conditioner.h index 7fb83644c..249000bb6 100644 --- a/src/algorithms/conditioner/adapters/direct_resampler_conditioner.h +++ b/src/algorithms/conditioner/adapters/direct_resampler_conditioner.h @@ -30,11 +30,10 @@ * ------------------------------------------------------------------------- */ -#ifndef DIRECT_RESAMPLER_CONDITIONER_H_ -#define DIRECT_RESAMPLER_CONDITIONER_H_ +#ifndef GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_H_ +#define GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_H_ #include - #include "gnss_block_interface.h" class ConfigurationInterface; @@ -84,4 +83,4 @@ private: gr_block_sptr file_sink_; }; -#endif /*DIRECT_RESAMPLER_CONDITIONER_H_*/ +#endif /*GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_H_*/ diff --git a/src/algorithms/conditioner/gnuradio_blocks/direct_resampler_conditioner_cc.h b/src/algorithms/conditioner/gnuradio_blocks/direct_resampler_conditioner_cc.h index 6f297ec43..6c83b0998 100644 --- a/src/algorithms/conditioner/gnuradio_blocks/direct_resampler_conditioner_cc.h +++ b/src/algorithms/conditioner/gnuradio_blocks/direct_resampler_conditioner_cc.h @@ -5,16 +5,11 @@ * gr_complex input and gr_complex output * \author Luis Esteve, 2011. luis(at)epsilon-formacion.com * - * Detailed description of the file here if needed. - * * This block takes in a signal stream and performs direct * resampling. - * * The theory behind this block can be found in Chapter 7.5 of * the following book. * - * \param sample_freq_in (double) Specifies the sampling frequency of the input signal - * \param sample_freq_out (double) Specifies the sampling frequency of the output signal * * ------------------------------------------------------------------------- * @@ -41,8 +36,8 @@ * ------------------------------------------------------------------------- */ -#ifndef INCLUDED_DIRECT_RESAMPLER_CONDITIONER_CC_H -#define INCLUDED_DIRECT_RESAMPLER_CONDITIONER_CC_H +#ifndef GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CC_H +#define GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CC_H #include @@ -53,6 +48,11 @@ direct_resampler_conditioner_cc_sptr direct_resampler_make_conditioner_cc(double sample_freq_in, double sample_freq_out); +/*! + * \brief This class implements a direct resampler conditioner for complex data + * + * Direct resampling without interpolation + */ class direct_resampler_conditioner_cc: public gr_block { @@ -62,8 +62,8 @@ private: direct_resampler_make_conditioner_cc(double sample_freq_in, double sample_freq_out); - double d_sample_freq_in; - double d_sample_freq_out; + double d_sample_freq_in; //! Specifies the sampling frequency of the input signal + double d_sample_freq_out; //! Specifies the sampling frequency of the output signal unsigned int d_phase; unsigned int d_lphase; unsigned int d_phase_step; @@ -90,4 +90,4 @@ public: gr_vector_void_star &output_items); }; -#endif /* INCLUDED_DIRECT_RESAMPLER_CONDITIONER_CC_H */ +#endif /* GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CC_H */ diff --git a/src/algorithms/conditioner/gnuradio_blocks/direct_resampler_conditioner_ss.h b/src/algorithms/conditioner/gnuradio_blocks/direct_resampler_conditioner_ss.h index 8e251cb35..b2325731b 100644 --- a/src/algorithms/conditioner/gnuradio_blocks/direct_resampler_conditioner_ss.h +++ b/src/algorithms/conditioner/gnuradio_blocks/direct_resampler_conditioner_ss.h @@ -4,8 +4,6 @@ * short input and short output * \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) @@ -31,8 +29,8 @@ * ------------------------------------------------------------------------- */ -#ifndef INCLUDED_DIRECT_RESAMPLER_CONDITIONER_SS_H -#define INCLUDED_DIRECT_RESAMPLER_CONDITIONER_SS_H +#ifndef GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_SS_H +#define GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_SS_H #include @@ -42,7 +40,11 @@ typedef boost::shared_ptr direct_resampler_conditioner_ss_sptr direct_resampler_make_conditioner_ss(double sample_freq_in, double sample_freq_out); - +/*! + * \brief This class implements a direct resampler conditioner for shorts + * + * Direct resampling without interpolation + */ class direct_resampler_conditioner_ss: public gr_block { @@ -80,4 +82,4 @@ public: gr_vector_void_star &output_items); }; -#endif /* INCLUDED_DIRECT_RESAMPLER_CONDITIONER_SS_H */ +#endif /* GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_SS_H */ diff --git a/src/algorithms/libs/gps_sdr_defines.h b/src/algorithms/libs/gps_sdr_defines.h index c945584f5..ff495060a 100644 --- a/src/algorithms/libs/gps_sdr_defines.h +++ b/src/algorithms/libs/gps_sdr_defines.h @@ -122,7 +122,7 @@ typedef unsigned int uint32; /* PVT Stuff */ /*----------------------------------------------------------------------------------------------*/ #define GRAVITY_CONSTANT (3.986005e14) //!< Earth's WGS-84 gravitational constant (m^3/s^2) as specified in IS-GPS-200D -#define WGS84OE (7.2921151467e-5) //!< Earth's WGS-84 rotation rate (rads/s) as specified in IS-GPS-200D +const double WGS84OE = 7.2921151467e-5; //!< Earth's WGS-84 rotation rate (rads/s) as specified in IS-GPS-200D #define WGS84_MAJOR_AXIS (6378137.0) //!< Earth's WGS-84 ellipsoid's major axis #define WGS84_MINOR_AXIS (6356752.314245) //!< Earth's WGS-84 ellipsoid's minor axis #define SECONDS_IN_1024_WEEKS (619315200.0) //!< Number of seconds in 1024 weeks diff --git a/src/algorithms/observables/adapters/gps_l1_ca_observables.h b/src/algorithms/observables/adapters/gps_l1_ca_observables.h index 8f0450b0b..965106e79 100644 --- a/src/algorithms/observables/adapters/gps_l1_ca_observables.h +++ b/src/algorithms/observables/adapters/gps_l1_ca_observables.h @@ -31,13 +31,11 @@ */ -#ifndef GPS_L1_CA_OBSERVABLES_H_ -#define GPS_L1_CA_OBSERVABLES_H_ +#ifndef GNSS_SDR_GPS_L1_CA_OBSERVABLES_H_ +#define GNSS_SDR_GPS_L1_CA_OBSERVABLES_H_ #include "observables_interface.h" - #include "gps_l1_ca_observables_cc.h" - #include class ConfigurationInterface; 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 da619a9cf..1c2e8aa9b 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 Pseudorange computation module for GPS L1 C/A + * \brief Interface of the pseudorange computation module for GPS L1 C/A * \author Javier Arribas, 2011. jarribas(at)cttc.es * ------------------------------------------------------------------------- * @@ -28,24 +28,18 @@ */ -#ifndef GPS_L1_CA_OBSERVABLES_CC_H -#define GPS_L1_CA_OBSERVABLES_CC_H +#ifndef GNSS_SDR_GPS_L1_CA_OBSERVABLES_CC_H +#define GNSS_SDR_GPS_L1_CA_OBSERVABLES_CC_H #include - #include #include - #include #include #include - #include "concurrent_queue.h" - #include "gps_navigation_message.h" - #include "rinex_2_1_printer.h" - #include "GPS_L1_CA.h" class gps_l1_ca_observables_cc; @@ -53,7 +47,9 @@ typedef boost::shared_ptr gps_l1_ca_observables_cc_spt gps_l1_ca_observables_cc_sptr gps_l1_ca_make_observables_cc(unsigned int n_channels, gr_msg_queue_sptr queue, bool dump, std::string dump_filename, int output_rate_ms, bool flag_averaging); - +/*! + * \brief This class implements a block that computes GPS L1 C/A observables + */ class gps_l1_ca_observables_cc : public gr_block { private: diff --git a/src/algorithms/output_filter/adapters/file_output_filter.h b/src/algorithms/output_filter/adapters/file_output_filter.h index 466957069..2db50c34d 100644 --- a/src/algorithms/output_filter/adapters/file_output_filter.h +++ b/src/algorithms/output_filter/adapters/file_output_filter.h @@ -37,7 +37,6 @@ #define GNSS_SDR_FILE_OUTPUT_FILTER_H_ #include "gnss_block_interface.h" - #include class ConfigurationInterface; 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 1ee87f333..c05c916ba 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,6 @@ /*! * \file null_sink_output_filter.h - * \brief Brief description of the file here + * \brief Interface of a null sink output filter * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * * This class represents an implementation of an output filter that @@ -33,15 +33,17 @@ -#ifndef NULL_SINK_OUTPUT_FILTER_H_ -#define NULL_SINK_OUTPUT_FILTER_H_ +#ifndef GNSS_SDR_NULL_SINK_OUTPUT_FILTER_H_ +#define GNSS_SDR_NULL_SINK_OUTPUT_FILTER_H_ #include "gnss_block_interface.h" - #include class ConfigurationInterface; +/*! + * \brief This class implements a null sink output filter + */ class NullSinkOutputFilter : public GNSSBlockInterface { @@ -87,4 +89,4 @@ private: unsigned int out_streams_; }; -#endif /*NULL_SINK_OUTPUT_FILTER_H_*/ +#endif /*GNSS_SDR_NULL_SINK_OUTPUT_FILTER_H_*/ diff --git a/src/algorithms/signal_source/adapters/file_signal_source.h b/src/algorithms/signal_source/adapters/file_signal_source.h index ceff45da4..9d9a6d158 100644 --- a/src/algorithms/signal_source/adapters/file_signal_source.h +++ b/src/algorithms/signal_source/adapters/file_signal_source.h @@ -1,6 +1,6 @@ /*! * \file file_signal_source.h - * \brief Brief description of the file here + * \brief This class reads signals samples from a file * \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 @@ -31,11 +31,10 @@ * ------------------------------------------------------------------------- */ -#ifndef FILE_SIGNAL_SOURCE_H_ -#define FILE_SIGNAL_SOURCE_H_ +#ifndef GNSS_SDR_FILE_SIGNAL_SOURCE_H_ +#define GNSS_SDR_FILE_SIGNAL_SOURCE_H_ #include "gnss_block_interface.h" - #include #include #include @@ -44,6 +43,9 @@ class ConfigurationInterface; +/*! + * \brief This class reads samples from a file. + */ class FileSignalSource: public GNSSBlockInterface { @@ -120,4 +122,4 @@ private: bool enable_throttle_control_; }; -#endif /*FILE_SIGNAL_SOURCE_H_*/ +#endif /*GNSS_SDR_FILE_SIGNAL_SOURCE_H_*/ 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 0cccab71f..ef6e30d7e 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,6 +1,6 @@ /*! - * \file gps_navigation.cc - * \brief Brief description of the file here + * \file gps_l1_ca_telemetry_decoder.cc + * \brief This class implements a NAV data decoder for GPS L1 C/A * \author Javier Arribas, 2011. jarribas(at)cttc.es * * Detailed description of the file here if needed. @@ -33,15 +33,11 @@ #include "gps_l1_ca_telemetry_decoder.h" - #include "configuration_interface.h" - #include "gps_l1_ca_telemetry_decoder_cc.h" - #include #include #include - #include #include 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 f8059cf27..2fc3a6bd7 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,10 +1,8 @@ /*! - * \file gps_navigation.h - * \brief Brief description of the file here + * \file gps_l1_ca_telemetry_decoder.h + * \brief This class implements a NAV data decoder for GPS L1 C/A * \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 +29,18 @@ */ -#ifndef GPS_L1_CA_TELEMETRY_DECODER_H_ -#define GPS_L1_CA_TELEMETRY_DECODER_H_ +#ifndef GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_H_ +#define GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_H_ #include "telemetry_decoder_interface.h" - #include "gps_l1_ca_telemetry_decoder_cc.h" - #include class ConfigurationInterface; +/*! + * \brief This class implements a NAV data decoder for GPS L1 C/A + */ class GpsL1CaTelemetryDecoder : public TelemetryDecoderInterface { 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 aced1dd54..e5597e6d7 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 @@ -29,20 +29,19 @@ */ /*! - * \todo Clean this code and move the telemetri definitions to GPS_L1_CA system definitions file + * \todo Clean this code and move the telemetry definitions to GPS_L1_CA system definitions file */ -#include "gps_l1_ca_telemetry_decoder_cc.h" - -#include "control_message_factory.h" #include #include #include - #include - #include #include +#include "gps_l1_ca_telemetry_decoder_cc.h" +#include "control_message_factory.h" + + using google::LogMessage; 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 681e1a524..30af61842 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 @@ -26,30 +26,32 @@ * * ------------------------------------------------------------------------- */ -#ifndef GPS_L1_CA_TELEMETRY_DECODER_CC_H -#define GPS_L1_CA_TELEMETRY_DECODER_CC_H + +#ifndef GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_CC_H +#define GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_CC_H #include - +#include #include //#include #include - -#include - #include "GPS_L1_CA.h" #include "gps_telemetry.h" #include "gps_l1_ca_subframe_fsm.h" - #include "concurrent_queue.h" class gps_l1_ca_telemetry_decoder_cc; + typedef boost::shared_ptr gps_l1_ca_telemetry_decoder_cc_sptr; + gps_l1_ca_telemetry_decoder_cc_sptr gps_l1_ca_make_telemetry_decoder_cc(unsigned int satellite, long if_freq, long fs_in, unsigned int vector_length, gr_msg_queue_sptr queue, bool dump); - +/*! + * \brief This class implements a block that decodes the NAV data defined in IS-GPS-200E + * + */ class gps_l1_ca_telemetry_decoder_cc : public gr_block { private: 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 b7c5bee95..3f86a90a4 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 @@ -33,13 +33,11 @@ * ------------------------------------------------------------------------- */ -#ifndef GPS_L1_CA_DLL_FLL_PLL_TRACKING_H_ -#define GPS_L1_CA_DLL_FLL_PLL_TRACKING_H_ +#ifndef GNSS_SDR_GPS_L1_CA_DLL_FLL_PLL_TRACKING_H_ +#define GNSS_SDR_GPS_L1_CA_DLL_FLL_PLL_TRACKING_H_ #include "tracking_interface.h" - #include "gps_l1_ca_dll_fll_pll_tracking_cc.h" - #include class ConfigurationInterface; 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 146aad798..4e0bd0249 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 @@ -33,18 +33,18 @@ * ------------------------------------------------------------------------- */ -#ifndef GPS_L1_CA_DLL_PLL_TRACKING_H_ -#define GPS_L1_CA_DLL_PLL_TRACKING_H_ +#ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_H_ +#define GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_H_ #include "tracking_interface.h" - #include "gps_l1_ca_dll_pll_tracking_cc.h" - #include class ConfigurationInterface; - +/*! + * \brief This class implements a code DLL + carrier PLL tracking loop + */ class GpsL1CaDllPllTracking : public TrackingInterface { @@ -101,4 +101,4 @@ private: concurrent_queue *channel_internal_queue_; }; -#endif // GPS_L1_CA_DLL_PLL_TRACKING_H_ +#endif // GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_H_ 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 179ec0e45..a54b4fa65 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 @@ -34,18 +34,15 @@ * ------------------------------------------------------------------------- */ -#ifndef GPS_L1_CA_DLL_FLL_PLL_TRACKING_CC_H -#define GPS_L1_CA_DLL_FLL_PLL_TRACKING_CC_H +#ifndef GNSS_SDR_GPS_L1_CA_DLL_FLL_PLL_TRACKING_CC_H +#define GNSS_SDR_GPS_L1_CA_DLL_FLL_PLL_TRACKING_CC_H #include - #include #include //#include - #include "gps_sdr_signal_processing.h" #include "tracking_FLL_PLL_filter.h" - #include #include #include @@ -70,6 +67,10 @@ gps_l1_ca_dll_fll_pll_make_tracking_cc(unsigned int satellite, float early_late_space_chips); //class gps_l1_ca_dll_pll_tracking_cc: public gr_sync_decimator + +/*! + * \brief This class implements a DLL and a FLL assisted PLL tracking loop block + */ class gps_l1_ca_dll_fll_pll_tracking_cc: public gr_block { @@ -204,4 +205,4 @@ public: }; -#endif //GPS_L1_CA_DLL_FLL_PLL_TRACKING_CC_H +#endif //GNSS_SDR_GPS_L1_CA_DLL_FLL_PLL_TRACKING_CC_H 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 bcea2c387..1c0aad5a1 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 @@ -47,9 +47,7 @@ #include #include #include "math.h" - #include - #include #include 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 d09f4349b..7e4e7b967 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 @@ -32,19 +32,16 @@ * * ------------------------------------------------------------------------- */ -#ifndef GPS_L1_CA_DLL_PLL_TRACKING_CC_H -#define GPS_L1_CA_DLL_PLL_TRACKING_CC_H +#ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_CC_H +#define GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_CC_H #include - #include #include //#include - #include "gps_sdr_signal_processing.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_2nd_PLL_filter.h" - #include #include #include @@ -66,6 +63,10 @@ gps_l1_ca_dll_pll_make_tracking_cc(unsigned int satellite, long if_freq, float early_late_space_chips); //class gps_l1_ca_dll_pll_tracking_cc: public gr_sync_decimator + +/*! + * \brief This class implements a DLL + PLL tracking loop block + */ class gps_l1_ca_dll_pll_tracking_cc: public gr_block { @@ -194,4 +195,4 @@ public: }; -#endif //GPS_L1_CA_DLL_PLL_TRACKING_CC_H +#endif //GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_CC_H diff --git a/src/algorithms/tracking/libs/CN_estimators.h b/src/algorithms/tracking/libs/CN_estimators.h index d04628a0f..dc95077b6 100644 --- a/src/algorithms/tracking/libs/CN_estimators.h +++ b/src/algorithms/tracking/libs/CN_estimators.h @@ -30,8 +30,8 @@ * ------------------------------------------------------------------------- */ -#ifndef CN_ESTIMATORS_H_ -#define CN_ESTIMATORS_H_ +#ifndef GNSS_SDR_CN_ESTIMATORS_H_ +#define GNSS_SDR_CN_ESTIMATORS_H_ #include diff --git a/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.h b/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.h index edb63f774..e3c009563 100644 --- a/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.h +++ b/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.h @@ -3,9 +3,8 @@ * \brief Class that implements 2 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. * * ------------------------------------------------------------------------- @@ -33,9 +32,16 @@ * ------------------------------------------------------------------------- */ -#ifndef TRACKING_2ND_DLL_FILTER_H_ -#define TRACKING_2ND_DLL_FILTER_H_ +#ifndef GNSS_SDR_TRACKING_2ND_DLL_FILTER_H_ +#define GNSS_SDR_TRACKING_2ND_DLL_FILTER_H_ +/*! + * \brief This class implements a 2nd order DLL 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. + */ class tracking_2nd_DLL_filter { private: @@ -51,7 +57,7 @@ private: void calculate_lopp_coef(float* tau1,float* tau2, float lbw, float zeta, float k); public: - void set_DLL_BW(float dll_bw_hz); + void set_DLL_BW(float dll_bw_hz); //! Set DLL loop bandwidth [Hz] void initialize(float d_acq_code_phase_samples); float get_code_nco(float DLL_discriminator); tracking_2nd_DLL_filter(); diff --git a/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.h b/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.h index a028ee044..42c57c83e 100644 --- a/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.h +++ b/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.h @@ -1,11 +1,10 @@ /*! * \file tracking_2nd_PLL_filter.h - * \brief Class that implements 2 order PLL filter for tracking carrier loop + * \brief Class that implements 2 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 [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. * * ------------------------------------------------------------------------- @@ -33,9 +32,16 @@ * ------------------------------------------------------------------------- */ -#ifndef TRACKING_2ND_PLL_FILTER_H_ -#define TRACKING_2ND_PLL_FILTER_H_ +#ifndef GNSS_SDR_TRACKING_2ND_PLL_FILTER_H_ +#define GNSS_SDR_TRACKING_2ND_PLL_FILTER_H_ +/*! + * \brief This class implements a 2nd order PLL filter for carrier 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. + */ class tracking_2nd_PLL_filter { private: @@ -52,7 +58,7 @@ private: void calculate_lopp_coef(float* tau1,float* tau2, float lbw, float zeta, float k); public: - void set_PLL_BW(float pll_bw_hz); + void set_PLL_BW(float pll_bw_hz); //! Set PLL loop bandwidth [Hz] void initialize(float d_acq_carrier_doppler_hz); float get_carrier_nco(float PLL_discriminator); tracking_2nd_PLL_filter(); diff --git a/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.h b/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.h index 90df5844c..75b6414ab 100644 --- a/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.h +++ b/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.h @@ -30,9 +30,12 @@ * ------------------------------------------------------------------------- */ -#ifndef TRACKING_FLL_PLL_FILTER_H_ -#define TRACKING_FLL_PLL_FILTER_H_ +#ifndef GNSS_SDR_TRACKING_FLL_PLL_FILTER_H_ +#define GNSS_SDR_TRACKING_FLL_PLL_FILTER_H_ +/*! + * \brief This class implements a hybrid FLL and PLL filter for tracking carrier loop + */ class tracking_FLL_PLL_filter { private: diff --git a/src/algorithms/tracking/libs/tracking_discriminators.h b/src/algorithms/tracking/libs/tracking_discriminators.h index 8420f6d28..2af472224 100644 --- a/src/algorithms/tracking/libs/tracking_discriminators.h +++ b/src/algorithms/tracking/libs/tracking_discriminators.h @@ -30,8 +30,8 @@ * ------------------------------------------------------------------------- */ -#ifndef TRACKING_DISCRIMINATORS_H_ -#define TRACKING_DISCRIMINATORS_H_ +#ifndef GNSS_SDR_TRACKING_DISCRIMINATORS_H_ +#define GNSS_SDR_TRACKING_DISCRIMINATORS_H_ #include diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 91e223292..839c2fbf3 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -33,16 +33,11 @@ */ #include "control_thread.h" - #include - #include - #include - #include #include - #include "gnss_flowgraph.h" #include "file_configuration.h" #include "control_message_factory.h" @@ -73,18 +68,18 @@ ControlThread::~ControlThread() delete control_message_factory_; } - +/* + * Runs the control thread that manages the receiver control plane + * + * 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 } + */ void ControlThread::run() { - /* 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 } - */ + flowgraph_->connect(); if (flowgraph_->connected()) { diff --git a/src/core/receiver/file_configuration.h b/src/core/receiver/file_configuration.h index 3c366d572..b615cfbe7 100644 --- a/src/core/receiver/file_configuration.h +++ b/src/core/receiver/file_configuration.h @@ -38,7 +38,6 @@ #define GNSS_SDR_FILE_CONFIGURATION_H_ #include "configuration_interface.h" - #include class INIReader; diff --git a/src/core/receiver/gnss_block_factory.h b/src/core/receiver/gnss_block_factory.h index 873be039b..d0b6b5200 100644 --- a/src/core/receiver/gnss_block_factory.h +++ b/src/core/receiver/gnss_block_factory.h @@ -33,8 +33,8 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_BLOCK_FACTORY_H_ -#define GNSS_BLOCK_FACTORY_H_ +#ifndef GNSS_SDR_BLOCK_FACTORY_H_ +#define GNSS_SDR_BLOCK_FACTORY_H_ #include #include @@ -74,4 +74,4 @@ public: }; -#endif /*GNSS_BLOCK_FACTORY_H_*/ +#endif /*GNSS_SDR_BLOCK_FACTORY_H_*/ diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 8c964b966..7c7160755 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -32,15 +32,12 @@ */ #include "gnss_flowgraph.h" - #include #include "unistd.h" #include #include - #include #include - #include "configuration_interface.h" #include "gnss_block_interface.h" #include "channel_interface.h" diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index 3a3f1afd0..370721610 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -38,7 +38,6 @@ #include #include #include - #include #include @@ -47,7 +46,7 @@ class ChannelInterface; class ConfigurationInterface; class GNSSBlockFactory; -/* \brief This class represents a GNSS flowgraph. +/*! \brief This class represents a GNSS flowgraph. * * It contains a signal source, * a signal conditioner, a set of channels, a PVT and an output filter. @@ -67,10 +66,10 @@ public: */ virtual ~GNSSFlowgraph(); - //! Start the flowgraph + //! \brief Start the flowgraph void start(); - //! Stop the flowgraph + //! \brief Stop the flowgraph void stop(); /*! diff --git a/src/core/receiver/in_memory_configuration.h b/src/core/receiver/in_memory_configuration.h index d3215b18f..fd33deb3e 100644 --- a/src/core/receiver/in_memory_configuration.h +++ b/src/core/receiver/in_memory_configuration.h @@ -38,12 +38,11 @@ #include #include - #include "configuration_interface.h" class StringConverter; -/* +/*! * \brief This class is an implementation of the interface ConfigurationInterface. * * This implementation accepts configuration parameters upon instantiation and diff --git a/src/core/system_parameters/gps_telemetry.h b/src/core/system_parameters/gps_telemetry.h index 869c12abe..25b5c2f04 100644 --- a/src/core/system_parameters/gps_telemetry.h +++ b/src/core/system_parameters/gps_telemetry.h @@ -27,8 +27,8 @@ * * ------------------------------------------------------------------------- */ -#ifndef GPS_TELEMETRY_H_ -#define GPS_TELEMETRY_H_ +#ifndef GNSS_SDR_GPS_TELEMETRY_H_ +#define GNSS_SDR_GPS_TELEMETRY_H_ #define _lrotl(X,N) ((X << N) ^ (X >> (32-N))) //!< Used in the parity check algorithm