mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 15:23:04 +00:00 
			
		
		
		
	Added GPS L2 Ephemeris and Clock parameters CNAV frame bit structure
definitions
This commit is contained in:
		| @@ -300,14 +300,14 @@ void gps_l2_m_dll_pll_tracking_cc::update_local_carrier() | ||||
| { | ||||
|     float phase_rad, phase_step_rad; | ||||
|  | ||||
|     phase_step_rad = static_cast<float>(GPS_TWO_PI) * d_carrier_doppler_hz / static_cast<float>(d_fs_in); | ||||
|     phase_step_rad = static_cast<float>(GPS_L2_TWO_PI) * d_carrier_doppler_hz / static_cast<float>(d_fs_in); | ||||
|     phase_rad = d_rem_carr_phase_rad; | ||||
|     for(int i = 0; i < d_current_prn_length_samples; i++) | ||||
|         { | ||||
|             d_carr_sign[i] = gr_complex(cos(phase_rad), -sin(phase_rad)); | ||||
|             phase_rad += phase_step_rad; | ||||
|         } | ||||
|     //d_rem_carr_phase_rad = fmod(phase_rad, GPS_TWO_PI); | ||||
|     //d_rem_carr_phase_rad = fmod(phase_rad, GPS_L2_TWO_PI); | ||||
|     //d_acc_carrier_phase_rad = d_acc_carrier_phase_rad + d_rem_carr_phase_rad; | ||||
| } | ||||
|  | ||||
| @@ -413,7 +413,7 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items, gr_vector_int | ||||
|  | ||||
|             // ################## PLL ########################################################## | ||||
|             // PLL discriminator | ||||
|             carr_error_hz = pll_cloop_two_quadrant_atan(*d_Prompt) / static_cast<float>(GPS_TWO_PI); | ||||
|             carr_error_hz = pll_cloop_two_quadrant_atan(*d_Prompt) / static_cast<float>(GPS_L2_TWO_PI); | ||||
|             // Carrier discriminator filter | ||||
|             carr_error_filt_hz = d_carrier_loop_filter.get_carrier_nco(carr_error_hz); | ||||
|             // New carrier Doppler frequency estimation | ||||
| @@ -421,10 +421,10 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items, gr_vector_int | ||||
|             // New code Doppler frequency estimation | ||||
|             d_code_freq_chips = GPS_L2_M_CODE_RATE_HZ + ((d_carrier_doppler_hz * GPS_L2_M_CODE_RATE_HZ) / GPS_L2_FREQ_HZ); | ||||
|             //carrier phase accumulator for (K) doppler estimation | ||||
|             d_acc_carrier_phase_rad = d_acc_carrier_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * GPS_L2_M_PERIOD; | ||||
|             d_acc_carrier_phase_rad = d_acc_carrier_phase_rad + GPS_L2_TWO_PI * d_carrier_doppler_hz * GPS_L2_M_PERIOD; | ||||
|             //remanent carrier phase to prevent overflow in the code NCO | ||||
|             d_rem_carr_phase_rad = d_rem_carr_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * GPS_L2_M_PERIOD; | ||||
|             d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, GPS_TWO_PI); | ||||
|             d_rem_carr_phase_rad = d_rem_carr_phase_rad + GPS_L2_TWO_PI * d_carrier_doppler_hz * GPS_L2_M_PERIOD; | ||||
|             d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, GPS_L2_TWO_PI); | ||||
|  | ||||
|             // ################## DLL ########################################################## | ||||
|             // DLL discriminator | ||||
|   | ||||
| @@ -45,7 +45,6 @@ | ||||
| #include <gnuradio/block.h> | ||||
| #include <gnuradio/msg_queue.h> | ||||
| #include "concurrent_queue.h" | ||||
| #include "gps_sdr_signal_processing.h" | ||||
| #include "gnss_synchro.h" | ||||
| #include "tracking_2nd_DLL_filter.h" | ||||
| #include "tracking_2nd_PLL_filter.h" | ||||
|   | ||||
| @@ -37,6 +37,7 @@ set(SYSTEM_PARAMETERS_SOURCES | ||||
| 	 sbas_satellite_correction.cc | ||||
| 	 sbas_telemetry_data.cc | ||||
| 	 galileo_fnav_message.cc | ||||
| 	 gps_cnav_ephemeris.cc | ||||
| ) | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -33,6 +33,20 @@ | ||||
| #define GNSS_SDR_GPS_L2C_H_ | ||||
|  | ||||
| #include <stdint.h> | ||||
| #include <complex> | ||||
| #include <vector> | ||||
| #include <utility> // std::pair | ||||
| #include <gnss_satellite.h> | ||||
| #include "MATH_CONSTANTS.h" | ||||
|  | ||||
| // Physical constants | ||||
| const double GPS_L2_C_m_s       = 299792458.0;      //!< The speed of light, [m/s] | ||||
| const double GPS_L2_C_m_ms      = 299792.4580;      //!< The speed of light, [m/ms] | ||||
| const double GPS_L2_PI          = 3.1415926535898;  //!< Pi as defined in IS-GPS-200E | ||||
| const double GPS_L2_TWO_PI      = 6.283185307179586;//!< 2Pi as defined in IS-GPS-200E | ||||
| const double GPS_L2_OMEGA_EARTH_DOT = 7.2921151467e-5;  //!< Earth rotation rate, [rad/s] | ||||
| const double GPS_L2_GM              = 3.986005e14;      //!< Universal gravitational constant times the mass of the Earth, [m^3/s^2] | ||||
| const double GPS_L2_F               = -4.442807633e-10; //!< Constant, [s/(m)^(1/2)] | ||||
|  | ||||
|  | ||||
| // carrier and code frequencies | ||||
| @@ -78,4 +92,120 @@ const int32_t GPS_L2C_M_INIT_REG[115] = | ||||
| 0706202440,  0705056276,  0020373522,  0746013617, | ||||
| 0132720621,  0434015513,  0566721727,  0140633660}; | ||||
|  | ||||
| // CNAV GPS NAVIGATION MESSAGE STRUCTURE | ||||
| // NAVIGATION MESSAGE FIELDS POSITIONS (from IS-GPS-200E Appendix III) | ||||
|  | ||||
| #define GPS_CNAV_PREAMBLE {1, 0, 0, 0, 1, 0, 1, 1} | ||||
|  | ||||
| // common to all messages | ||||
| const std::vector<std::pair<int,int> > CNAV_PRN( { {9,6} } ); | ||||
| const std::vector<std::pair<int,int> > CNAV_MSG_TYPE( { {15,6} } ); | ||||
| const std::vector<std::pair<int,int> > CNAV_TOW( { {21,17} } ); | ||||
| const std::vector<std::pair<int,int> > CNAV_ALERT_FLAG( { {38,1} } ); | ||||
|  | ||||
| // MESSAGE TYPE 10 (Ephemeris 1) | ||||
|  | ||||
| const std::vector<std::pair<int,int> > CNAV_WN({{39,13}}); | ||||
| const std::vector<std::pair<int,int> > CNAV_HEALTH({{52,3}}); | ||||
| const std::vector<std::pair<int,int> > CNAV_TOP1({{55,11}}); | ||||
| const double CNAV_TOP1_LSB = 300; | ||||
| const std::vector<std::pair<int,int> > CNAV_URA({{66,5}}); | ||||
|  | ||||
| const std::vector<std::pair<int,int> > CNAV_TOE1({{71,11}}); | ||||
| const double CNAV_TOE1_LSB = 300; | ||||
|  | ||||
| const std::vector<std::pair<int,int> > CNAV_DELTA_A({{82,26}}); //Relative to AREF = 26,559,710 meters | ||||
| const double CNAV_DELTA_A_LSB = TWO_N9; | ||||
|  | ||||
| const std::vector<std::pair<int,int> > CNAV_A_DOT({{108,25}}); | ||||
| const double CNAV_A_DOT_LSB = TWO_N21; | ||||
|  | ||||
| const std::vector<std::pair<int,int> > CNAV_DELTA_N0({{133,17}}); | ||||
| const double CNAV_DELTA_N0_LSB = TWO_N44; | ||||
| const std::vector<std::pair<int,int> > CNAV_DELTA_N0_DOT({{150,23}}); | ||||
| const double CNAV_DELTA_N0_DOT_LSB = TWO_N57; | ||||
| const std::vector<std::pair<int,int> > CNAV_M0({{173,33}}); | ||||
| const double CNAV_M0_LSB = TWO_N32; | ||||
| const std::vector<std::pair<int,int> > CNAV_E_ECCENTRICITY({{206,33}}); | ||||
| const double CNAV_E_ECCENTRICITY_LSB = TWO_N34; | ||||
| const std::vector<std::pair<int,int> > CNAV_OMEGA({{239,33}}); | ||||
| const double CNAV_OMEGA_LSB = TWO_N32; | ||||
| const std::vector<std::pair<int,int> > CNAV_INTEGRITY_FLAG({{272,1}}); | ||||
| const std::vector<std::pair<int,int> > CNAV_L2_PHASING_FLAG({{273,1}}); | ||||
|  | ||||
| // MESSAGE TYPE 11 (Ephemeris 2) | ||||
|  | ||||
| const std::vector<std::pair<int,int> > CNAV_TOE2({{39,11}}); | ||||
| const double CNAV_TOE2_LSB = 300; | ||||
| const std::vector<std::pair<int,int> > CNAV_OMEGA0({{50,33}}); | ||||
| const double CNAV_OMEGA0_LSB = TWO_N32; | ||||
| const std::vector<std::pair<int,int> > CNAV_I0({{83,33}}); | ||||
| const double CNAV_I0_LSB = TWO_N32; | ||||
| const std::vector<std::pair<int,int> > CNAV_DELTA_OMEGA_DOT({{116,17}}); //Relative to REF = -2.6 x 10-9 semi-circles/second. | ||||
| const double CNAV_DELTA_OMEGA_DOT_LSB = TWO_N44; | ||||
| const std::vector<std::pair<int,int> > CNAV_I0_DOT({{133,15}}); | ||||
| const double CNAV_I0_DOT_LSB = TWO_N44; | ||||
| const std::vector<std::pair<int,int> > CNAV_CIS({{148,16}}); | ||||
| const double CNAV_CIS_LSB = TWO_N30; | ||||
| const std::vector<std::pair<int,int> > CNAV_CIC({{164,16}}); | ||||
| const double CNAV_CIC_LSB = TWO_N30; | ||||
| const std::vector<std::pair<int,int> > CNAV_CRS({{180,24}}); | ||||
| const double CNAV_CRS_LSB = TWO_N8; | ||||
| const std::vector<std::pair<int,int> > CNAV_CRC({{204,24}}); | ||||
| const double CNAV_CRC_LSB = TWO_N8; | ||||
| const std::vector<std::pair<int,int> > CNAV_CUS({{228,21}}); | ||||
| const double CNAV_CUS_LSB = TWO_N30; | ||||
| const std::vector<std::pair<int,int> > CNAV_CUC({{249,21}}); | ||||
| const double CNAV_CUC_LSB = TWO_N30; | ||||
|  | ||||
|  | ||||
| // MESSAGE TYPE 30 (CLOCK, IONO, GRUP DELAY) | ||||
|  | ||||
| const std::vector<std::pair<int,int> > CNAV_TOP2({{39,11}}); | ||||
| const double CNAV_TOP2_LSB = 300; | ||||
|  | ||||
| const std::vector<std::pair<int,int> > CNAV_URA_NED0({{50,5}}); | ||||
| const std::vector<std::pair<int,int> > CNAV_URA_NED1({{55,3}}); | ||||
| const std::vector<std::pair<int,int> > CNAV_URA_NED2({{58,3}}); | ||||
| const std::vector<std::pair<int,int> > CNAV_TOC({{61,11}}); | ||||
| const double CNAV_TOC_LSB = 300; | ||||
| const std::vector<std::pair<int,int> > CNAV_AF0({{72,26}}); | ||||
| const double CNAV_AF0_LSB = TWO_N60; | ||||
| const std::vector<std::pair<int,int> > CNAV_AF1({{98,20}}); | ||||
| const double CNAV_AF1_LSB = TWO_N48; | ||||
| const std::vector<std::pair<int,int> > CNAV_AF2({{118,10}}); | ||||
| const double CNAV_AF2_LSB = TWO_N35; | ||||
| const std::vector<std::pair<int,int> > CNAV_TGD({{128,13}}); | ||||
| const double CNAV_TGD_LSB = TWO_N35; | ||||
| const std::vector<std::pair<int,int> > CNAV_ISCL1({{141,13}}); | ||||
| const double CNAV_ISCL1_LSB = TWO_N35; | ||||
| const std::vector<std::pair<int,int> > CNAV_ISCL2({{154,13}}); | ||||
| const double CNAV_ISCL2_LSB = TWO_N35; | ||||
| const std::vector<std::pair<int,int> > CNAV_ISCL5I({{167,13}}); | ||||
| const double CNAV_ISCL5I_LSB = TWO_N35; | ||||
| const std::vector<std::pair<int,int> > CNAV_ISCL5Q({{180,13}}); | ||||
| const double CNAV_ISCL5Q_LSB = TWO_N35; | ||||
| const std::vector<std::pair<int,int> > CNAV_ALPHA0({{193,8}}); | ||||
| const double CNAV_ALPHA0_LSB = TWO_N30; | ||||
| const std::vector<std::pair<int,int> > CNAV_ALPHA1({{201,8}}); | ||||
| const double CNAV_ALPHA1_LSB = TWO_N27; | ||||
| const std::vector<std::pair<int,int> > CNAV_ALPHA2({{209,8}}); | ||||
| const double CNAV_ALPHA2_LSB = TWO_N24; | ||||
| const std::vector<std::pair<int,int> > CNAV_ALPHA3({{217,8}}); | ||||
| const double CNAV_ALPHA3_LSB = TWO_N24; | ||||
| const std::vector<std::pair<int,int> > CNAV_BETA0({{225,8}}); | ||||
| const double CNAV_BETA0_LSB = TWO_P11; | ||||
| const std::vector<std::pair<int,int> > CNAV_BETA1({{233,8}}); | ||||
| const double CNAV_BETA1_LSB = TWO_P14; | ||||
| const std::vector<std::pair<int,int> > CNAV_BETA2({{241,8}}); | ||||
| const double CNAV_BETA2_LSB = TWO_P16; | ||||
| const std::vector<std::pair<int,int> > CNAV_BETA3({{249,8}}); | ||||
| const double CNAV_BETA3_LSB = TWO_P16; | ||||
| const std::vector<std::pair<int,int> > CNAV_WNOP({{257,8}}); | ||||
|  | ||||
|  | ||||
| // TODO: Add more frames (Almanac, etc...) | ||||
|  | ||||
|  | ||||
|  | ||||
| #endif /* GNSS_SDR_GPS_L2C_H_ */ | ||||
|   | ||||
| @@ -76,12 +76,17 @@ const double TWO_N35 = (2.91038304567337e-011);	  //!< 2^-35 | ||||
|  | ||||
| const double TWO_N38 = (3.637978807091713e-012);  //!< 2^-38 | ||||
| const double TWO_N43 = (1.136868377216160e-013);  //!< 2^-43 | ||||
| const double TWO_N44 = (5.684341886080802e-14);  //!< 2^-44 | ||||
| const double TWO_N46 = (1.4210854715202e-014);    //!< 2^-46 | ||||
| const double TWO_N48 = (3.552713678800501e-15);    //!< 2^-46 | ||||
|  | ||||
| const double TWO_N50 = (8.881784197001252e-016);  //!< 2^-50 | ||||
| const double TWO_N51 = (4.44089209850063e-016);   //!< 2^-51 | ||||
| const double TWO_N55 = (2.775557561562891e-017);  //!< 2^-55 | ||||
| const double TWO_N57 = (6.938893903907228e-18);  //!< 2^-57 | ||||
| const double TWO_N59 = (1.73472347597681e-018);   //!< 2^-59 | ||||
| const double TWO_N60 = (8.673617379884036e-19);   //!< 2^-60 | ||||
|  | ||||
|  | ||||
| const double PI_TWO_N19 = (5.992112452678286e-006);  //!< Pi*2^-19 | ||||
| const double PI_TWO_N43 = (3.571577341960839e-013);  //!< Pi*2^-43 | ||||
|   | ||||
							
								
								
									
										115
									
								
								src/core/system_parameters/gps_cnav_ephemeris.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										115
									
								
								src/core/system_parameters/gps_cnav_ephemeris.cc
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,115 @@ | ||||
| /*! | ||||
|  * \file Gps_CNAV_Ephemeris.cc | ||||
|  * \brief  Interface of a GPS CNAV EPHEMERIS storage and orbital model functions | ||||
|  * | ||||
|  * See http://www.gps.gov/technical/icwg/IS-GPS-200E.pdf Appendix II | ||||
|  * \author Javier Arribas, 2015. jarribas(at)cttc.es | ||||
|  * | ||||
|  * ------------------------------------------------------------------------- | ||||
|  * | ||||
|  * Copyright (C) 2010-2015  (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 <http://www.gnu.org/licenses/>. | ||||
|  * | ||||
|  * ------------------------------------------------------------------------- | ||||
|  */ | ||||
|  | ||||
| #include "gps_cnav_ephemeris.h" | ||||
|  | ||||
| Gps_CNAV_Ephemeris::Gps_CNAV_Ephemeris() | ||||
| { | ||||
|     i_satellite_PRN = 0; | ||||
|  | ||||
|     d_TOW = 0; | ||||
|     d_Crs = 0; | ||||
|     d_M_0 = 0; | ||||
|     d_Cuc = 0; | ||||
|     d_e_eccentricity = 0; | ||||
|     d_Cus = 0; | ||||
|  | ||||
|     d_Toe = 0; | ||||
|     d_Toc = 0; | ||||
|     d_Cic = 0; | ||||
|     d_OMEGA0 = 0; | ||||
|     d_Cis = 0; | ||||
|     d_i_0 = 0; | ||||
|     d_Crc = 0; | ||||
|     d_OMEGA = 0; | ||||
|     d_IDOT = 0; | ||||
|  | ||||
|     i_GPS_week = 0; | ||||
|  | ||||
|     d_TGD = 0;            // Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] | ||||
|  | ||||
|     d_A_f0 = 0;          // Coefficient 0 of code phase offset model [s] | ||||
|     d_A_f1 = 0;          // Coefficient 1 of code phase offset model [s/s] | ||||
|     d_A_f2 = 0;          // Coefficient 2 of code phase offset model [s/s^2] | ||||
|  | ||||
|     b_integrity_status_flag = false; | ||||
|     b_alert_flag = false;         // If true, indicates  that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. | ||||
|     b_antispoofing_flag = false;  //  If true, the AntiSpoofing mode is ON in that SV | ||||
|  | ||||
|     //Plane A (info from http://www.navcen.uscg.gov/?Do=constellationStatus) | ||||
|     satelliteBlock[9] = "IIA"; | ||||
|     satelliteBlock[31] = "IIR-M"; | ||||
|     satelliteBlock[8] = "IIA"; | ||||
|     satelliteBlock[7] = "IIR-M"; | ||||
|     satelliteBlock[27] = "IIA"; | ||||
|     //Plane B | ||||
|     satelliteBlock[16] = "IIR"; | ||||
|     satelliteBlock[25] = "IIF"; | ||||
|     satelliteBlock[28] = "IIR"; | ||||
|     satelliteBlock[12] = "IIR-M"; | ||||
|     satelliteBlock[30] = "IIA"; | ||||
|     //Plane C | ||||
|     satelliteBlock[29] = "IIR-M"; | ||||
|     satelliteBlock[3] = "IIA"; | ||||
|     satelliteBlock[19] = "IIR"; | ||||
|     satelliteBlock[17] = "IIR-M"; | ||||
|     satelliteBlock[6] = "IIA"; | ||||
|     //Plane D | ||||
|     satelliteBlock[2] = "IIR"; | ||||
|     satelliteBlock[1] = "IIF"; | ||||
|     satelliteBlock[21] = "IIR"; | ||||
|     satelliteBlock[4] = "IIA"; | ||||
|     satelliteBlock[11] = "IIR"; | ||||
|     satelliteBlock[24] = "IIA"; // Decommissioned from active service on 04 Nov 2011 | ||||
|     //Plane E | ||||
|     satelliteBlock[20] = "IIR"; | ||||
|     satelliteBlock[22] = "IIR"; | ||||
|     satelliteBlock[5] = "IIR-M"; | ||||
|     satelliteBlock[18] = "IIR"; | ||||
|     satelliteBlock[32] = "IIA"; | ||||
|     satelliteBlock[10] = "IIA"; | ||||
|     //Plane F | ||||
|     satelliteBlock[14] = "IIR"; | ||||
|     satelliteBlock[15] = "IIR-M"; | ||||
|     satelliteBlock[13] = "IIR"; | ||||
|     satelliteBlock[23] = "IIR"; | ||||
|     satelliteBlock[26] = "IIA"; | ||||
|  | ||||
|     d_satClkDrift = 0.0; | ||||
|     d_dtr = 0.0; | ||||
|     d_satpos_X = 0.0; | ||||
|     d_satpos_Y = 0.0; | ||||
|     d_satpos_Z = 0.0; | ||||
|     d_satvel_X = 0.0; | ||||
|     d_satvel_Y = 0.0; | ||||
|     d_satvel_Z = 0.0; | ||||
| } | ||||
							
								
								
									
										179
									
								
								src/core/system_parameters/gps_cnav_ephemeris.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										179
									
								
								src/core/system_parameters/gps_cnav_ephemeris.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,179 @@ | ||||
| /*! | ||||
|  * \file Gps_CNAV_Ephemeris.h | ||||
|  * \brief  Interface of a GPS EPHEMERIS storage | ||||
|  * \author Javier Arribas, 2013. jarribas(at)cttc.es | ||||
|  * | ||||
|  * ------------------------------------------------------------------------- | ||||
|  * | ||||
|  * Copyright (C) 2010-2015  (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 <http://www.gnu.org/licenses/>. | ||||
|  * | ||||
|  * ------------------------------------------------------------------------- | ||||
|  */ | ||||
|  | ||||
|  | ||||
| #ifndef GNSS_SDR_Gps_CNAV_Ephemeris_H_ | ||||
| #define GNSS_SDR_Gps_CNAV_Ephemeris_H_ | ||||
|  | ||||
| #include <iostream> | ||||
| #include <map> | ||||
| #include <string> | ||||
| #include "boost/assign.hpp" | ||||
| #include <boost/serialization/nvp.hpp> | ||||
| #include "GPS_L2C.h" | ||||
|  | ||||
|  | ||||
| /*! | ||||
|  * \brief This class is a storage and orbital model functions for the GPS SV ephemeris data as described in IS-GPS-200E | ||||
|  * | ||||
|  * See http://www.gps.gov/technical/icwg/IS-GPS-200E.pdf Appendix II | ||||
|  */ | ||||
| class Gps_CNAV_Ephemeris | ||||
| { | ||||
| private: | ||||
|  | ||||
| public: | ||||
|     unsigned int i_satellite_PRN; // SV PRN NUMBER | ||||
|  | ||||
|     //Message Types 10 and 11 Parameters (1 of 2) | ||||
|     int i_GPS_week;          //!< GPS week number, aka WN [week] | ||||
|     int i_URA;	//!< ED Accuracy Index | ||||
|     int i_signal_health; //!< Signal health (L1/L2/L5) | ||||
|     double d_Top; //!< Data predict time of week | ||||
|     double d_DELTA_A; //!< Semi-major axis difference at reference time | ||||
|     double d_A_DOT; //!< Change rate in semi-major axis | ||||
|     double d_Delta_n;        //!< Mean Motion Difference From Computed Value [semi-circles/s] | ||||
|     double d_DELTA_DOT_N; // Rate of mean motion difference from computed value | ||||
|     double d_M_0;            //!< Mean Anomaly at Reference Time [semi-circles] | ||||
|     double d_e_eccentricity; //< Eccentricity | ||||
|     double d_OMEGA;          //!< Argument of Perigee [semi-cicles] | ||||
|     double d_OMEGA0;          //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-cicles] | ||||
|     double d_Toe;            //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] | ||||
|     double d_DELTA_OMEGA_DOT;      //!< Rate of Right Ascension  difference [semi-circles/s] | ||||
|     double d_i_0;            //!< Inclination Angle at Reference Time [semi-circles] | ||||
|     double d_IDOT;           //!< Rate of Inclination Angle [semi-circles/s] | ||||
|     double d_Cis;            //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] | ||||
|     double d_Cic;            //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] | ||||
|     double d_Crs;            //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] | ||||
|     double d_Crc;            //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] | ||||
|     double d_Cus;            //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] | ||||
|     double d_Cuc;            //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] | ||||
|  | ||||
|     //Clock Correction and Accuracy Parameters | ||||
|     double d_Toc;            //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] | ||||
|     double d_A_f0;          //!< Coefficient 0 of code phase offset model [s] | ||||
|     double d_A_f1;          //!< Coefficient 1 of code phase offset model [s/s] | ||||
|     double d_A_f2;          //!< Coefficient 2 of code phase offset model [s/s^2] | ||||
|  | ||||
|     double d_URA0;			//!<NED Accuracy Index | ||||
|     double d_URA1;			//!<NED Accuracy Change Index | ||||
|     double d_URA2;			//!< NED Accuracy Change Rate Index | ||||
|  | ||||
|  | ||||
|     //Group Delay Differential Parameters | ||||
|     double d_TGD;            //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] | ||||
|     double d_ISCL1; | ||||
|     double d_ISCL2; | ||||
|     double d_ISCL5I; | ||||
|     double d_ISCL5Q; | ||||
|  | ||||
|     double d_TOW;            //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|     // Flags | ||||
|  | ||||
|     /*! \brief If true, enhanced level of integrity assurance. | ||||
|      * | ||||
|      *  If false, indicates that the conveying signal is provided with the legacy level of integrity assurance. | ||||
|      *  That is, the probability that the instantaneous URE of the conveying signal exceeds 4.42 times the upper bound | ||||
|      *  value of the current broadcast URA index, for more than 5.2 seconds, without an accompanying alert, is less | ||||
|      *  than 1E-5 per hour. If true, indicates that the conveying signal is provided with an enhanced level of | ||||
|      *  integrity assurance. That is, the probability that the instantaneous URE of the conveying signal exceeds 5.73 | ||||
|      *  times the upper bound value of the current broadcast URA index, for more than 5.2 seconds, without an | ||||
|      *  accompanying alert, is less than 1E-8 per hour. | ||||
|      */ | ||||
|     bool b_integrity_status_flag; | ||||
|     bool b_alert_flag;         //!< If true, indicates  that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. | ||||
|     bool b_antispoofing_flag;  //!<  If true, the AntiSpoofing mode is ON in that SV | ||||
|  | ||||
|     // clock terms derived from ephemeris data | ||||
|     double d_satClkDrift;    //!< GPS clock error | ||||
|     double d_dtr;            //!< relativistic clock correction term | ||||
|  | ||||
|     // satellite positions | ||||
|     double d_satpos_X;       //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. | ||||
|     double d_satpos_Y;       //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. | ||||
|     double d_satpos_Z;       //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). | ||||
|  | ||||
|     // Satellite velocity | ||||
|     double d_satvel_X;    //!< Earth-fixed velocity coordinate x of the satellite [m] | ||||
|     double d_satvel_Y;    //!< Earth-fixed velocity coordinate y of the satellite [m] | ||||
|     double d_satvel_Z;    //!< Earth-fixed velocity coordinate z of the satellite [m] | ||||
|  | ||||
|     std::map<int,std::string> satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus | ||||
|  | ||||
|     template<class Archive> | ||||
|  | ||||
|     /*! | ||||
|      * \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file. | ||||
|      */ | ||||
|     void serialize(Archive& archive, const unsigned int version) | ||||
|     { | ||||
|         using boost::serialization::make_nvp; | ||||
|         if(version){}; | ||||
|  | ||||
|         archive & make_nvp("i_satellite_PRN", i_satellite_PRN); // SV PRN NUMBER | ||||
|         archive & make_nvp("d_TOW", d_TOW);          //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] | ||||
|         archive & make_nvp("d_Crs", d_Crs);          //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] | ||||
|         archive & make_nvp("d_M_0", d_M_0);          //!< Mean Anomaly at Reference Time [semi-circles] | ||||
|         archive & make_nvp("d_Cuc", d_Cuc);          //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] | ||||
|         archive & make_nvp("d_e_eccentricity", d_e_eccentricity); //!< Eccentricity [dimensionless] | ||||
|         archive & make_nvp("d_Cus", d_Cus);          //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] | ||||
|         archive & make_nvp("d_Toe", d_Toe);          //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] | ||||
|         archive & make_nvp("d_Toc", d_Toe);          //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] | ||||
|         archive & make_nvp("d_Cic", d_Cic);          //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] | ||||
|         archive & make_nvp("d_OMEGA0", d_OMEGA0);    //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] | ||||
|         archive & make_nvp("d_Cis", d_Cis);          //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] | ||||
|         archive & make_nvp("d_i_0", d_i_0);          //!< Inclination Angle at Reference Time [semi-circles] | ||||
|         archive & make_nvp("d_Crc", d_Crc);          //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] | ||||
|         archive & make_nvp("d_OMEGA", d_OMEGA);      //!< Argument of Perigee [semi-cicles] | ||||
|         archive & make_nvp("d_IDOT", d_IDOT);        //!< Rate of Inclination Angle [semi-circles/s] | ||||
|         archive & make_nvp("i_GPS_week", i_GPS_week);      //!< GPS week number, aka WN [week] | ||||
|         archive & make_nvp("d_TGD", d_TGD);           //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] | ||||
|  | ||||
|  | ||||
|         archive & make_nvp("d_A_f0", d_A_f0);          //!< Coefficient 0 of code phase offset model [s] | ||||
|         archive & make_nvp("d_A_f1", d_A_f1);          //!< Coefficient 1 of code phase offset model [s/s] | ||||
|         archive & make_nvp("d_A_f2", d_A_f2);          //!< Coefficient 2 of code phase offset model [s/s^2] | ||||
|  | ||||
|         archive & make_nvp("b_integrity_status_flag", b_integrity_status_flag); | ||||
|         archive & make_nvp("b_alert_flag", b_alert_flag);     //!< If true, indicates  that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. | ||||
|         archive & make_nvp("b_antispoofing_flag", b_antispoofing_flag); //!<  If true, the AntiSpoofing mode is ON in that SV | ||||
|     } | ||||
|  | ||||
|     /*! | ||||
|      * Default constructor | ||||
|      */ | ||||
|     Gps_CNAV_Ephemeris(); | ||||
| }; | ||||
|  | ||||
| #endif | ||||
		Reference in New Issue
	
	Block a user
	 Javier
					Javier