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 4af1b3157..59eec5761 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 @@ -129,7 +129,9 @@ int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ni Gnss_Synchro **in = (Gnss_Synchro **) &input_items[0]; //Get the input pointer Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0]; //Get the output pointer - Gnss_Synchro current_gnss_synchro[d_nchannels]; + const unsigned int cd_channels = d_nchannels; + + Gnss_Synchro current_gnss_synchro[cd_channels]; std::map current_gnss_synchro_map; std::map gnss_synchro_aligned_map; @@ -148,23 +150,24 @@ int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ni */ for (unsigned int i=0; i(current_gnss_synchro[i].Channel_ID, current_gnss_synchro[i])); //record the word structure in a map for pseudoranges + //record the word structure in a map for pseudoranges + current_gnss_synchro_map.insert(std::pair(current_gnss_synchro[i].Channel_ID, current_gnss_synchro[i])); // RECORD PRN start timestamps history if (d_history_gnss_synchro_deque[i].size() 0 and flag_history_ok == true) { - /* - * 2.1 Find the correct symbol timestamp in the gnss_synchro history: we have to compare timestamps between channels on the SAME symbol - * (common TX time algorithm) - */ + /* + * 2.1 Find the correct symbol timestamp in the gnss_synchro history: we have to compare timestamps between channels on the SAME symbol + * (common TX time algorithm) + */ - double min_preamble_delay_ms; - double max_preamble_delay_ms; - int current_symbol=0; - int reference_channel; - int history_shift; - Gnss_Synchro tmp_gnss_synchro; + double min_preamble_delay_ms; + double max_preamble_delay_ms; + int current_symbol=0; + int reference_channel; + int history_shift; + Gnss_Synchro tmp_gnss_synchro; - gnss_synchro_iter = min_element(current_gnss_synchro_map.begin(), current_gnss_synchro_map.end(), pairCompare_gnss_synchro_preamble_delay_ms); - min_preamble_delay_ms = gnss_synchro_iter->second.Preamble_timestamp_ms; //[ms] + gnss_synchro_iter = min_element(current_gnss_synchro_map.begin(), current_gnss_synchro_map.end(), pairCompare_gnss_synchro_preamble_delay_ms); + min_preamble_delay_ms = gnss_synchro_iter->second.Preamble_timestamp_ms; //[ms] - gnss_synchro_iter = max_element(current_gnss_synchro_map.begin(), current_gnss_synchro_map.end(), pairCompare_gnss_synchro_preamble_delay_ms); - max_preamble_delay_ms = gnss_synchro_iter->second.Preamble_timestamp_ms; //[ms] + gnss_synchro_iter = max_element(current_gnss_synchro_map.begin(), current_gnss_synchro_map.end(), pairCompare_gnss_synchro_preamble_delay_ms); + max_preamble_delay_ms = gnss_synchro_iter->second.Preamble_timestamp_ms; //[ms] - if ((max_preamble_delay_ms-min_preamble_delay_ms)< MAX_TOA_DELAY_MS) - { - // we have a valid information set. Its time to align the symbols information - // what is the most delayed symbol in the current set? -> this will be the reference symbol - gnss_synchro_iter=min_element(current_gnss_synchro_map.begin(), current_gnss_synchro_map.end(), pairCompare_gnss_synchro_preamble_symbol_count); - current_symbol=gnss_synchro_iter->second.Preamble_symbol_counter; - reference_channel=gnss_synchro_iter->second.Channel_ID; - // save it in the aligned symbols map - gnss_synchro_aligned_map.insert(std::pair(gnss_synchro_iter->second.Channel_ID, gnss_synchro_iter->second)); + if ((max_preamble_delay_ms-min_preamble_delay_ms)< MAX_TOA_DELAY_MS) + { + // we have a valid information set. Its time to align the symbols information + // what is the most delayed symbol in the current set? -> this will be the reference symbol + gnss_synchro_iter=min_element(current_gnss_synchro_map.begin(), current_gnss_synchro_map.end(), pairCompare_gnss_synchro_preamble_symbol_count); + current_symbol=gnss_synchro_iter->second.Preamble_symbol_counter; + reference_channel=gnss_synchro_iter->second.Channel_ID; + // save it in the aligned symbols map + gnss_synchro_aligned_map.insert(std::pair(gnss_synchro_iter->second.Channel_ID, gnss_synchro_iter->second)); - // Now find where the same symbols were in the rest of the channels searching in the symbol history - for(gnss_synchro_iter = current_gnss_synchro_map.begin(); gnss_synchro_iter != current_gnss_synchro_map.end(); gnss_synchro_iter++) - { - //TODO: Replace the loop using current current_symbol-Preamble_symbol_counter - if (reference_channel!=gnss_synchro_iter->second.Channel_ID) - { - // compute the required symbol history shift in order to match the reference symbol - history_shift=gnss_synchro_iter->second.Preamble_symbol_counter-current_symbol; - if (history_shift<(int)MAX_TOA_DELAY_MS)// and history_shift>=0) - { - tmp_gnss_synchro= d_history_gnss_synchro_deque[gnss_synchro_iter->second.Channel_ID][history_shift]; - gnss_synchro_aligned_map.insert(std::pair(gnss_synchro_iter->second.Channel_ID,tmp_gnss_synchro)); - } - } - } - } + // Now find where the same symbols were in the rest of the channels searching in the symbol history + for(gnss_synchro_iter = current_gnss_synchro_map.begin(); gnss_synchro_iter != current_gnss_synchro_map.end(); gnss_synchro_iter++) + { + //TODO: Replace the loop using current current_symbol-Preamble_symbol_counter + if (reference_channel!=gnss_synchro_iter->second.Channel_ID) + { + // compute the required symbol history shift in order to match the reference symbol + history_shift=gnss_synchro_iter->second.Preamble_symbol_counter-current_symbol; + if (history_shift<(int)MAX_TOA_DELAY_MS)// and history_shift>=0) + { + tmp_gnss_synchro= d_history_gnss_synchro_deque[gnss_synchro_iter->second.Channel_ID][history_shift]; + gnss_synchro_aligned_map.insert(std::pair(gnss_synchro_iter->second.Channel_ID,tmp_gnss_synchro)); + } + } + } + } - /* - * 3 Compute the pseudorranges using the aligned data map - */ - double min_symbol_timestamp_ms; - double max_symbol_timestamp_ms; - gnss_synchro_iter = min_element(gnss_synchro_aligned_map.begin(), gnss_synchro_aligned_map.end(), pairCompare_gnss_synchro_Prn_delay_ms); - min_symbol_timestamp_ms = gnss_synchro_iter->second.Prn_timestamp_ms; //[ms] + /* + * 3 Compute the pseudorranges using the aligned data map + */ + double min_symbol_timestamp_ms; + double max_symbol_timestamp_ms; + gnss_synchro_iter = min_element(gnss_synchro_aligned_map.begin(), gnss_synchro_aligned_map.end(), pairCompare_gnss_synchro_Prn_delay_ms); + min_symbol_timestamp_ms = gnss_synchro_iter->second.Prn_timestamp_ms; //[ms] - gnss_synchro_iter = max_element(gnss_synchro_aligned_map.begin(), gnss_synchro_aligned_map.end(), pairCompare_gnss_synchro_Prn_delay_ms); - max_symbol_timestamp_ms = gnss_synchro_iter->second.Prn_timestamp_ms; //[ms] + gnss_synchro_iter = max_element(gnss_synchro_aligned_map.begin(), gnss_synchro_aligned_map.end(), pairCompare_gnss_synchro_Prn_delay_ms); + max_symbol_timestamp_ms = gnss_synchro_iter->second.Prn_timestamp_ms; //[ms] - // check again if this is a valid set of observations - if ((max_symbol_timestamp_ms - min_symbol_timestamp_ms) < MAX_TOA_DELAY_MS) - /* - * 2.3 compute the pseudoranges - */ - { - for(gnss_synchro_iter = gnss_synchro_aligned_map.begin(); gnss_synchro_iter != gnss_synchro_aligned_map.end(); gnss_synchro_iter++) - { - traveltime_ms = gnss_synchro_iter->second.Prn_timestamp_ms - min_symbol_timestamp_ms + GPS_STARTOFFSET_ms; //[ms] - pseudorange_m = traveltime_ms*GPS_C_m_ms; // [m] - // update the pseudorange object - current_gnss_synchro[gnss_synchro_iter->second.Channel_ID]=gnss_synchro_iter->second; - current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Pseudorange_m = pseudorange_m; - current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Pseudorange_symbol_shift = (double)current_symbol; // number of symbols shifted from preamble start symbol - current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Flag_valid_pseudorange = true; - current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Pseudorange_timestamp_ms=max_symbol_timestamp_ms; - } - } + // check again if this is a valid set of observations + if ((max_symbol_timestamp_ms - min_symbol_timestamp_ms) < MAX_TOA_DELAY_MS) + /* + * 2.3 compute the pseudoranges + */ + { + for(gnss_synchro_iter = gnss_synchro_aligned_map.begin(); gnss_synchro_iter != gnss_synchro_aligned_map.end(); gnss_synchro_iter++) + { + traveltime_ms = gnss_synchro_iter->second.Prn_timestamp_ms - min_symbol_timestamp_ms + GPS_STARTOFFSET_ms; //[ms] + pseudorange_m = traveltime_ms*GPS_C_m_ms; // [m] + // update the pseudorange object + current_gnss_synchro[gnss_synchro_iter->second.Channel_ID]=gnss_synchro_iter->second; + current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Pseudorange_m = pseudorange_m; + current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Pseudorange_symbol_shift = (double)current_symbol; // number of symbols shifted from preamble start symbol + current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Flag_valid_pseudorange = true; + current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Pseudorange_timestamp_ms=max_symbol_timestamp_ms; + } + } } diff --git a/src/core/system_parameters/GPS_L1_CA.h b/src/core/system_parameters/GPS_L1_CA.h index 3089ba030..3a00d882b 100644 --- a/src/core/system_parameters/GPS_L1_CA.h +++ b/src/core/system_parameters/GPS_L1_CA.h @@ -33,7 +33,9 @@ #define GNSS_SDR_GPS_L1_CA_H_ #include +#include #include +//#include // Physical constants const double GPS_C_m_s = 299792458.0; //!< The speed of light, [m/s] @@ -81,19 +83,25 @@ const int GPS_WORD_BITS=30; //!< Number of bits per word in t /*! * \brief Navigation message bits slice structure: A portion of bits is indicated by - * the start position inside the subframe and the length in number of bits */ -typedef struct bits_slice + * the start position inside the subframe and the length in number of bits + * */ + +typedef struct bits_slice_struct { int position; int length; - bits_slice(int p,int l) + bits_slice_struct(int p,int l) { position=p; - length=l; + length=l; } -} bits_slice; +} bits_slice_struct; + + +typedef std::vector bits_slice; + /* Constants for scaling the ephemeris found in the data message the format is the following: TWO_N5 -> 2^-5, TWO_P4 -> 2^4, PI_TWO_N43 -> Pi*2^-43, etc etc Additionally some of the PI*2^N terms are used in the tracking stuff @@ -146,130 +154,130 @@ const double PI_TWO_N23 =(3.745070282923929e-007); //!< Pi*2^-2 // SUBFRAME 1-5 (TLM and HOW) -const bits_slice TOW[]= {{31,17}}; -const bits_slice INTEGRITY_STATUS_FLAG[] = {{23,1}}; -const bits_slice ALERT_FLAG[] = {{48,1}}; -const bits_slice ANTI_SPOOFING_FLAG[] = {{49,1}}; -const bits_slice SUBFRAME_ID[]= {{50,3}}; +const bits_slice TOW = { {31,17} }; +const bits_slice INTEGRITY_STATUS_FLAG = {{23,1}}; +const bits_slice ALERT_FLAG = {{48,1}}; +const bits_slice ANTI_SPOOFING_FLAG = {{49,1}}; +const bits_slice SUBFRAME_ID= {{50,3}}; // SUBFRAME 1 -const bits_slice GPS_WEEK[]= {{61,10}}; -const bits_slice CA_OR_P_ON_L2[]= {{71,2}}; //* -const bits_slice SV_ACCURACY[]= {{73,4}}; -const bits_slice SV_HEALTH[]= {{77,6}}; -const bits_slice L2_P_DATA_FLAG[] = {{91,1}}; -const bits_slice T_GD[]= {{197,8}}; +const bits_slice GPS_WEEK= {{61,10}}; +const bits_slice CA_OR_P_ON_L2= {{71,2}}; //* +const bits_slice SV_ACCURACY= {{73,4}}; +const bits_slice SV_HEALTH= {{77,6}}; +const bits_slice L2_P_DATA_FLAG = {{91,1}}; +const bits_slice T_GD= {{197,8}}; const double T_GD_LSB=TWO_N31; -const bits_slice IODC[]= {{83,2},{211,8}}; -const bits_slice T_OC[]= {{219,16}}; +const bits_slice IODC= {{83,2},{211,8}}; +const bits_slice T_OC= {{219,16}}; const double T_OC_LSB=TWO_P4; -const bits_slice A_F2[]= {{241,8}}; +const bits_slice A_F2= {{241,8}}; const double A_F2_LSB=TWO_N55; -const bits_slice A_F1[]= {{249,16}}; +const bits_slice A_F1= {{249,16}}; const double A_F1_LSB=TWO_N43; -const bits_slice A_F0[]= {{271,22}}; +const bits_slice A_F0= {{271,22}}; const double A_F0_LSB=TWO_N31; // SUBFRAME 2 -const bits_slice IODE_SF2[]= {{61,8}}; -const bits_slice C_RS[]= {{69,16}}; +const bits_slice IODE_SF2= {{61,8}}; +const bits_slice C_RS= {{69,16}}; const double C_RS_LSB=TWO_N5; -const bits_slice DELTA_N[]= {{91,16}}; +const bits_slice DELTA_N= {{91,16}}; const double DELTA_N_LSB=PI_TWO_N43; -const bits_slice M_0[]= {{107,8},{121,24}}; +const bits_slice M_0= {{107,8},{121,24}}; const double M_0_LSB=PI_TWO_N31; -const bits_slice C_UC[]= {{151,16}}; +const bits_slice C_UC= {{151,16}}; const double C_UC_LSB=TWO_N29; -const bits_slice E[]= {{167,8},{181,24}}; +const bits_slice E= {{167,8},{181,24}}; const double E_LSB=TWO_N33; -const bits_slice C_US[]= {{211,16}}; +const bits_slice C_US= {{211,16}}; const double C_US_LSB=TWO_N29; -const bits_slice SQRT_A[]= {{227,8},{241,24}}; +const bits_slice SQRT_A= {{227,8},{241,24}}; const double SQRT_A_LSB=TWO_N19; -const bits_slice T_OE[]= {{271,16}}; +const bits_slice T_OE= {{271,16}}; const double T_OE_LSB=TWO_P4; -const bits_slice FIT_INTERVAL_FLAG[]= {{271,1}}; -const bits_slice AODO[] = {{272,5}}; +const bits_slice FIT_INTERVAL_FLAG= {{271,1}}; +const bits_slice AODO = {{272,5}}; const int AODO_LSB = 900; // SUBFRAME 3 -const bits_slice C_IC[]= {{61,16}}; +const bits_slice C_IC= {{61,16}}; const double C_IC_LSB=TWO_N29; -const bits_slice OMEGA_0[]= {{77,8},{91,24}}; +const bits_slice OMEGA_0 = {{77,8},{91,24}}; const double OMEGA_0_LSB=PI_TWO_N31; -const bits_slice C_IS[]= {{121,16}}; +const bits_slice C_IS = {{121,16}}; const double C_IS_LSB=TWO_N29; -const bits_slice I_0[]= {{137,8},{151,24}}; +const bits_slice I_0 = {{137,8},{151,24}}; const double I_0_LSB=PI_TWO_N31; -const bits_slice C_RC[]= {{181,16}}; +const bits_slice C_RC = {{181,16}}; const double C_RC_LSB=TWO_N5; -const bits_slice OMEGA[]= {{197,8},{211,24}}; +const bits_slice OMEGA = {{197,8},{211,24}}; const double OMEGA_LSB=PI_TWO_N31; -const bits_slice OMEGA_DOT[]= {{241,24}}; +const bits_slice OMEGA_DOT = {{241,24}}; const double OMEGA_DOT_LSB=PI_TWO_N43; -const bits_slice IODE_SF3[]= {{271,8}}; +const bits_slice IODE_SF3 = {{271,8}}; -const bits_slice I_DOT[]= {{279,14}}; +const bits_slice I_DOT = {{279,14}}; const double I_DOT_LSB=PI_TWO_N43; // SUBFRAME 4-5 -const bits_slice SV_DATA_ID[]= {{61,2}}; -const bits_slice SV_PAGE[]= {{63,6}}; +const bits_slice SV_DATA_ID = {{61,2}}; +const bits_slice SV_PAGE = {{63,6}}; // SUBFRAME 4 //! \todo read all pages of subframe 4 // Page 18 - Ionospheric and UTC data -const bits_slice ALPHA_0[]= {{69,8}}; +const bits_slice ALPHA_0 = {{69,8}}; const double ALPHA_0_LSB=TWO_N30; -const bits_slice ALPHA_1[]= {{77,8}}; +const bits_slice ALPHA_1 = {{77,8}}; const double ALPHA_1_LSB=TWO_N27; -const bits_slice ALPHA_2[]= {{91,8}}; +const bits_slice ALPHA_2 = {{91,8}}; const double ALPHA_2_LSB=TWO_N24; -const bits_slice ALPHA_3[]= {{99,8}}; +const bits_slice ALPHA_3 = {{99,8}}; const double ALPHA_3_LSB=TWO_N24; -const bits_slice BETA_0[]= {{107,8}}; +const bits_slice BETA_0 = {{107,8}}; const double BETA_0_LSB=TWO_P11; -const bits_slice BETA_1[]= {{121,8}}; +const bits_slice BETA_1 = {{121,8}}; const double BETA_1_LSB=TWO_P14; -const bits_slice BETA_2[]= {{129,8}}; +const bits_slice BETA_2 = {{129,8}}; const double BETA_2_LSB=TWO_P16; -const bits_slice BETA_3[]= {{137,8}}; +const bits_slice BETA_3 = {{137,8}}; const double BETA_3_LSB=TWO_P16; -const bits_slice A_1[]= {{151,24}}; +const bits_slice A_1 = {{151,24}}; const double A_1_LSB=TWO_N50; -const bits_slice A_0[]= {{181,24},{211,8}}; +const bits_slice A_0 = {{181,24},{211,8}}; const double A_0_LSB=TWO_N30; -const bits_slice T_OT[]= {{219,8}}; +const bits_slice T_OT = {{219,8}}; const double T_OT_LSB=TWO_P12; -const bits_slice WN_T[]= {{227,8}}; +const bits_slice WN_T = {{227,8}}; const double WN_T_LSB = 1; -const bits_slice DELTAT_LS[]= {{241,8}}; +const bits_slice DELTAT_LS = {{241,8}}; const double DELTAT_LS_LSB = 1; -const bits_slice WN_LSF[]= {{249,8}}; +const bits_slice WN_LSF = {{249,8}}; const double WN_LSF_LSB = 1; -const bits_slice DN[]= {{257,8}}; +const bits_slice DN = {{257,8}}; const double DN_LSB = 1; -const bits_slice DELTAT_LSF[]= {{271,8}}; +const bits_slice DELTAT_LSF = {{271,8}}; const double DELTAT_LSF_LSB = 1; // Page 25 - Antispoofing, SV config and SV health (PRN 25 -32) -const bits_slice HEALTH_SV25[]={{229,6}}; -const bits_slice HEALTH_SV26[]={{241,6}}; -const bits_slice HEALTH_SV27[]={{247,6}}; -const bits_slice HEALTH_SV28[]={{253,6}}; -const bits_slice HEALTH_SV29[]={{259,6}}; -const bits_slice HEALTH_SV30[]={{271,6}}; -const bits_slice HEALTH_SV31[]={{277,6}}; -const bits_slice HEALTH_SV32[]={{283,6}}; +const bits_slice HEALTH_SV25 ={{229,6}}; +const bits_slice HEALTH_SV26 ={{241,6}}; +const bits_slice HEALTH_SV27 ={{247,6}}; +const bits_slice HEALTH_SV28 ={{253,6}}; +const bits_slice HEALTH_SV29 ={{259,6}}; +const bits_slice HEALTH_SV30 ={{271,6}}; +const bits_slice HEALTH_SV31 ={{277,6}}; +const bits_slice HEALTH_SV32 ={{283,6}}; @@ -280,33 +288,33 @@ const bits_slice HEALTH_SV32[]={{283,6}}; // page 25 - Health (PRN 1 - 24) -const bits_slice T_OA[]={{69,8}}; +const bits_slice T_OA ={{69,8}}; const double T_OA_LSB = TWO_P12; -const bits_slice WN_A[]={{77,8}}; -const bits_slice HEALTH_SV1[]={{91,6}}; -const bits_slice HEALTH_SV2[]={{97,6}}; -const bits_slice HEALTH_SV3[]={{103,6}}; -const bits_slice HEALTH_SV4[]={{109,6}}; -const bits_slice HEALTH_SV5[]={{121,6}}; -const bits_slice HEALTH_SV6[]={{127,6}}; -const bits_slice HEALTH_SV7[]={{133,6}}; -const bits_slice HEALTH_SV8[]={{139,6}}; -const bits_slice HEALTH_SV9[]={{151,6}}; -const bits_slice HEALTH_SV10[]={{157,6}}; -const bits_slice HEALTH_SV11[]={{163,6}}; -const bits_slice HEALTH_SV12[]={{169,6}}; -const bits_slice HEALTH_SV13[]={{181,6}}; -const bits_slice HEALTH_SV14[]={{187,6}}; -const bits_slice HEALTH_SV15[]={{193,6}}; -const bits_slice HEALTH_SV16[]={{199,6}}; -const bits_slice HEALTH_SV17[]={{211,6}}; -const bits_slice HEALTH_SV18[]={{217,6}}; -const bits_slice HEALTH_SV19[]={{223,6}}; -const bits_slice HEALTH_SV20[]={{229,6}}; -const bits_slice HEALTH_SV21[]={{241,6}}; -const bits_slice HEALTH_SV22[]={{247,6}}; -const bits_slice HEALTH_SV23[]={{253,6}}; -const bits_slice HEALTH_SV24[]={{259,6}}; +const bits_slice WN_A ={{77,8}}; +const bits_slice HEALTH_SV1 ={{91,6}}; +const bits_slice HEALTH_SV2 ={{97,6}}; +const bits_slice HEALTH_SV3 ={{103,6}}; +const bits_slice HEALTH_SV4 ={{109,6}}; +const bits_slice HEALTH_SV5 ={{121,6}}; +const bits_slice HEALTH_SV6 ={{127,6}}; +const bits_slice HEALTH_SV7 ={{133,6}}; +const bits_slice HEALTH_SV8 ={{139,6}}; +const bits_slice HEALTH_SV9 ={{151,6}}; +const bits_slice HEALTH_SV10 ={{157,6}}; +const bits_slice HEALTH_SV11 ={{163,6}}; +const bits_slice HEALTH_SV12 ={{169,6}}; +const bits_slice HEALTH_SV13 ={{181,6}}; +const bits_slice HEALTH_SV14 ={{187,6}}; +const bits_slice HEALTH_SV15 ={{193,6}}; +const bits_slice HEALTH_SV16 ={{199,6}}; +const bits_slice HEALTH_SV17 ={{211,6}}; +const bits_slice HEALTH_SV18 ={{217,6}}; +const bits_slice HEALTH_SV19 ={{223,6}}; +const bits_slice HEALTH_SV20 ={{229,6}}; +const bits_slice HEALTH_SV21 ={{241,6}}; +const bits_slice HEALTH_SV22 ={{247,6}}; +const bits_slice HEALTH_SV23 ={{253,6}}; +const bits_slice HEALTH_SV24 ={{259,6}}; /* diff --git a/src/core/system_parameters/gnss_synchro.cc b/src/core/system_parameters/gnss_synchro.cc deleted file mode 100644 index 5c6e645fc..000000000 --- a/src/core/system_parameters/gnss_synchro.cc +++ /dev/null @@ -1,64 +0,0 @@ -/*! - * \file gnss_synchro.cc - * \brief Implementation of the Gnss_Synchro class - * \author - * Luis Esteve, 2012. luis(at)epsilon-formacion.com - * Javier Arribas, 2012. jarribas(at)cttc.es - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * GNSS-SDR is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * at your option) any later version. - * - * GNSS-SDR is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . - * - * ------------------------------------------------------------------------- - */ - -#include "gnss_synchro.h" - -Gnss_Synchro::Gnss_Synchro() -{ - PRN = 0; - // Acquisition - Acq_delay_samples = 0.0; - Acq_doppler_hz = 0.0; - Acq_samplestamp_samples = 0; - Flag_valid_acquisition = false; - //Tracking - Prompt_I = 0.0; - Prompt_Q = 0.0; - Carrier_phase_rads = 0.0; - Code_phase_secs = 0.0; - Tracking_timestamp_secs = 0.0; - CN0_dB_hz = 0.0; - Flag_valid_tracking = false; - //Telemetry Decoder - Preamble_timestamp_ms = 0.0; - Prn_timestamp_ms = 0.0; - Channel_ID = 0; - Flag_valid_word = false; - Flag_preamble = false; - // Pseudorange - Pseudorange_m = 0.0; - Pseudorange_symbol_shift = 0.0; - Flag_valid_pseudorange = false; -} - -Gnss_Synchro::~Gnss_Synchro() -{} - diff --git a/src/core/system_parameters/gnss_synchro.h b/src/core/system_parameters/gnss_synchro.h index fac6cfcd5..065774d00 100644 --- a/src/core/system_parameters/gnss_synchro.h +++ b/src/core/system_parameters/gnss_synchro.h @@ -37,11 +37,11 @@ * \brief This is the class that contains the information that is shared * by the processing blocks. */ -class Gnss_Synchro +class Gnss_Synchro { public: - Gnss_Synchro(); - ~Gnss_Synchro(); + //reset(); + //~Gnss_Synchro(); // Satellite and signal info char System; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) char Signal[3]; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) diff --git a/src/core/system_parameters/gps_navigation_message.cc b/src/core/system_parameters/gps_navigation_message.cc index dae17af52..4dd6a693c 100644 --- a/src/core/system_parameters/gps_navigation_message.cc +++ b/src/core/system_parameters/gps_navigation_message.cc @@ -197,11 +197,12 @@ void Gps_Navigation_Message::print_gps_word_bytes(unsigned int GPS_word) -bool Gps_Navigation_Message::read_navigation_bool(std::bitset bits, const bits_slice *slices) +bool Gps_Navigation_Message::read_navigation_bool(std::bitset bits, const bits_slice slices) { bool value; - if (bits[GPS_SUBFRAME_BITS - slices[0].position] == 1) + //if (bits[GPS_SUBFRAME_BITS - slices->front().position] == 1) + if (bits[GPS_SUBFRAME_BITS - slices.at(0).position] == 1) { value = true; } @@ -217,17 +218,16 @@ bool Gps_Navigation_Message::read_navigation_bool(std::bitset -unsigned long int Gps_Navigation_Message::read_navigation_unsigned(std::bitset bits, const bits_slice *slices, int num_of_slices) +unsigned long int Gps_Navigation_Message::read_navigation_unsigned(std::bitset bits, const bits_slice slices, int num_of_slices) { unsigned long int value; - value = 0; for (int i=0; i bits, const bits_slice *slices, int num_of_slices) +signed long int Gps_Navigation_Message::read_navigation_signed(std::bitset bits, const bits_slice slices, int num_of_slices) { signed long int value = 0; // read the MSB and perform the sign extension - if (bits[GPS_SUBFRAME_BITS-slices[0].position]==1) + if (bits[GPS_SUBFRAME_BITS-slices.at(0).position]==1) { value^=0xFFFFFFFF; } @@ -257,11 +257,11 @@ signed long int Gps_Navigation_Message::read_navigation_signed(std::bitset bits, const bits_slice *slices, int num_of_slices); - signed long int read_navigation_signed(std::bitset bits, const bits_slice *slices, int num_of_slices); - bool read_navigation_bool(std::bitset bits, const bits_slice *slices); + unsigned long int read_navigation_unsigned(std::bitset bits, const bits_slice slices, int num_of_slices); + signed long int read_navigation_signed(std::bitset bits, const bits_slice slices, int num_of_slices); + bool read_navigation_bool(std::bitset bits, const bits_slice slices); void print_gps_word_bytes(unsigned int GPS_word); /* diff --git a/src/core/system_parameters/jamfile.jam b/src/core/system_parameters/jamfile.jam index 9ced36400..d31ff2e05 100644 --- a/src/core/system_parameters/jamfile.jam +++ b/src/core/system_parameters/jamfile.jam @@ -3,4 +3,4 @@ project : build-dir ../../../build ; obj gps_navigation_message : gps_navigation_message.cc ; obj gnss_satellite : gnss_satellite.cc ; obj gnss_signal : gnss_signal.cc ; -obj gnss_synchro : gnss_synchro.cc ; \ No newline at end of file +#obj gnss_synchro : gnss_synchro.hpp ; \ No newline at end of file diff --git a/src/main/jamfile.jam b/src/main/jamfile.jam index 3025c91e2..5318cd2b5 100644 --- a/src/main/jamfile.jam +++ b/src/main/jamfile.jam @@ -57,12 +57,11 @@ exe gnss-sdr : main.cc ../core/system_parameters//gps_navigation_message ../core/system_parameters//gnss_satellite ../core/system_parameters//gnss_signal -../core/system_parameters//gnss_synchro +#../core/system_parameters//gnss_synchro ../..//gflags ../..//glog ../..//gnuradio-core ../..//uhd ../..//gnuradio-uhd ; -#../..//gnuradio-usrp ; install ../../install : gnss-sdr ; diff --git a/src/main/main.cc b/src/main/main.cc index 430ab281d..9f5f58f03 100644 --- a/src/main/main.cc +++ b/src/main/main.cc @@ -108,8 +108,8 @@ int main(int argc, char** argv) // report the elapsed time gettimeofday(&tv, NULL); long long int end = tv.tv_sec * 1000000 + tv.tv_usec; - std::cout << "Total GNSS-SDR run time " << ((double)(end - begin))/1000000.0<< " [seconds]"<< std::endl; + std::cout << "Total GNSS-SDR run time " << ((double)(end - begin))/1000000.0 << " [seconds]" << std::endl; google::ShutDownCommandLineFlags(); - std::cout<<"GNSS-SDR program ended"<