1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-22 21:13:15 +00:00

Add more extensive use of cstdint typenames

This commit is contained in:
Carles Fernandez 2018-08-14 01:13:07 +02:00
parent 6cee58bdc1
commit 200648be50
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
48 changed files with 1561 additions and 1583 deletions

View File

@ -35,6 +35,7 @@
#include "gnss_frequencies.h"
#include "MATH_CONSTANTS.h"
#include <cstdint>
#include <map>
#include <vector>
#include <utility> // std::pair
@ -96,7 +97,7 @@ const double GLONASS_L1_CA_CODE_PERIOD = 0.001; //!< GLONASS L1 C/A code
const double GLONASS_L1_CA_CHIP_PERIOD = 1.9569e-06; //!< GLONASS L1 C/A chip period [seconds]
const double GLONASS_L1_CA_SYMBOL_RATE_BPS = 1000;
const int GLONASS_CA_NBR_SATS = 24; // STRING DATA WITHOUT PREAMBLE
const int32_t GLONASS_CA_NBR_SATS = 24; // STRING DATA WITHOUT PREAMBLE
/*!
* \brief Record of leap seconds definition for GLOT to GPST conversion and vice versa
@ -125,7 +126,7 @@ const double GLONASS_LEAP_SECONDS[19][7] = {
{}};
//!< GLONASS SV's orbital slots PRN = (orbital_slot - 1)
const std::map<unsigned int, int> GLONASS_PRN = {
const std::map<uint32_t, int32_t> GLONASS_PRN = {
{
0,
8,
@ -227,7 +228,7 @@ const std::map<unsigned int, int> GLONASS_PRN = {
const double GLONASS_STARTOFFSET_ms = 68.802; //[ms] Initial sign. travel time (this cannot go here)
// OBSERVABLE HISTORY DEEP FOR INTERPOLATION
const int GLONASS_L1_CA_HISTORY_DEEP = 100;
const int32_t GLONASS_L1_CA_HISTORY_DEEP = 100;
// NAVIGATION MESSAGE DEMODULATION AND DECODING
#define GLONASS_GNAV_PREAMBLE \
@ -235,96 +236,96 @@ const int GLONASS_L1_CA_HISTORY_DEEP = 100;
1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0 \
}
const double GLONASS_GNAV_PREAMBLE_DURATION_S = 0.300;
const int GLONASS_GNAV_PREAMBLE_LENGTH_BITS = 30;
const int GLONASS_GNAV_PREAMBLE_LENGTH_SYMBOLS = 300;
const int GLONASS_GNAV_PREAMBLE_PERIOD_SYMBOLS = 2000;
const int GLONASS_GNAV_TELEMETRY_RATE_BITS_SECOND = 50; //!< NAV message bit rate [bits/s]
const int GLONASS_GNAV_TELEMETRY_SYMBOLS_PER_BIT = 10;
const int GLONASS_GNAV_TELEMETRY_SYMBOLS_PER_PREAMBLE_BIT = 10;
const int GLONASS_GNAV_TELEMETRY_RATE_SYMBOLS_SECOND = GLONASS_GNAV_TELEMETRY_RATE_BITS_SECOND * GLONASS_GNAV_TELEMETRY_SYMBOLS_PER_BIT; //!< NAV message bit rate [symbols/s]
const int GLONASS_GNAV_STRING_SYMBOLS = 2000; //!< Number of bits per string in the GNAV message (85 data bits + 30 time mark bits) [bits]
const int GLONASS_GNAV_STRING_BITS = 85; //!< Number of bits per string in the GNAV message (85 data bits + 30 time mark bits) [bits]
const int GLONASS_GNAV_HAMMING_CODE_BITS = 8; //!< Number of bits in hamming code sequence of GNAV message
const int GLONASS_GNAV_DATA_SYMBOLS = 1700; // STRING DATA WITHOUT PREAMBLE
const int32_t GLONASS_GNAV_PREAMBLE_LENGTH_BITS = 30;
const int32_t GLONASS_GNAV_PREAMBLE_LENGTH_SYMBOLS = 300;
const int32_t GLONASS_GNAV_PREAMBLE_PERIOD_SYMBOLS = 2000;
const int32_t GLONASS_GNAV_TELEMETRY_RATE_BITS_SECOND = 50; //!< NAV message bit rate [bits/s]
const int32_t GLONASS_GNAV_TELEMETRY_SYMBOLS_PER_BIT = 10;
const int32_t GLONASS_GNAV_TELEMETRY_SYMBOLS_PER_PREAMBLE_BIT = 10;
const int32_t GLONASS_GNAV_TELEMETRY_RATE_SYMBOLS_SECOND = GLONASS_GNAV_TELEMETRY_RATE_BITS_SECOND * GLONASS_GNAV_TELEMETRY_SYMBOLS_PER_BIT; //!< NAV message bit rate [symbols/s]
const int32_t GLONASS_GNAV_STRING_SYMBOLS = 2000; //!< Number of bits per string in the GNAV message (85 data bits + 30 time mark bits) [bits]
const int32_t GLONASS_GNAV_STRING_BITS = 85; //!< Number of bits per string in the GNAV message (85 data bits + 30 time mark bits) [bits]
const int32_t GLONASS_GNAV_HAMMING_CODE_BITS = 8; //!< Number of bits in hamming code sequence of GNAV message
const int32_t GLONASS_GNAV_DATA_SYMBOLS = 1700; // STRING DATA WITHOUT PREAMBLE
const std::vector<int> GLONASS_GNAV_CRC_I_INDEX{9, 10, 12, 13, 15, 17, 19, 20, 22, 24, 26, 28, 30, 32, 34, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84};
const std::vector<int> GLONASS_GNAV_CRC_J_INDEX{9, 11, 12, 14, 15, 18, 19, 21, 22, 25, 26, 29, 30, 33, 34, 36, 37, 40, 41, 44, 45, 48, 49, 52, 53, 56, 57, 60, 61, 64, 65, 67, 68, 71, 72, 75, 76, 79, 80, 83, 84};
const std::vector<int> GLONASS_GNAV_CRC_K_INDEX{10, 11, 12, 16, 17, 18, 19, 23, 24, 25, 26, 31, 32, 33, 34, 38, 39, 40, 41, 46, 47, 48, 49, 54, 55, 56, 57, 62, 63, 64, 65, 69, 70, 71, 72, 77, 78, 79, 80, 85};
const std::vector<int> GLONASS_GNAV_CRC_L_INDEX{13, 14, 15, 16, 17, 18, 19, 27, 28, 29, 30, 31, 32, 33, 34, 42, 43, 44, 45, 46, 47, 48, 49, 58, 59, 60, 61, 62, 63, 64, 65, 73, 74, 75, 76, 77, 78, 79, 80};
const std::vector<int> GLONASS_GNAV_CRC_M_INDEX{20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 81, 82, 83, 84, 85};
const std::vector<int> GLONASS_GNAV_CRC_N_INDEX{35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65};
const std::vector<int> GLONASS_GNAV_CRC_P_INDEX{66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85};
const std::vector<int> GLONASS_GNAV_CRC_Q_INDEX{9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85};
const std::vector<int32_t> GLONASS_GNAV_CRC_I_INDEX{9, 10, 12, 13, 15, 17, 19, 20, 22, 24, 26, 28, 30, 32, 34, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84};
const std::vector<int32_t> GLONASS_GNAV_CRC_J_INDEX{9, 11, 12, 14, 15, 18, 19, 21, 22, 25, 26, 29, 30, 33, 34, 36, 37, 40, 41, 44, 45, 48, 49, 52, 53, 56, 57, 60, 61, 64, 65, 67, 68, 71, 72, 75, 76, 79, 80, 83, 84};
const std::vector<int32_t> GLONASS_GNAV_CRC_K_INDEX{10, 11, 12, 16, 17, 18, 19, 23, 24, 25, 26, 31, 32, 33, 34, 38, 39, 40, 41, 46, 47, 48, 49, 54, 55, 56, 57, 62, 63, 64, 65, 69, 70, 71, 72, 77, 78, 79, 80, 85};
const std::vector<int32_t> GLONASS_GNAV_CRC_L_INDEX{13, 14, 15, 16, 17, 18, 19, 27, 28, 29, 30, 31, 32, 33, 34, 42, 43, 44, 45, 46, 47, 48, 49, 58, 59, 60, 61, 62, 63, 64, 65, 73, 74, 75, 76, 77, 78, 79, 80};
const std::vector<int32_t> GLONASS_GNAV_CRC_M_INDEX{20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 81, 82, 83, 84, 85};
const std::vector<int32_t> GLONASS_GNAV_CRC_N_INDEX{35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65};
const std::vector<int32_t> GLONASS_GNAV_CRC_P_INDEX{66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85};
const std::vector<int32_t> GLONASS_GNAV_CRC_Q_INDEX{9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85};
// GLONASS GNAV NAVIGATION MESSAGE STRUCTURE
// NAVIGATION MESSAGE FIELDS POSITIONS (from IS-GPS-200E Appendix II)
// FRAME 1-4
// COMMON FIELDS
const std::vector<std::pair<int, int>> STRING_ID({{2, 4}});
const std::vector<std::pair<int, int>> KX({{78, 8}});
const std::vector<std::pair<int32_t, int32_t>> STRING_ID({{2, 4}});
const std::vector<std::pair<int32_t, int32_t>> KX({{78, 8}});
//STRING 1
const std::vector<std::pair<int, int>> P1({{8, 2}});
const std::vector<std::pair<int, int>> T_K_HR({{10, 5}});
const std::vector<std::pair<int, int>> T_K_MIN({{15, 6}});
const std::vector<std::pair<int, int>> T_K_SEC({{21, 1}});
const std::vector<std::pair<int, int>> X_N_DOT({{22, 24}});
const std::vector<std::pair<int, int>> X_N_DOT_DOT({{46, 5}});
const std::vector<std::pair<int, int>> X_N({{51, 27}});
const std::vector<std::pair<int32_t, int32_t>> P1({{8, 2}});
const std::vector<std::pair<int32_t, int32_t>> T_K_HR({{10, 5}});
const std::vector<std::pair<int32_t, int32_t>> T_K_MIN({{15, 6}});
const std::vector<std::pair<int32_t, int32_t>> T_K_SEC({{21, 1}});
const std::vector<std::pair<int32_t, int32_t>> X_N_DOT({{22, 24}});
const std::vector<std::pair<int32_t, int32_t>> X_N_DOT_DOT({{46, 5}});
const std::vector<std::pair<int32_t, int32_t>> X_N({{51, 27}});
//STRING 2
const std::vector<std::pair<int, int>> B_N({{6, 3}});
const std::vector<std::pair<int, int>> P2({{9, 1}});
const std::vector<std::pair<int, int>> T_B({{10, 7}});
const std::vector<std::pair<int, int>> Y_N_DOT({{22, 24}});
const std::vector<std::pair<int, int>> Y_N_DOT_DOT({{46, 5}});
const std::vector<std::pair<int, int>> Y_N({{51, 27}});
const std::vector<std::pair<int32_t, int32_t>> B_N({{6, 3}});
const std::vector<std::pair<int32_t, int32_t>> P2({{9, 1}});
const std::vector<std::pair<int32_t, int32_t>> T_B({{10, 7}});
const std::vector<std::pair<int32_t, int32_t>> Y_N_DOT({{22, 24}});
const std::vector<std::pair<int32_t, int32_t>> Y_N_DOT_DOT({{46, 5}});
const std::vector<std::pair<int32_t, int32_t>> Y_N({{51, 27}});
//STRING 3
const std::vector<std::pair<int, int>> P3({{6, 1}});
const std::vector<std::pair<int, int>> GAMMA_N({{7, 11}});
const std::vector<std::pair<int, int>> P({{19, 2}});
const std::vector<std::pair<int, int>> EPH_L_N({{21, 1}});
const std::vector<std::pair<int, int>> Z_N_DOT({{22, 24}});
const std::vector<std::pair<int, int>> Z_N_DOT_DOT({{46, 5}});
const std::vector<std::pair<int, int>> Z_N({{51, 27}});
const std::vector<std::pair<int32_t, int32_t>> P3({{6, 1}});
const std::vector<std::pair<int32_t, int32_t>> GAMMA_N({{7, 11}});
const std::vector<std::pair<int32_t, int32_t>> P({{19, 2}});
const std::vector<std::pair<int32_t, int32_t>> EPH_L_N({{21, 1}});
const std::vector<std::pair<int32_t, int32_t>> Z_N_DOT({{22, 24}});
const std::vector<std::pair<int32_t, int32_t>> Z_N_DOT_DOT({{46, 5}});
const std::vector<std::pair<int32_t, int32_t>> Z_N({{51, 27}});
// STRING 4
const std::vector<std::pair<int, int>> TAU_N({{6, 22}});
const std::vector<std::pair<int, int>> DELTA_TAU_N({{28, 5}});
const std::vector<std::pair<int, int>> E_N({{33, 5}});
const std::vector<std::pair<int, int>> P4({{52, 1}});
const std::vector<std::pair<int, int>> F_T({{53, 4}});
const std::vector<std::pair<int, int>> N_T({{60, 11}});
const std::vector<std::pair<int, int>> N({{71, 5}});
const std::vector<std::pair<int, int>> M({{76, 2}});
const std::vector<std::pair<int32_t, int32_t>> TAU_N({{6, 22}});
const std::vector<std::pair<int32_t, int32_t>> DELTA_TAU_N({{28, 5}});
const std::vector<std::pair<int32_t, int32_t>> E_N({{33, 5}});
const std::vector<std::pair<int32_t, int32_t>> P4({{52, 1}});
const std::vector<std::pair<int32_t, int32_t>> F_T({{53, 4}});
const std::vector<std::pair<int32_t, int32_t>> N_T({{60, 11}});
const std::vector<std::pair<int32_t, int32_t>> N({{71, 5}});
const std::vector<std::pair<int32_t, int32_t>> M({{76, 2}});
// STRING 5
const std::vector<std::pair<int, int>> N_A({{6, 11}});
const std::vector<std::pair<int, int>> TAU_C({{17, 32}});
const std::vector<std::pair<int, int>> N_4({{50, 5}});
const std::vector<std::pair<int, int>> TAU_GPS({{55, 22}});
const std::vector<std::pair<int, int>> ALM_L_N({{77, 1}});
const std::vector<std::pair<int32_t, int32_t>> N_A({{6, 11}});
const std::vector<std::pair<int32_t, int32_t>> TAU_C({{17, 32}});
const std::vector<std::pair<int32_t, int32_t>> N_4({{50, 5}});
const std::vector<std::pair<int32_t, int32_t>> TAU_GPS({{55, 22}});
const std::vector<std::pair<int32_t, int32_t>> ALM_L_N({{77, 1}});
// STRING 6, 8, 10, 12, 14
const std::vector<std::pair<int, int>> C_N({{6, 1}});
const std::vector<std::pair<int, int>> M_N_A({{7, 2}});
const std::vector<std::pair<int, int>> n_A({{9, 5}});
const std::vector<std::pair<int, int>> TAU_N_A({{14, 10}});
const std::vector<std::pair<int, int>> LAMBDA_N_A({{24, 21}});
const std::vector<std::pair<int, int>> DELTA_I_N_A({{45, 18}});
const std::vector<std::pair<int, int>> EPSILON_N_A({{63, 15}});
const std::vector<std::pair<int32_t, int32_t>> C_N({{6, 1}});
const std::vector<std::pair<int32_t, int32_t>> M_N_A({{7, 2}});
const std::vector<std::pair<int32_t, int32_t>> n_A({{9, 5}});
const std::vector<std::pair<int32_t, int32_t>> TAU_N_A({{14, 10}});
const std::vector<std::pair<int32_t, int32_t>> LAMBDA_N_A({{24, 21}});
const std::vector<std::pair<int32_t, int32_t>> DELTA_I_N_A({{45, 18}});
const std::vector<std::pair<int32_t, int32_t>> EPSILON_N_A({{63, 15}});
//STRING 7, 9, 11, 13, 15
const std::vector<std::pair<int, int>> OMEGA_N_A({{6, 16}});
const std::vector<std::pair<int, int>> T_LAMBDA_N_A({{22, 21}});
const std::vector<std::pair<int, int>> DELTA_T_N_A({{43, 22}});
const std::vector<std::pair<int, int>> DELTA_T_DOT_N_A({{65, 7}});
const std::vector<std::pair<int, int>> H_N_A({{72, 5}});
const std::vector<std::pair<int32_t, int32_t>> OMEGA_N_A({{6, 16}});
const std::vector<std::pair<int32_t, int32_t>> T_LAMBDA_N_A({{22, 21}});
const std::vector<std::pair<int32_t, int32_t>> DELTA_T_N_A({{43, 22}});
const std::vector<std::pair<int32_t, int32_t>> DELTA_T_DOT_N_A({{65, 7}});
const std::vector<std::pair<int32_t, int32_t>> H_N_A({{72, 5}});
// STRING 14 FRAME 5
const std::vector<std::pair<int, int>> B1({{6, 11}});
const std::vector<std::pair<int, int>> B2({{17, 10}});
const std::vector<std::pair<int32_t, int32_t>> B1({{6, 11}});
const std::vector<std::pair<int32_t, int32_t>> B2({{17, 10}});
#endif /* GNSS_SDR_GLONASS_L1_L2_CA_H_ */

View File

@ -48,135 +48,135 @@
#define GPS_CNAV_PREAMBLE_STR "10001011"
#define GPS_CNAV_INV_PREAMBLE_STR "01110100"
const int GPS_CNAV_DATA_PAGE_BITS = 300;
const int32_t GPS_CNAV_DATA_PAGE_BITS = 300;
// 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}}); //GPS Time Of Week in seconds
const std::vector<std::pair<int32_t, int32_t> > CNAV_PRN({{9, 6}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_MSG_TYPE({{15, 6}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_TOW({{21, 17}}); // GPS Time Of Week in seconds
const double CNAV_TOW_LSB = 6.0;
const std::vector<std::pair<int, int> > CNAV_ALERT_FLAG({{38, 1}});
const std::vector<std::pair<int32_t, int32_t> > 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 std::vector<std::pair<int32_t, int32_t> > CNAV_WN({{39, 13}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_HEALTH({{52, 3}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_TOP1({{55, 11}});
const double CNAV_TOP1_LSB = 300.0;
const std::vector<std::pair<int, int> > CNAV_URA({{66, 5}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_URA({{66, 5}});
const std::vector<std::pair<int, int> > CNAV_TOE1({{71, 11}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_TOE1({{71, 11}});
const double CNAV_TOE1_LSB = 300.0;
const std::vector<std::pair<int, int> > CNAV_DELTA_A({{82, 26}}); //Relative to AREF = 26,559,710 meters
const std::vector<std::pair<int32_t, int32_t> > 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 std::vector<std::pair<int32_t, int32_t> > 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 * PI; //semi-circles to radians
const std::vector<std::pair<int, int> > CNAV_DELTA_N0_DOT({{150, 23}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_DELTA_N0({{133, 17}});
const double CNAV_DELTA_N0_LSB = TWO_N44 * PI; // semi-circles to radians
const std::vector<std::pair<int32_t, int32_t> > CNAV_DELTA_N0_DOT({{150, 23}});
const double CNAV_DELTA_N0_DOT_LSB = TWO_N57 * PI; //semi-circles to radians
const std::vector<std::pair<int, int> > CNAV_M0({{173, 33}});
const double CNAV_M0_LSB = TWO_N32 * PI; //semi-circles to radians
const std::vector<std::pair<int, int> > CNAV_E_ECCENTRICITY({{206, 33}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_M0({{173, 33}});
const double CNAV_M0_LSB = TWO_N32 * PI; // semi-circles to radians
const std::vector<std::pair<int32_t, int32_t> > 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 * PI; //semi-circles to radians
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}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_OMEGA({{239, 33}});
const double CNAV_OMEGA_LSB = TWO_N32 * PI; // semi-circles to radians
const std::vector<std::pair<int32_t, int32_t> > CNAV_INTEGRITY_FLAG({{272, 1}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_L2_PHASING_FLAG({{273, 1}});
// MESSAGE TYPE 11 (Ephemeris 2)
const std::vector<std::pair<int, int> > CNAV_TOE2({{39, 11}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_TOE2({{39, 11}});
const double CNAV_TOE2_LSB = 300.0;
const std::vector<std::pair<int, int> > CNAV_OMEGA0({{50, 33}});
const double CNAV_OMEGA0_LSB = TWO_N32 * PI; //semi-circles to radians
const std::vector<std::pair<int, int> > CNAV_I0({{83, 33}});
const double CNAV_I0_LSB = TWO_N32 * PI; //semi-circles to radians
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 * PI; //semi-circles to radians
const std::vector<std::pair<int, int> > CNAV_I0_DOT({{133, 15}});
const double CNAV_I0_DOT_LSB = TWO_N44 * PI; //semi-circles to radians
const std::vector<std::pair<int, int> > CNAV_CIS({{148, 16}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_OMEGA0({{50, 33}});
const double CNAV_OMEGA0_LSB = TWO_N32 * PI; // semi-circles to radians
const std::vector<std::pair<int32_t, int32_t> > CNAV_I0({{83, 33}});
const double CNAV_I0_LSB = TWO_N32 * PI; // semi-circles to radians
const std::vector<std::pair<int32_t, int32_t> > 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 * PI; // semi-circles to radians
const std::vector<std::pair<int32_t, int32_t> > CNAV_I0_DOT({{133, 15}});
const double CNAV_I0_DOT_LSB = TWO_N44 * PI; // semi-circles to radians
const std::vector<std::pair<int32_t, int32_t> > CNAV_CIS({{148, 16}});
const double CNAV_CIS_LSB = TWO_N30;
const std::vector<std::pair<int, int> > CNAV_CIC({{164, 16}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_CIC({{164, 16}});
const double CNAV_CIC_LSB = TWO_N30;
const std::vector<std::pair<int, int> > CNAV_CRS({{180, 24}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_CRS({{180, 24}});
const double CNAV_CRS_LSB = TWO_N8;
const std::vector<std::pair<int, int> > CNAV_CRC({{204, 24}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_CRC({{204, 24}});
const double CNAV_CRC_LSB = TWO_N8;
const std::vector<std::pair<int, int> > CNAV_CUS({{228, 21}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_CUS({{228, 21}});
const double CNAV_CUS_LSB = TWO_N30;
const std::vector<std::pair<int, int> > CNAV_CUC({{249, 21}});
const std::vector<std::pair<int32_t, int32_t> > 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 std::vector<std::pair<int32_t, int32_t> > CNAV_TOP2({{39, 11}});
const double CNAV_TOP2_LSB = 300.0;
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 std::vector<std::pair<int32_t, int32_t> > CNAV_URA_NED0({{50, 5}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_URA_NED1({{55, 3}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_URA_NED2({{58, 3}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_TOC({{61, 11}});
const double CNAV_TOC_LSB = 300.0;
const std::vector<std::pair<int,int> > CNAV_AF0({{72,26}});
const std::vector<std::pair<int, int> > CNAV_AF0({{72, 26}});
const double CNAV_AF0_LSB = TWO_N35;
const std::vector<std::pair<int,int> > CNAV_AF1({{98,20}});
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 std::vector<std::pair<int, int> > CNAV_AF2({{118, 10}});
const double CNAV_AF2_LSB = TWO_N60;
const std::vector<std::pair<int,int> > CNAV_TGD({{128,13}});
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 std::vector<std::pair<int32_t, int32_t> > CNAV_ISCL1({{141, 13}});
const double CNAV_ISCL1_LSB = TWO_N35;
const std::vector<std::pair<int, int> > CNAV_ISCL2({{154, 13}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_ISCL2({{154, 13}});
const double CNAV_ISCL2_LSB = TWO_N35;
const std::vector<std::pair<int, int> > CNAV_ISCL5I({{167, 13}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_ISCL5I({{167, 13}});
const double CNAV_ISCL5I_LSB = TWO_N35;
const std::vector<std::pair<int, int> > CNAV_ISCL5Q({{180, 13}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_ISCL5Q({{180, 13}});
const double CNAV_ISCL5Q_LSB = TWO_N35;
//Ionospheric parameters
const std::vector<std::pair<int, int> > CNAV_ALPHA0({{193, 8}});
// Ionospheric parameters
const std::vector<std::pair<int32_t, int32_t> > CNAV_ALPHA0({{193, 8}});
const double CNAV_ALPHA0_LSB = TWO_N30;
const std::vector<std::pair<int, int> > CNAV_ALPHA1({{201, 8}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_ALPHA1({{201, 8}});
const double CNAV_ALPHA1_LSB = TWO_N27;
const std::vector<std::pair<int, int> > CNAV_ALPHA2({{209, 8}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_ALPHA2({{209, 8}});
const double CNAV_ALPHA2_LSB = TWO_N24;
const std::vector<std::pair<int, int> > CNAV_ALPHA3({{217, 8}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_ALPHA3({{217, 8}});
const double CNAV_ALPHA3_LSB = TWO_N24;
const std::vector<std::pair<int, int> > CNAV_BETA0({{225, 8}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_BETA0({{225, 8}});
const double CNAV_BETA0_LSB = TWO_P11;
const std::vector<std::pair<int, int> > CNAV_BETA1({{233, 8}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_BETA1({{233, 8}});
const double CNAV_BETA1_LSB = TWO_P14;
const std::vector<std::pair<int, int> > CNAV_BETA2({{241, 8}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_BETA2({{241, 8}});
const double CNAV_BETA2_LSB = TWO_P16;
const std::vector<std::pair<int, int> > CNAV_BETA3({{249, 8}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_BETA3({{249, 8}});
const double CNAV_BETA3_LSB = TWO_P16;
const std::vector<std::pair<int, int> > CNAV_WNOP({{257, 8}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_WNOP({{257, 8}});
// MESSAGE TYPE 33 (CLOCK and UTC)
const std::vector<std::pair<int, int> > CNAV_A0({{128, 16}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_A0({{128, 16}});
const double CNAV_A0_LSB = TWO_N35;
const std::vector<std::pair<int, int> > CNAV_A1({{144, 13}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_A1({{144, 13}});
const double CNAV_A1_LSB = TWO_N51;
const std::vector<std::pair<int, int> > CNAV_A2({{157, 7}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_A2({{157, 7}});
const double CNAV_A2_LSB = TWO_N68;
const std::vector<std::pair<int, int> > CNAV_DELTA_TLS({{164, 8}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_DELTA_TLS({{164, 8}});
const double CNAV_DELTA_TLS_LSB = 1;
const std::vector<std::pair<int, int> > CNAV_TOT({{172, 16}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_TOT({{172, 16}});
const double CNAV_TOT_LSB = TWO_P4;
const std::vector<std::pair<int, int> > CNAV_WN_OT({{188, 13}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_WN_OT({{188, 13}});
const double CNAV_WN_OT_LSB = 1;
const std::vector<std::pair<int, int> > CNAV_WN_LSF({{201, 13}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_WN_LSF({{201, 13}});
const double CNAV_WN_LSF_LSB = 1;
const std::vector<std::pair<int, int> > CNAV_DN({{214, 4}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_DN({{214, 4}});
const double CNAV_DN_LSB = 1;
const std::vector<std::pair<int, int> > CNAV_DELTA_TLSF({{218, 8}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_DELTA_TLSF({{218, 8}});
const double CNAV_DELTA_TLSF_LSB = 1;

View File

@ -34,6 +34,7 @@
#include "gnss_frequencies.h"
#include "MATH_CONSTANTS.h"
#include <cstdint>
#include <vector>
#include <utility> // std::pair
@ -53,7 +54,7 @@ const double GPS_L1_FREQ_HZ = FREQ1; //!< L1 [Hz]
const double GPS_L1_CA_CODE_RATE_HZ = 1.023e6; //!< GPS L1 C/A code rate [chips/s]
const double GPS_L1_CA_CODE_LENGTH_CHIPS = 1023.0; //!< GPS L1 C/A code length [chips]
const double GPS_L1_CA_CODE_PERIOD = 0.001; //!< GPS L1 C/A code period [seconds]
const unsigned int GPS_L1_CA_CODE_PERIOD_MS = 1; //!< GPS L1 C/A code period [ms]
const uint32_t GPS_L1_CA_CODE_PERIOD_MS = 1; //!< GPS L1 C/A code period [ms]
const double GPS_L1_CA_CHIP_PERIOD = 9.7752e-07; //!< GPS L1 C/A chip period [seconds]
/*!
@ -71,7 +72,7 @@ const double MAX_TOA_DELAY_MS = 20;
const double GPS_STARTOFFSET_ms = 60.0;
// OBSERVABLE HISTORY DEEP FOR INTERPOLATION
const int GPS_L1_CA_HISTORY_DEEP = 100;
const int32_t GPS_L1_CA_HISTORY_DEEP = 100;
// NAVIGATION MESSAGE DEMODULATION AND DECODING
@ -79,172 +80,172 @@ const int GPS_L1_CA_HISTORY_DEEP = 100;
{ \
1, 0, 0, 0, 1, 0, 1, 1 \
}
const int GPS_CA_PREAMBLE_LENGTH_BITS = 8;
const int GPS_CA_PREAMBLE_LENGTH_SYMBOLS = 160;
const int32_t GPS_CA_PREAMBLE_LENGTH_BITS = 8;
const int32_t GPS_CA_PREAMBLE_LENGTH_SYMBOLS = 160;
const double GPS_CA_PREAMBLE_DURATION_S = 0.160;
const int GPS_CA_PREAMBLE_DURATION_MS = 160;
const int GPS_CA_TELEMETRY_RATE_BITS_SECOND = 50; //!< NAV message bit rate [bits/s]
const int GPS_CA_TELEMETRY_SYMBOLS_PER_BIT = 20;
const int GPS_CA_TELEMETRY_RATE_SYMBOLS_SECOND = GPS_CA_TELEMETRY_RATE_BITS_SECOND * GPS_CA_TELEMETRY_SYMBOLS_PER_BIT; //!< NAV message bit rate [symbols/s]
const int GPS_WORD_LENGTH = 4; //!< CRC + GPS WORD (-2 -1 0 ... 29) Bits = 4 bytes
const int GPS_SUBFRAME_LENGTH = 40; //!< GPS_WORD_LENGTH x 10 = 40 bytes
const int GPS_SUBFRAME_BITS = 300; //!< Number of bits per subframe in the NAV message [bits]
const int GPS_SUBFRAME_SECONDS = 6; //!< Subframe duration [seconds]
const int GPS_SUBFRAME_MS = 6000; //!< Subframe duration [seconds]
const int GPS_WORD_BITS = 30; //!< Number of bits per word in the NAV message [bits]
const int32_t GPS_CA_PREAMBLE_DURATION_MS = 160;
const int32_t GPS_CA_TELEMETRY_RATE_BITS_SECOND = 50; //!< NAV message bit rate [bits/s]
const int32_t GPS_CA_TELEMETRY_SYMBOLS_PER_BIT = 20;
const int32_t GPS_CA_TELEMETRY_RATE_SYMBOLS_SECOND = GPS_CA_TELEMETRY_RATE_BITS_SECOND * GPS_CA_TELEMETRY_SYMBOLS_PER_BIT; //!< NAV message bit rate [symbols/s]
const int32_t GPS_WORD_LENGTH = 4; //!< CRC + GPS WORD (-2 -1 0 ... 29) Bits = 4 bytes
const int32_t GPS_SUBFRAME_LENGTH = 40; //!< GPS_WORD_LENGTH x 10 = 40 bytes
const int32_t GPS_SUBFRAME_BITS = 300; //!< Number of bits per subframe in the NAV message [bits]
const int32_t GPS_SUBFRAME_SECONDS = 6; //!< Subframe duration [seconds]
const int32_t GPS_SUBFRAME_MS = 6000; //!< Subframe duration [seconds]
const int32_t GPS_WORD_BITS = 30; //!< Number of bits per word in the NAV message [bits]
// GPS NAVIGATION MESSAGE STRUCTURE
// NAVIGATION MESSAGE FIELDS POSITIONS (from IS-GPS-200E Appendix II)
// SUBFRAME 1-5 (TLM and HOW)
const std::vector<std::pair<int, int>> TOW({{31, 17}});
const std::vector<std::pair<int, int>> INTEGRITY_STATUS_FLAG({{23, 1}});
const std::vector<std::pair<int, int>> ALERT_FLAG({{48, 1}});
const std::vector<std::pair<int, int>> ANTI_SPOOFING_FLAG({{49, 1}});
const std::vector<std::pair<int, int>> SUBFRAME_ID({{50, 3}});
const std::vector<std::pair<int32_t, int32_t>> TOW({{31, 17}});
const std::vector<std::pair<int32_t, int32_t>> INTEGRITY_STATUS_FLAG({{23, 1}});
const std::vector<std::pair<int32_t, int32_t>> ALERT_FLAG({{48, 1}});
const std::vector<std::pair<int32_t, int32_t>> ANTI_SPOOFING_FLAG({{49, 1}});
const std::vector<std::pair<int32_t, int32_t>> SUBFRAME_ID({{50, 3}});
// SUBFRAME 1
const std::vector<std::pair<int, int>> GPS_WEEK({{61, 10}});
const std::vector<std::pair<int, int>> CA_OR_P_ON_L2({{71, 2}}); //*
const std::vector<std::pair<int, int>> SV_ACCURACY({{73, 4}});
const std::vector<std::pair<int, int>> SV_HEALTH({{77, 6}});
const std::vector<std::pair<int, int>> L2_P_DATA_FLAG({{91, 1}});
const std::vector<std::pair<int, int>> T_GD({{197, 8}});
const std::vector<std::pair<int32_t, int32_t>> GPS_WEEK({{61, 10}});
const std::vector<std::pair<int32_t, int32_t>> CA_OR_P_ON_L2({{71, 2}}); //*
const std::vector<std::pair<int32_t, int32_t>> SV_ACCURACY({{73, 4}});
const std::vector<std::pair<int32_t, int32_t>> SV_HEALTH({{77, 6}});
const std::vector<std::pair<int32_t, int32_t>> L2_P_DATA_FLAG({{91, 1}});
const std::vector<std::pair<int32_t, int32_t>> T_GD({{197, 8}});
const double T_GD_LSB = TWO_N31;
const std::vector<std::pair<int, int>> IODC({{83, 2}, {211, 8}});
const std::vector<std::pair<int, int>> T_OC({{219, 16}});
const std::vector<std::pair<int32_t, int32_t>> IODC({{83, 2}, {211, 8}});
const std::vector<std::pair<int32_t, int32_t>> T_OC({{219, 16}});
const double T_OC_LSB = TWO_P4;
const std::vector<std::pair<int, int>> A_F2({{241, 8}});
const std::vector<std::pair<int32_t, int32_t>> A_F2({{241, 8}});
const double A_F2_LSB = TWO_N55;
const std::vector<std::pair<int, int>> A_F1({{249, 16}});
const std::vector<std::pair<int32_t, int32_t>> A_F1({{249, 16}});
const double A_F1_LSB = TWO_N43;
const std::vector<std::pair<int, int>> A_F0({{271, 22}});
const std::vector<std::pair<int32_t, int32_t>> A_F0({{271, 22}});
const double A_F0_LSB = TWO_N31;
// SUBFRAME 2
const std::vector<std::pair<int, int>> IODE_SF2({{61, 8}});
const std::vector<std::pair<int, int>> C_RS({{69, 16}});
const std::vector<std::pair<int32_t, int32_t>> IODE_SF2({{61, 8}});
const std::vector<std::pair<int32_t, int32_t>> C_RS({{69, 16}});
const double C_RS_LSB = TWO_N5;
const std::vector<std::pair<int, int>> DELTA_N({{91, 16}});
const std::vector<std::pair<int32_t, int32_t>> DELTA_N({{91, 16}});
const double DELTA_N_LSB = PI_TWO_N43;
const std::vector<std::pair<int, int>> M_0({{107, 8}, {121, 24}});
const std::vector<std::pair<int32_t, int32_t>> M_0({{107, 8}, {121, 24}});
const double M_0_LSB = PI_TWO_N31;
const std::vector<std::pair<int, int>> C_UC({{151, 16}});
const std::vector<std::pair<int32_t, int32_t>> C_UC({{151, 16}});
const double C_UC_LSB = TWO_N29;
const std::vector<std::pair<int, int>> E({{167, 8}, {181, 24}});
const std::vector<std::pair<int32_t, int32_t>> E({{167, 8}, {181, 24}});
const double E_LSB = TWO_N33;
const std::vector<std::pair<int, int>> C_US({{211, 16}});
const std::vector<std::pair<int32_t, int32_t>> C_US({{211, 16}});
const double C_US_LSB = TWO_N29;
const std::vector<std::pair<int, int>> SQRT_A({{227, 8}, {241, 24}});
const std::vector<std::pair<int32_t, int32_t>> SQRT_A({{227, 8}, {241, 24}});
const double SQRT_A_LSB = TWO_N19;
const std::vector<std::pair<int, int>> T_OE({{271, 16}});
const std::vector<std::pair<int32_t, int32_t>> T_OE({{271, 16}});
const double T_OE_LSB = TWO_P4;
const std::vector<std::pair<int, int>> FIT_INTERVAL_FLAG({{271, 1}});
const std::vector<std::pair<int, int>> AODO({{272, 5}});
const int AODO_LSB = 900;
const std::vector<std::pair<int32_t, int32_t>> FIT_INTERVAL_FLAG({{271, 1}});
const std::vector<std::pair<int32_t, int32_t>> AODO({{272, 5}});
const int32_t AODO_LSB = 900;
// SUBFRAME 3
const std::vector<std::pair<int, int>> C_IC({{61, 16}});
const std::vector<std::pair<int32_t, int32_t>> C_IC({{61, 16}});
const double C_IC_LSB = TWO_N29;
const std::vector<std::pair<int, int>> OMEGA_0({{77, 8}, {91, 24}});
const std::vector<std::pair<int32_t, int32_t>> OMEGA_0({{77, 8}, {91, 24}});
const double OMEGA_0_LSB = PI_TWO_N31;
const std::vector<std::pair<int, int>> C_IS({{121, 16}});
const std::vector<std::pair<int32_t, int32_t>> C_IS({{121, 16}});
const double C_IS_LSB = TWO_N29;
const std::vector<std::pair<int, int>> I_0({{137, 8}, {151, 24}});
const std::vector<std::pair<int32_t, int32_t>> I_0({{137, 8}, {151, 24}});
const double I_0_LSB = PI_TWO_N31;
const std::vector<std::pair<int, int>> C_RC({{181, 16}});
const std::vector<std::pair<int32_t, int32_t>> C_RC({{181, 16}});
const double C_RC_LSB = TWO_N5;
const std::vector<std::pair<int, int>> OMEGA({{197, 8}, {211, 24}});
const std::vector<std::pair<int32_t, int32_t>> OMEGA({{197, 8}, {211, 24}});
const double OMEGA_LSB = PI_TWO_N31;
const std::vector<std::pair<int, int>> OMEGA_DOT({{241, 24}});
const std::vector<std::pair<int32_t, int32_t>> OMEGA_DOT({{241, 24}});
const double OMEGA_DOT_LSB = PI_TWO_N43;
const std::vector<std::pair<int, int>> IODE_SF3({{271, 8}});
const std::vector<std::pair<int, int>> I_DOT({{279, 14}});
const std::vector<std::pair<int32_t, int32_t>> IODE_SF3({{271, 8}});
const std::vector<std::pair<int32_t, int32_t>> I_DOT({{279, 14}});
const double I_DOT_LSB = PI_TWO_N43;
// SUBFRAME 4-5
const std::vector<std::pair<int, int>> SV_DATA_ID({{61, 2}});
const std::vector<std::pair<int, int>> SV_PAGE({{63, 6}});
const std::vector<std::pair<int32_t, int32_t>> SV_DATA_ID({{61, 2}});
const std::vector<std::pair<int32_t, int32_t>> SV_PAGE({{63, 6}});
// SUBFRAME 4
//! \todo read all pages of subframe 4
// Page 18 - Ionospheric and UTC data
const std::vector<std::pair<int, int>> ALPHA_0({{69, 8}});
const std::vector<std::pair<int32_t, int32_t>> ALPHA_0({{69, 8}});
const double ALPHA_0_LSB = TWO_N30;
const std::vector<std::pair<int, int>> ALPHA_1({{77, 8}});
const std::vector<std::pair<int32_t, int32_t>> ALPHA_1({{77, 8}});
const double ALPHA_1_LSB = TWO_N27;
const std::vector<std::pair<int, int>> ALPHA_2({{91, 8}});
const std::vector<std::pair<int32_t, int32_t>> ALPHA_2({{91, 8}});
const double ALPHA_2_LSB = TWO_N24;
const std::vector<std::pair<int, int>> ALPHA_3({{99, 8}});
const std::vector<std::pair<int32_t, int32_t>> ALPHA_3({{99, 8}});
const double ALPHA_3_LSB = TWO_N24;
const std::vector<std::pair<int, int>> BETA_0({{107, 8}});
const std::vector<std::pair<int32_t, int32_t>> BETA_0({{107, 8}});
const double BETA_0_LSB = TWO_P11;
const std::vector<std::pair<int, int>> BETA_1({{121, 8}});
const std::vector<std::pair<int32_t, int32_t>> BETA_1({{121, 8}});
const double BETA_1_LSB = TWO_P14;
const std::vector<std::pair<int, int>> BETA_2({{129, 8}});
const std::vector<std::pair<int32_t, int32_t>> BETA_2({{129, 8}});
const double BETA_2_LSB = TWO_P16;
const std::vector<std::pair<int, int>> BETA_3({{137, 8}});
const std::vector<std::pair<int32_t, int32_t>> BETA_3({{137, 8}});
const double BETA_3_LSB = TWO_P16;
const std::vector<std::pair<int, int>> A_1({{151, 24}});
const std::vector<std::pair<int32_t, int32_t>> A_1({{151, 24}});
const double A_1_LSB = TWO_N50;
const std::vector<std::pair<int, int>> A_0({{181, 24}, {211, 8}});
const std::vector<std::pair<int32_t, int32_t>> A_0({{181, 24}, {211, 8}});
const double A_0_LSB = TWO_N30;
const std::vector<std::pair<int, int>> T_OT({{219, 8}});
const std::vector<std::pair<int32_t, int32_t>> T_OT({{219, 8}});
const double T_OT_LSB = TWO_P12;
const std::vector<std::pair<int, int>> WN_T({{227, 8}});
const std::vector<std::pair<int32_t, int32_t>> WN_T({{227, 8}});
const double WN_T_LSB = 1;
const std::vector<std::pair<int, int>> DELTAT_LS({{241, 8}});
const std::vector<std::pair<int32_t, int32_t>> DELTAT_LS({{241, 8}});
const double DELTAT_LS_LSB = 1;
const std::vector<std::pair<int, int>> WN_LSF({{249, 8}});
const std::vector<std::pair<int32_t, int32_t>> WN_LSF({{249, 8}});
const double WN_LSF_LSB = 1;
const std::vector<std::pair<int, int>> DN({{257, 8}});
const std::vector<std::pair<int32_t, int32_t>> DN({{257, 8}});
const double DN_LSB = 1;
const std::vector<std::pair<int, int>> DELTAT_LSF({{271, 8}});
const std::vector<std::pair<int32_t, int32_t>> DELTAT_LSF({{271, 8}});
const double DELTAT_LSF_LSB = 1;
// Page 25 - Antispoofing, SV config and SV health (PRN 25 -32)
const std::vector<std::pair<int, int>> HEALTH_SV25({{229, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV26({{241, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV27({{247, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV28({{253, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV29({{259, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV30({{271, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV31({{277, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV32({{283, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV25({{229, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV26({{241, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV27({{247, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV28({{253, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV29({{259, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV30({{271, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV31({{277, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV32({{283, 6}});
// SUBFRAME 5
//! \todo read all pages of subframe 5
// page 25 - Health (PRN 1 - 24)
const std::vector<std::pair<int, int>> T_OA({{69, 8}});
const std::vector<std::pair<int32_t, int32_t>> T_OA({{69, 8}});
const double T_OA_LSB = TWO_P12;
const std::vector<std::pair<int, int>> WN_A({{77, 8}});
const std::vector<std::pair<int, int>> HEALTH_SV1({{91, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV2({{97, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV3({{103, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV4({{109, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV5({{121, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV6({{127, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV7({{133, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV8({{139, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV9({{151, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV10({{157, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV11({{163, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV12({{169, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV13({{181, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV14({{187, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV15({{193, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV16({{199, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV17({{211, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV18({{217, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV19({{223, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV20({{229, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV21({{241, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV22({{247, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV23({{253, 6}});
const std::vector<std::pair<int, int>> HEALTH_SV24({{259, 6}});
const std::vector<std::pair<int32_t, int32_t>> WN_A({{77, 8}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV1({{91, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV2({{97, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV3({{103, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV4({{109, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV5({{121, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV6({{127, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV7({{133, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV8({{139, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV9({{151, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV10({{157, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV11({{163, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV12({{169, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV13({{181, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV14({{187, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV15({{193, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV16({{199, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV17({{211, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV18({{217, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV19({{223, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV20({{229, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV21({{241, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV22({{247, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV23({{253, 6}});
const std::vector<std::pair<int32_t, int32_t>> HEALTH_SV24({{259, 6}});
#endif /* GNSS_SDR_GPS_L1_CA_H_ */

View File

@ -50,19 +50,18 @@ const double GPS_L2_OMEGA_EARTH_DOT = 7.2921151467e-5; //!< Earth rotation rate
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
const double GPS_L2_FREQ_HZ = FREQ2; //!< L2 [Hz]
const double GPS_L2_M_CODE_RATE_HZ = 0.5115e6; //!< GPS L2 M code rate [chips/s]
const int GPS_L2_M_CODE_LENGTH_CHIPS = 10230; //!< GPS L2 M code length [chips]
const double GPS_L2_M_PERIOD = 0.02; //!< GPS L2 M code period [seconds]
const double GPS_L2_M_CODE_RATE_HZ = 0.5115e6; //!< GPS L2 M code rate [chips/s]
const int32_t GPS_L2_M_CODE_LENGTH_CHIPS = 10230; //!< GPS L2 M code length [chips]
const double GPS_L2_M_PERIOD = 0.02; //!< GPS L2 M code period [seconds]
const double GPS_L2_L_CODE_RATE_HZ = 0.5115e6; //!< GPS L2 L code rate [chips/s]
const int GPS_L2_L_CODE_LENGTH_CHIPS = 767250; //!< GPS L2 L code length [chips]
const double GPS_L2_L_PERIOD = 1.5; //!< GPS L2 L code period [seconds]
const double GPS_L2_L_CODE_RATE_HZ = 0.5115e6; //!< GPS L2 L code rate [chips/s]
const int32_t GPS_L2_L_CODE_LENGTH_CHIPS = 767250; //!< GPS L2 L code length [chips]
const double GPS_L2_L_PERIOD = 1.5; //!< GPS L2 L code period [seconds]
const int GPS_L2C_HISTORY_DEEP = 5;
const int32_t GPS_L2C_HISTORY_DEEP = 5;
const int32_t GPS_L2C_M_INIT_REG[115] =
{0742417664, 0756014035, 0002747144, 0066265724, // 1:4
@ -79,9 +78,9 @@ const int32_t GPS_L2C_M_INIT_REG[115] =
0047457275, 0266333164, 0713167356, 0060546335,
0355173035, 0617201036, 0157465571, 0767360553,
0023127030, 0431343777, 0747317317, 0045706125,
0002744276, 0060036467, 0217744147, 0603340174, //57:60
0326616775, 0063240065, 0111460621, //61:63
0604055104, 0157065232, 0013305707, 0603552017, //159:162
0002744276, 0060036467, 0217744147, 0603340174, // 57:60
0326616775, 0063240065, 0111460621, // 61:63
0604055104, 0157065232, 0013305707, 0603552017, // 159:162
0230461355, 0603653437, 0652346475, 0743107103,
0401521277, 0167335110, 0014013575, 0362051132,
0617753265, 0216363634, 0755561123, 0365304033,
@ -95,10 +94,10 @@ const int32_t GPS_L2C_M_INIT_REG[115] =
0706202440, 0705056276, 0020373522, 0746013617,
0132720621, 0434015513, 0566721727, 0140633660};
const int GPS_L2_CNAV_DATA_PAGE_BITS = 300; //!< GPS L2 CNAV page length, including preamble and CRC [bits]
const int GPS_L2_SYMBOLS_PER_BIT = 2;
const int GPS_L2_SAMPLES_PER_SYMBOL = 1;
const int GPS_L2_CNAV_DATA_PAGE_SYMBOLS = 600;
const int GPS_L2_CNAV_DATA_PAGE_DURATION_S = 12;
const int32_t GPS_L2_CNAV_DATA_PAGE_BITS = 300; //!< GPS L2 CNAV page length, including preamble and CRC [bits]
const int32_t GPS_L2_SYMBOLS_PER_BIT = 2;
const int32_t GPS_L2_SAMPLES_PER_SYMBOL = 1;
const int32_t GPS_L2_CNAV_DATA_PAGE_SYMBOLS = 600;
const int32_t GPS_L2_CNAV_DATA_PAGE_DURATION_S = 12;
#endif /* GNSS_SDR_GPS_L2C_H_ */

View File

@ -48,22 +48,21 @@ const double GPS_L5_OMEGA_EARTH_DOT = 7.2921151467e-5; //!< Earth rotation rate
const double GPS_L5_GM = 3.986005e14; //!< Universal gravitational constant times the mass of the Earth, [m^3/s^2]
const double GPS_L5_F = -4.442807633e-10; //!< Constant, [s/(m)^(1/2)]
// carrier and code frequencies
const double GPS_L5_FREQ_HZ = FREQ5; //!< L5 [Hz]
const double GPS_L5i_CODE_RATE_HZ = 10.23e6; //!< GPS L5i code rate [chips/s]
const int GPS_L5i_CODE_LENGTH_CHIPS = 10230; //!< GPS L5i code length [chips]
const double GPS_L5i_PERIOD = 0.001; //!< GPS L5 code period [seconds]
const int GPS_L5i_PERIOD_MS = 1; //!< GPS L5 code period [ms]
const double GPS_L5i_SYMBOL_PERIOD = 0.01; //!< GPS L5 symbol period [seconds]
const int GPS_L5i_SYMBOL_PERIOD_MS = 10; //!< GPS L5 symbol period [ms]
const double GPS_L5i_CODE_RATE_HZ = 10.23e6; //!< GPS L5i code rate [chips/s]
const int32_t GPS_L5i_CODE_LENGTH_CHIPS = 10230; //!< GPS L5i code length [chips]
const double GPS_L5i_PERIOD = 0.001; //!< GPS L5 code period [seconds]
const int32_t GPS_L5i_PERIOD_MS = 1; //!< GPS L5 code period [ms]
const double GPS_L5i_SYMBOL_PERIOD = 0.01; //!< GPS L5 symbol period [seconds]
const int32_t GPS_L5i_SYMBOL_PERIOD_MS = 10; //!< GPS L5 symbol period [ms]
const double GPS_L5q_CODE_RATE_HZ = 10.23e6; //!< GPS L5i code rate [chips/s]
const int GPS_L5q_CODE_LENGTH_CHIPS = 10230; //!< GPS L5i code length [chips]
const double GPS_L5q_PERIOD = 0.001; //!< GPS L5 code period [seconds]
const double GPS_L5q_CODE_RATE_HZ = 10.23e6; //!< GPS L5i code rate [chips/s]
const int32_t GPS_L5q_CODE_LENGTH_CHIPS = 10230; //!< GPS L5i code length [chips]
const double GPS_L5q_PERIOD = 0.001; //!< GPS L5 code period [seconds]
const int GPS_L5_HISTORY_DEEP = 5;
const int32_t GPS_L5_HISTORY_DEEP = 5;
const int32_t GPS_L5i_INIT_REG[210] =
{266, 365, 804, 1138,
@ -179,16 +178,16 @@ const int32_t GPS_L5q_INIT_REG[210] =
2765, 37, 1943, 7977,
2512, 4451, 4071};
const int GPS_L5_CNAV_DATA_PAGE_BITS = 300; //!< GPS L5 CNAV page length, including preamble and CRC [bits]
const int GPS_L5_SYMBOLS_PER_BIT = 2;
const int GPS_L5_SAMPLES_PER_SYMBOL = 10;
const int GPS_L5_CNAV_DATA_PAGE_SYMBOLS = 600;
const int GPS_L5_CNAV_DATA_PAGE_DURATION_S = 6;
const int GPS_L5i_NH_CODE_LENGTH = 10;
const int GPS_L5i_NH_CODE[10] = {0, 0, 0, 0, 1, 1, 0, 1, 0, 1};
const int32_t GPS_L5_CNAV_DATA_PAGE_BITS = 300; //!< GPS L5 CNAV page length, including preamble and CRC [bits]
const int32_t GPS_L5_SYMBOLS_PER_BIT = 2;
const int32_t GPS_L5_SAMPLES_PER_SYMBOL = 10;
const int32_t GPS_L5_CNAV_DATA_PAGE_SYMBOLS = 600;
const int32_t GPS_L5_CNAV_DATA_PAGE_DURATION_S = 6;
const int32_t GPS_L5i_NH_CODE_LENGTH = 10;
const int32_t GPS_L5i_NH_CODE[10] = {0, 0, 0, 0, 1, 1, 0, 1, 0, 1};
const std::string GPS_L5i_NH_CODE_STR = "0000110101";
const int GPS_L5q_NH_CODE_LENGTH = 20;
const int GPS_L5q_NH_CODE[20] = {0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0};
const int32_t GPS_L5q_NH_CODE_LENGTH = 20;
const int32_t GPS_L5q_NH_CODE[20] = {0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0};
const std::string GPS_L5q_NH_CODE_STR = "00000100110101001110";
#endif /* GNSS_SDR_GPS_L5_H_ */

View File

@ -35,6 +35,7 @@
#include "gnss_frequencies.h"
#include "MATH_CONSTANTS.h"
#include <cstdint>
#include <string>
#include <vector>
#include <utility> // std::pair
@ -53,19 +54,19 @@ const double GALILEO_F = -4.442807309e-10; //!< Constant, [s/(m)^(
const double Galileo_E1_FREQ_HZ = FREQ1; //!< Galileo E1 carrier frequency [Hz]
const double Galileo_E1_CODE_CHIP_RATE_HZ = 1.023e6; //!< Galileo E1 code rate [chips/s]
const double Galileo_E1_CODE_PERIOD = 0.004; //!< Galileo E1 code period [s]
const int Galileo_E1_CODE_PERIOD_MS = 4; //!< Galileo E1 code period [ms]
const int32_t Galileo_E1_CODE_PERIOD_MS = 4; //!< Galileo E1 code period [ms]
const double Galileo_E1_SUB_CARRIER_A_RATE_HZ = 1.023e6; //!< Galileo E1 sub-carrier 'a' rate [Hz]
const double Galileo_E1_SUB_CARRIER_B_RATE_HZ = 6.138e6; //!< Galileo E1 sub-carrier 'b' rate [Hz]
const double Galileo_E1_B_CODE_LENGTH_CHIPS = 4092.0; //!< Galileo E1-B code length [chips]
const double Galileo_E1_B_SYMBOL_RATE_BPS = 250.0; //!< Galileo E1-B symbol rate [bits/second]
const int Galileo_E1_C_SECONDARY_CODE_LENGTH = 25; //!< Galileo E1-C secondary code length [chips]
const int Galileo_E1_NUMBER_OF_CODES = 50;
const int32_t Galileo_E1_C_SECONDARY_CODE_LENGTH = 25; //!< Galileo E1-C secondary code length [chips]
const int32_t Galileo_E1_NUMBER_OF_CODES = 50;
const double GALILEO_STARTOFFSET_ms = 68.802; //[ms] Initial sign. travel time (this cannot go here)
// OBSERVABLE HISTORY DEEP FOR INTERPOLATION
const int GALILEO_E1_HISTORY_DEEP = 100;
const int32_t GALILEO_E1_HISTORY_DEEP = 100;
// Galileo INAV Telemetry structure
@ -74,230 +75,230 @@ const int GALILEO_E1_HISTORY_DEEP = 100;
0, 1, 0, 1, 1, 0, 0, 0, 0, 0 \
}
const int GALILEO_INAV_PREAMBLE_LENGTH_BITS = 10;
const int32_t GALILEO_INAV_PREAMBLE_LENGTH_BITS = 10;
const double GALILEO_INAV_PAGE_PART_WITH_PREABLE_SECONDS = 2.0 + GALILEO_INAV_PREAMBLE_LENGTH_BITS * Galileo_E1_CODE_PERIOD;
const int GALILEO_INAV_PREAMBLE_PERIOD_SYMBOLS = 250;
const int GALILEO_INAV_PAGE_PART_SYMBOLS = 250; //!< Each Galileo INAV pages are composed of two parts (even and odd) each of 250 symbols, including preamble. See Galileo ICD 4.3.2
const int GALILEO_INAV_PAGE_SYMBOLS = 500; //!< The complete Galileo INAV page length
const int GALILEO_INAV_PAGE_PART_SECONDS = 1; // a page part last 1 sec
const int GALILEO_INAV_PAGE_PART_MS = 1000; // a page part last 1 sec
const int GALILEO_INAV_PAGE_SECONDS = 2; // a full page last 2 sec
const int GALILEO_INAV_INTERLEAVER_ROWS = 8;
const int GALILEO_INAV_INTERLEAVER_COLS = 30;
const int GALILEO_TELEMETRY_RATE_BITS_SECOND = 250; //bps
const int GALILEO_PAGE_TYPE_BITS = 6;
const int GALILEO_DATA_JK_BITS = 128;
const int GALILEO_DATA_FRAME_BITS = 196;
const int GALILEO_DATA_FRAME_BYTES = 25;
const int32_t GALILEO_INAV_PREAMBLE_PERIOD_SYMBOLS = 250;
const int32_t GALILEO_INAV_PAGE_PART_SYMBOLS = 250; //!< Each Galileo INAV pages are composed of two parts (even and odd) each of 250 symbols, including preamble. See Galileo ICD 4.3.2
const int32_t GALILEO_INAV_PAGE_SYMBOLS = 500; //!< The complete Galileo INAV page length
const int32_t GALILEO_INAV_PAGE_PART_SECONDS = 1; // a page part last 1 sec
const int32_t GALILEO_INAV_PAGE_PART_MS = 1000; // a page part last 1 sec
const int32_t GALILEO_INAV_PAGE_SECONDS = 2; // a full page last 2 sec
const int32_t GALILEO_INAV_INTERLEAVER_ROWS = 8;
const int32_t GALILEO_INAV_INTERLEAVER_COLS = 30;
const int32_t GALILEO_TELEMETRY_RATE_BITS_SECOND = 250; //bps
const int32_t GALILEO_PAGE_TYPE_BITS = 6;
const int32_t GALILEO_DATA_JK_BITS = 128;
const int32_t GALILEO_DATA_FRAME_BITS = 196;
const int32_t GALILEO_DATA_FRAME_BYTES = 25;
const double GALILEO_E1_CODE_PERIOD = 0.004;
const int GALILEO_E1_CODE_PERIOD_MS = 4;
const int32_t GALILEO_E1_CODE_PERIOD_MS = 4;
const std::vector<std::pair<int, int>> type({{1, 6}});
const std::vector<std::pair<int, int>> PAGE_TYPE_bit({{1, 6}});
const std::vector<std::pair<int32_t, int32_t>> type({{1, 6}});
const std::vector<std::pair<int32_t, int32_t>> PAGE_TYPE_bit({{1, 6}});
;
/*Page 1 - Word type 1: Ephemeris (1/4)*/
const std::vector<std::pair<int, int>> IOD_nav_1_bit({{7, 10}});
const std::vector<std::pair<int, int>> T0E_1_bit({{17, 14}});
const std::vector<std::pair<int32_t, int32_t>> IOD_nav_1_bit({{7, 10}});
const std::vector<std::pair<int32_t, int32_t>> T0E_1_bit({{17, 14}});
const double t0e_1_LSB = 60;
const std::vector<std::pair<int, int>> M0_1_bit({{31, 32}});
const std::vector<std::pair<int32_t, int32_t>> M0_1_bit({{31, 32}});
const double M0_1_LSB = PI_TWO_N31;
const std::vector<std::pair<int, int>> e_1_bit({{63, 32}});
const std::vector<std::pair<int32_t, int32_t>> e_1_bit({{63, 32}});
const double e_1_LSB = TWO_N33;
const std::vector<std::pair<int, int>> A_1_bit({{95, 32}});
const std::vector<std::pair<int32_t, int32_t>> A_1_bit({{95, 32}});
const double A_1_LSB_gal = TWO_N19;
//last two bits are reserved
/*Page 2 - Word type 2: Ephemeris (2/4)*/
const std::vector<std::pair<int, int>> IOD_nav_2_bit({{7, 10}});
const std::vector<std::pair<int, int>> OMEGA_0_2_bit({{17, 32}});
const std::vector<std::pair<int32_t, int32_t>> IOD_nav_2_bit({{7, 10}});
const std::vector<std::pair<int32_t, int32_t>> OMEGA_0_2_bit({{17, 32}});
const double OMEGA_0_2_LSB = PI_TWO_N31;
const std::vector<std::pair<int, int>> i_0_2_bit({{49, 32}});
const std::vector<std::pair<int32_t, int32_t>> i_0_2_bit({{49, 32}});
const double i_0_2_LSB = PI_TWO_N31;
const std::vector<std::pair<int, int>> omega_2_bit({{81, 32}});
const std::vector<std::pair<int32_t, int32_t>> omega_2_bit({{81, 32}});
const double omega_2_LSB = PI_TWO_N31;
const std::vector<std::pair<int, int>> iDot_2_bit({{113, 14}});
const std::vector<std::pair<int32_t, int32_t>> iDot_2_bit({{113, 14}});
const double iDot_2_LSB = PI_TWO_N43;
//last two bits are reserved
/*Word type 3: Ephemeris (3/4) and SISA*/
const std::vector<std::pair<int, int>> IOD_nav_3_bit({{7, 10}});
const std::vector<std::pair<int, int>> OMEGA_dot_3_bit({{17, 24}});
const std::vector<std::pair<int32_t, int32_t>> IOD_nav_3_bit({{7, 10}});
const std::vector<std::pair<int32_t, int32_t>> OMEGA_dot_3_bit({{17, 24}});
const double OMEGA_dot_3_LSB = PI_TWO_N43;
const std::vector<std::pair<int, int>> delta_n_3_bit({{41, 16}});
const std::vector<std::pair<int32_t, int32_t>> delta_n_3_bit({{41, 16}});
const double delta_n_3_LSB = PI_TWO_N43;
const std::vector<std::pair<int, int>> C_uc_3_bit({{57, 16}});
const std::vector<std::pair<int32_t, int32_t>> C_uc_3_bit({{57, 16}});
const double C_uc_3_LSB = TWO_N29;
const std::vector<std::pair<int, int>> C_us_3_bit({{73, 16}});
const std::vector<std::pair<int32_t, int32_t>> C_us_3_bit({{73, 16}});
const double C_us_3_LSB = TWO_N29;
const std::vector<std::pair<int, int>> C_rc_3_bit({{89, 16}});
const std::vector<std::pair<int32_t, int32_t>> C_rc_3_bit({{89, 16}});
const double C_rc_3_LSB = TWO_N5;
const std::vector<std::pair<int, int>> C_rs_3_bit({{105, 16}});
const std::vector<std::pair<int32_t, int32_t>> C_rs_3_bit({{105, 16}});
const double C_rs_3_LSB = TWO_N5;
const std::vector<std::pair<int, int>> SISA_3_bit({{121, 8}});
const std::vector<std::pair<int32_t, int32_t>> SISA_3_bit({{121, 8}});
/*Word type 4: Ephemeris (4/4) and Clock correction parameters*/
const std::vector<std::pair<int, int>> IOD_nav_4_bit({{7, 10}});
const std::vector<std::pair<int, int>> SV_ID_PRN_4_bit({{17, 6}});
const std::vector<std::pair<int, int>> C_ic_4_bit({{23, 16}});
const std::vector<std::pair<int32_t, int32_t>> IOD_nav_4_bit({{7, 10}});
const std::vector<std::pair<int32_t, int32_t>> SV_ID_PRN_4_bit({{17, 6}});
const std::vector<std::pair<int32_t, int32_t>> C_ic_4_bit({{23, 16}});
const double C_ic_4_LSB = TWO_N29;
const std::vector<std::pair<int, int>> C_is_4_bit({{39, 16}});
const std::vector<std::pair<int32_t, int32_t>> C_is_4_bit({{39, 16}});
const double C_is_4_LSB = TWO_N29;
const std::vector<std::pair<int, int>> t0c_4_bit({{55, 14}}); //
const std::vector<std::pair<int32_t, int32_t>> t0c_4_bit({{55, 14}}); //
const double t0c_4_LSB = 60;
const std::vector<std::pair<int, int>> af0_4_bit({{69, 31}}); //
const std::vector<std::pair<int32_t, int32_t>> af0_4_bit({{69, 31}}); //
const double af0_4_LSB = TWO_N34;
const std::vector<std::pair<int, int>> af1_4_bit({{100, 21}}); //
const std::vector<std::pair<int32_t, int32_t>> af1_4_bit({{100, 21}}); //
const double af1_4_LSB = TWO_N46;
const std::vector<std::pair<int, int>> af2_4_bit({{121, 6}});
const std::vector<std::pair<int32_t, int32_t>> af2_4_bit({{121, 6}});
const double af2_4_LSB = TWO_N59;
const std::vector<std::pair<int, int>> spare_4_bit({{127, 2}});
const std::vector<std::pair<int32_t, int32_t>> spare_4_bit({{127, 2}});
//last two bits are reserved
/*Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST*/
/*Ionospheric correction*/
/*Az*/
const std::vector<std::pair<int, int>> ai0_5_bit({{7, 11}}); //
const std::vector<std::pair<int32_t, int32_t>> ai0_5_bit({{7, 11}}); //
const double ai0_5_LSB = TWO_N2;
const std::vector<std::pair<int, int>> ai1_5_bit({{18, 11}}); //
const std::vector<std::pair<int32_t, int32_t>> ai1_5_bit({{18, 11}}); //
const double ai1_5_LSB = TWO_N8;
const std::vector<std::pair<int, int>> ai2_5_bit({{29, 14}}); //
const std::vector<std::pair<int32_t, int32_t>> ai2_5_bit({{29, 14}}); //
const double ai2_5_LSB = TWO_N15;
/*Ionospheric disturbance flag*/
const std::vector<std::pair<int, int>> Region1_5_bit({{43, 1}}); //
const std::vector<std::pair<int, int>> Region2_5_bit({{44, 1}}); //
const std::vector<std::pair<int, int>> Region3_5_bit({{45, 1}}); //
const std::vector<std::pair<int, int>> Region4_5_bit({{46, 1}}); //
const std::vector<std::pair<int, int>> Region5_5_bit({{47, 1}}); //
const std::vector<std::pair<int, int>> BGD_E1E5a_5_bit({{48, 10}}); //
const std::vector<std::pair<int32_t, int32_t>> Region1_5_bit({{43, 1}}); //
const std::vector<std::pair<int32_t, int32_t>> Region2_5_bit({{44, 1}}); //
const std::vector<std::pair<int32_t, int32_t>> Region3_5_bit({{45, 1}}); //
const std::vector<std::pair<int32_t, int32_t>> Region4_5_bit({{46, 1}}); //
const std::vector<std::pair<int32_t, int32_t>> Region5_5_bit({{47, 1}}); //
const std::vector<std::pair<int32_t, int32_t>> BGD_E1E5a_5_bit({{48, 10}}); //
const double BGD_E1E5a_5_LSB = TWO_N32;
const std::vector<std::pair<int, int>> BGD_E1E5b_5_bit({{58, 10}}); //
const std::vector<std::pair<int32_t, int32_t>> BGD_E1E5b_5_bit({{58, 10}}); //
const double BGD_E1E5b_5_LSB = TWO_N32;
const std::vector<std::pair<int, int>> E5b_HS_5_bit({{68, 2}}); //
const std::vector<std::pair<int, int>> E1B_HS_5_bit({{70, 2}}); //
const std::vector<std::pair<int, int>> E5b_DVS_5_bit({{72, 1}}); //
const std::vector<std::pair<int, int>> E1B_DVS_5_bit({{73, 1}}); //
const std::vector<std::pair<int32_t, int32_t>> E5b_HS_5_bit({{68, 2}}); //
const std::vector<std::pair<int32_t, int32_t>> E1B_HS_5_bit({{70, 2}}); //
const std::vector<std::pair<int32_t, int32_t>> E5b_DVS_5_bit({{72, 1}}); //
const std::vector<std::pair<int32_t, int32_t>> E1B_DVS_5_bit({{73, 1}}); //
/*GST*/
const std::vector<std::pair<int, int>> WN_5_bit({{74, 12}});
const std::vector<std::pair<int, int>> TOW_5_bit({{86, 20}});
const std::vector<std::pair<int, int>> spare_5_bit({{106, 23}});
const std::vector<std::pair<int32_t, int32_t>> WN_5_bit({{74, 12}});
const std::vector<std::pair<int32_t, int32_t>> TOW_5_bit({{86, 20}});
const std::vector<std::pair<int32_t, int32_t>> spare_5_bit({{106, 23}});
/* Page 6 */
const std::vector<std::pair<int, int>> A0_6_bit({{7, 32}});
const std::vector<std::pair<int32_t, int32_t>> A0_6_bit({{7, 32}});
const double A0_6_LSB = TWO_N30;
const std::vector<std::pair<int, int>> A1_6_bit({{39, 24}});
const std::vector<std::pair<int32_t, int32_t>> A1_6_bit({{39, 24}});
const double A1_6_LSB = TWO_N50;
const std::vector<std::pair<int, int>> Delta_tLS_6_bit({{63, 8}});
const std::vector<std::pair<int, int>> t0t_6_bit({{71, 8}});
const std::vector<std::pair<int32_t, int32_t>> Delta_tLS_6_bit({{63, 8}});
const std::vector<std::pair<int32_t, int32_t>> t0t_6_bit({{71, 8}});
const double t0t_6_LSB = 3600;
const std::vector<std::pair<int, int>> WNot_6_bit({{79, 8}});
const std::vector<std::pair<int, int>> WN_LSF_6_bit({{87, 8}});
const std::vector<std::pair<int, int>> DN_6_bit({{95, 3}});
const std::vector<std::pair<int, int>> Delta_tLSF_6_bit({{98, 8}});
const std::vector<std::pair<int, int>> TOW_6_bit({{106, 20}});
const std::vector<std::pair<int32_t, int32_t>> WNot_6_bit({{79, 8}});
const std::vector<std::pair<int32_t, int32_t>> WN_LSF_6_bit({{87, 8}});
const std::vector<std::pair<int32_t, int32_t>> DN_6_bit({{95, 3}});
const std::vector<std::pair<int32_t, int32_t>> Delta_tLSF_6_bit({{98, 8}});
const std::vector<std::pair<int32_t, int32_t>> TOW_6_bit({{106, 20}});
/* Page 7 */
const std::vector<std::pair<int, int>> IOD_a_7_bit({{7, 4}});
const std::vector<std::pair<int, int>> WN_a_7_bit({{11, 2}});
const std::vector<std::pair<int, int>> t0a_7_bit({{13, 10}});
const std::vector<std::pair<int32_t, int32_t>> IOD_a_7_bit({{7, 4}});
const std::vector<std::pair<int32_t, int32_t>> WN_a_7_bit({{11, 2}});
const std::vector<std::pair<int32_t, int32_t>> t0a_7_bit({{13, 10}});
const double t0a_7_LSB = 600;
const std::vector<std::pair<int, int>> SVID1_7_bit({{23, 6}});
const std::vector<std::pair<int, int>> DELTA_A_7_bit({{29, 13}});
const std::vector<std::pair<int32_t, int32_t>> SVID1_7_bit({{23, 6}});
const std::vector<std::pair<int32_t, int32_t>> DELTA_A_7_bit({{29, 13}});
const double DELTA_A_7_LSB = TWO_N9;
const std::vector<std::pair<int, int>> e_7_bit({{42, 11}});
const std::vector<std::pair<int32_t, int32_t>> e_7_bit({{42, 11}});
const double e_7_LSB = TWO_N16;
const std::vector<std::pair<int, int>> omega_7_bit({{53, 16}});
const std::vector<std::pair<int32_t, int32_t>> omega_7_bit({{53, 16}});
const double omega_7_LSB = TWO_N15;
const std::vector<std::pair<int, int>> delta_i_7_bit({{69, 11}});
const std::vector<std::pair<int32_t, int32_t>> delta_i_7_bit({{69, 11}});
const double delta_i_7_LSB = TWO_N14;
const std::vector<std::pair<int, int>> Omega0_7_bit({{80, 16}});
const std::vector<std::pair<int32_t, int32_t>> Omega0_7_bit({{80, 16}});
const double Omega0_7_LSB = TWO_N15;
const std::vector<std::pair<int, int>> Omega_dot_7_bit({{96, 11}});
const std::vector<std::pair<int32_t, int32_t>> Omega_dot_7_bit({{96, 11}});
const double Omega_dot_7_LSB = TWO_N33;
const std::vector<std::pair<int, int>> M0_7_bit({{107, 16}});
const std::vector<std::pair<int32_t, int32_t>> M0_7_bit({{107, 16}});
const double M0_7_LSB = TWO_N15;
/* Page 8 */
const std::vector<std::pair<int, int>> IOD_a_8_bit({{7, 4}});
const std::vector<std::pair<int, int>> af0_8_bit({{11, 16}});
const std::vector<std::pair<int32_t, int32_t>> IOD_a_8_bit({{7, 4}});
const std::vector<std::pair<int32_t, int32_t>> af0_8_bit({{11, 16}});
const double af0_8_LSB = TWO_N19;
const std::vector<std::pair<int, int>> af1_8_bit({{27, 13}});
const std::vector<std::pair<int32_t, int32_t>> af1_8_bit({{27, 13}});
const double af1_8_LSB = TWO_N38;
const std::vector<std::pair<int, int>> E5b_HS_8_bit({{40, 2}});
const std::vector<std::pair<int, int>> E1B_HS_8_bit({{42, 2}});
const std::vector<std::pair<int, int>> SVID2_8_bit({{44, 6}});
const std::vector<std::pair<int, int>> DELTA_A_8_bit({{50, 13}});
const std::vector<std::pair<int32_t, int32_t>> E5b_HS_8_bit({{40, 2}});
const std::vector<std::pair<int32_t, int32_t>> E1B_HS_8_bit({{42, 2}});
const std::vector<std::pair<int32_t, int32_t>> SVID2_8_bit({{44, 6}});
const std::vector<std::pair<int32_t, int32_t>> DELTA_A_8_bit({{50, 13}});
const double DELTA_A_8_LSB = TWO_N9;
const std::vector<std::pair<int, int>> e_8_bit({{63, 11}});
const std::vector<std::pair<int32_t, int32_t>> e_8_bit({{63, 11}});
const double e_8_LSB = TWO_N16;
const std::vector<std::pair<int, int>> omega_8_bit({{74, 16}});
const std::vector<std::pair<int32_t, int32_t>> omega_8_bit({{74, 16}});
const double omega_8_LSB = TWO_N15;
const std::vector<std::pair<int, int>> delta_i_8_bit({{90, 11}});
const std::vector<std::pair<int32_t, int32_t>> delta_i_8_bit({{90, 11}});
const double delta_i_8_LSB = TWO_N14;
const std::vector<std::pair<int, int>> Omega0_8_bit({{101, 16}});
const std::vector<std::pair<int32_t, int32_t>> Omega0_8_bit({{101, 16}});
const double Omega0_8_LSB = TWO_N15;
const std::vector<std::pair<int, int>> Omega_dot_8_bit({{117, 11}});
const std::vector<std::pair<int32_t, int32_t>> Omega_dot_8_bit({{117, 11}});
const double Omega_dot_8_LSB = TWO_N33;
/* Page 9 */
const std::vector<std::pair<int, int>> IOD_a_9_bit({{7, 4}});
const std::vector<std::pair<int, int>> WN_a_9_bit({{11, 2}});
const std::vector<std::pair<int, int>> t0a_9_bit({{13, 10}});
const std::vector<std::pair<int32_t, int32_t>> IOD_a_9_bit({{7, 4}});
const std::vector<std::pair<int32_t, int32_t>> WN_a_9_bit({{11, 2}});
const std::vector<std::pair<int32_t, int32_t>> t0a_9_bit({{13, 10}});
const double t0a_9_LSB = 600;
const std::vector<std::pair<int, int>> M0_9_bit({{23, 16}});
const std::vector<std::pair<int32_t, int32_t>> M0_9_bit({{23, 16}});
const double M0_9_LSB = TWO_N15;
const std::vector<std::pair<int, int>> af0_9_bit({{39, 16}});
const std::vector<std::pair<int32_t, int32_t>> af0_9_bit({{39, 16}});
const double af0_9_LSB = TWO_N19;
const std::vector<std::pair<int, int>> af1_9_bit({{55, 13}});
const std::vector<std::pair<int32_t, int32_t>> af1_9_bit({{55, 13}});
const double af1_9_LSB = TWO_N38;
const std::vector<std::pair<int, int>> E5b_HS_9_bit({{68, 2}});
const std::vector<std::pair<int, int>> E1B_HS_9_bit({{70, 2}});
const std::vector<std::pair<int, int>> SVID3_9_bit({{72, 6}});
const std::vector<std::pair<int, int>> DELTA_A_9_bit({{78, 13}});
const std::vector<std::pair<int32_t, int32_t>> E5b_HS_9_bit({{68, 2}});
const std::vector<std::pair<int32_t, int32_t>> E1B_HS_9_bit({{70, 2}});
const std::vector<std::pair<int32_t, int32_t>> SVID3_9_bit({{72, 6}});
const std::vector<std::pair<int32_t, int32_t>> DELTA_A_9_bit({{78, 13}});
const double DELTA_A_9_LSB = TWO_N9;
const std::vector<std::pair<int, int>> e_9_bit({{91, 11}});
const std::vector<std::pair<int32_t, int32_t>> e_9_bit({{91, 11}});
const double e_9_LSB = TWO_N16;
const std::vector<std::pair<int, int>> omega_9_bit({{102, 16}});
const std::vector<std::pair<int32_t, int32_t>> omega_9_bit({{102, 16}});
const double omega_9_LSB = TWO_N15;
const std::vector<std::pair<int, int>> delta_i_9_bit({{118, 11}});
const std::vector<std::pair<int32_t, int32_t>> delta_i_9_bit({{118, 11}});
const double delta_i_9_LSB = TWO_N14;
/* Page 10 */
const std::vector<std::pair<int, int>> IOD_a_10_bit({{7, 4}});
const std::vector<std::pair<int, int>> Omega0_10_bit({{11, 16}});
const std::vector<std::pair<int32_t, int32_t>> IOD_a_10_bit({{7, 4}});
const std::vector<std::pair<int32_t, int32_t>> Omega0_10_bit({{11, 16}});
const double Omega0_10_LSB = TWO_N15;
const std::vector<std::pair<int, int>> Omega_dot_10_bit({{27, 11}});
const std::vector<std::pair<int32_t, int32_t>> Omega_dot_10_bit({{27, 11}});
const double Omega_dot_10_LSB = TWO_N33;
const std::vector<std::pair<int, int>> M0_10_bit({{38, 16}});
const std::vector<std::pair<int32_t, int32_t>> M0_10_bit({{38, 16}});
const double M0_10_LSB = TWO_N15;
const std::vector<std::pair<int, int>> af0_10_bit({{54, 16}});
const std::vector<std::pair<int32_t, int32_t>> af0_10_bit({{54, 16}});
const double af0_10_LSB = TWO_N19;
const std::vector<std::pair<int, int>> af1_10_bit({{70, 13}});
const std::vector<std::pair<int32_t, int32_t>> af1_10_bit({{70, 13}});
const double af1_10_LSB = TWO_N38;
const std::vector<std::pair<int, int>> E5b_HS_10_bit({{83, 2}});
const std::vector<std::pair<int, int>> E1B_HS_10_bit({{85, 2}});
const std::vector<std::pair<int, int>> A_0G_10_bit({{87, 16}});
const std::vector<std::pair<int32_t, int32_t>> E5b_HS_10_bit({{83, 2}});
const std::vector<std::pair<int32_t, int32_t>> E1B_HS_10_bit({{85, 2}});
const std::vector<std::pair<int32_t, int32_t>> A_0G_10_bit({{87, 16}});
const double A_0G_10_LSB = TWO_N35;
const std::vector<std::pair<int, int>> A_1G_10_bit({{103, 12}});
const std::vector<std::pair<int32_t, int32_t>> A_1G_10_bit({{103, 12}});
const double A_1G_10_LSB = TWO_N51;
const std::vector<std::pair<int, int>> t_0G_10_bit({{115, 8}});
const std::vector<std::pair<int32_t, int32_t>> t_0G_10_bit({{115, 8}});
const double t_0G_10_LSB = 3600;
const std::vector<std::pair<int, int>> WN_0G_10_bit({{123, 6}});
const std::vector<std::pair<int32_t, int32_t>> WN_0G_10_bit({{123, 6}});
/* Page 0 */
const std::vector<std::pair<int, int>> Time_0_bit({{7, 2}});
const std::vector<std::pair<int, int>> WN_0_bit({{97, 12}});
const std::vector<std::pair<int, int>> TOW_0_bit({{109, 20}});
const std::vector<std::pair<int32_t, int32_t>> Time_0_bit({{7, 2}});
const std::vector<std::pair<int32_t, int32_t>> WN_0_bit({{97, 12}});
const std::vector<std::pair<int32_t, int32_t>> TOW_0_bit({{109, 20}});
// Galileo E1 primary codes

View File

@ -33,193 +33,194 @@
#include "gnss_frequencies.h"
#include "MATH_CONSTANTS.h"
#include <cstdint>
#include <string>
#include <vector>
#include <utility> // std::pair
// Carrier and code frequencies
const double Galileo_E5a_FREQ_HZ = FREQ5; //!< Galileo E5a carrier frequency [Hz]
const double Galileo_E5a_CODE_CHIP_RATE_HZ = 1.023e7; //!< Galileo E5a code rate [chips/s]
const double Galileo_E5a_I_TIERED_CODE_PERIOD = 0.020; //!< Galileo E5a-I tiered code period [s]
const double Galileo_E5a_Q_TIERED_CODE_PERIOD = 0.100; //!< Galileo E5a-Q tiered code period [s]
const int Galileo_E5a_CODE_LENGTH_CHIPS = 10230; //!< Galileo E5a primary code length [chips]
const int Galileo_E5a_I_SECONDARY_CODE_LENGTH = 20; //!< Galileo E5a-I secondary code length [chips]
const int Galileo_E5a_Q_SECONDARY_CODE_LENGTH = 100; //!< Galileo E5a-Q secondary code length [chips]
const double GALILEO_E5a_CODE_PERIOD = 0.001; //!< Galileo E1 primary code period [s]
const int GALILEO_E5a_CODE_PERIOD_MS = 1; //!< Galileo E1 primary code period [ms]
const int Galileo_E5a_SYMBOL_RATE_BPS = 50; //!< Galileo E5a symbol rate [bits/second]
const int Galileo_E5a_NUMBER_OF_CODES = 50;
const double Galileo_E5a_FREQ_HZ = FREQ5; //!< Galileo E5a carrier frequency [Hz]
const double Galileo_E5a_CODE_CHIP_RATE_HZ = 1.023e7; //!< Galileo E5a code rate [chips/s]
const double Galileo_E5a_I_TIERED_CODE_PERIOD = 0.020; //!< Galileo E5a-I tiered code period [s]
const double Galileo_E5a_Q_TIERED_CODE_PERIOD = 0.100; //!< Galileo E5a-Q tiered code period [s]
const int32_t Galileo_E5a_CODE_LENGTH_CHIPS = 10230; //!< Galileo E5a primary code length [chips]
const int32_t Galileo_E5a_I_SECONDARY_CODE_LENGTH = 20; //!< Galileo E5a-I secondary code length [chips]
const int32_t Galileo_E5a_Q_SECONDARY_CODE_LENGTH = 100; //!< Galileo E5a-Q secondary code length [chips]
const double GALILEO_E5a_CODE_PERIOD = 0.001; //!< Galileo E1 primary code period [s]
const int32_t GALILEO_E5a_CODE_PERIOD_MS = 1; //!< Galileo E1 primary code period [ms]
const int32_t Galileo_E5a_SYMBOL_RATE_BPS = 50; //!< Galileo E5a symbol rate [bits/second]
const int32_t Galileo_E5a_NUMBER_OF_CODES = 50;
// OBSERVABLE HISTORY DEEP FOR INTERPOLATION AND CRC ERROR LIMIT
const int GALILEO_E5A_HISTORY_DEEP = 20;
const int GALILEO_E5A_CRC_ERROR_LIMIT = 6;
const int32_t GALILEO_E5A_HISTORY_DEEP = 20;
const int32_t GALILEO_E5A_CRC_ERROR_LIMIT = 6;
// F/NAV message structure
const int GALILEO_FNAV_PREAMBLE_LENGTH_BITS = 12;
const int32_t GALILEO_FNAV_PREAMBLE_LENGTH_BITS = 12;
const std::string GALILEO_FNAV_PREAMBLE = {"101101110000"};
const int GALILEO_FNAV_CODES_PER_SYMBOL = 20; // (chip rate/ code length)/telemetry bps
const int GALILEO_FNAV_CODES_PER_PREAMBLE = 240; // bits preamble * codes/symbol
const int GALILEO_FNAV_SYMBOLS_PER_PAGE = 500; //Total symbols per page including preamble. See Galileo ICD 4.2.2
const int GALILEO_FNAV_SECONDS_PER_PAGE = 10;
const int GALILEO_FNAV_CODES_PER_PAGE = 10000; // symbols * codes/symbol, where code stands for primary code
const int32_t GALILEO_FNAV_CODES_PER_SYMBOL = 20; // (chip rate/ code length)/telemetry bps
const int32_t GALILEO_FNAV_CODES_PER_PREAMBLE = 240; // bits preamble * codes/symbol
const int32_t GALILEO_FNAV_SYMBOLS_PER_PAGE = 500; // Total symbols per page including preamble. See Galileo ICD 4.2.2
const int32_t GALILEO_FNAV_SECONDS_PER_PAGE = 10;
const int32_t GALILEO_FNAV_CODES_PER_PAGE = 10000; // symbols * codes/symbol, where code stands for primary code
const int GALILEO_FNAV_INTERLEAVER_ROWS = 8;
const int GALILEO_FNAV_INTERLEAVER_COLS = 61;
const int GALILEO_FNAV_PAGE_TYPE_BITS = 6;
const int32_t GALILEO_FNAV_INTERLEAVER_ROWS = 8;
const int32_t GALILEO_FNAV_INTERLEAVER_COLS = 61;
const int32_t GALILEO_FNAV_PAGE_TYPE_BITS = 6;
const int GALILEO_FNAV_DATA_FRAME_BITS = 214;
const int GALILEO_FNAV_DATA_FRAME_BYTES = 27;
const int32_t GALILEO_FNAV_DATA_FRAME_BITS = 214;
const int32_t GALILEO_FNAV_DATA_FRAME_BYTES = 27;
const std::vector<std::pair<int, int>> FNAV_PAGE_TYPE_bit({{1, 6}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_PAGE_TYPE_bit({{1, 6}});
/* WORD 1 iono corrections. FNAV (Galileo E5a message)*/
const std::vector<std::pair<int, int>> FNAV_SV_ID_PRN_1_bit({{7, 6}});
const std::vector<std::pair<int, int>> FNAV_IODnav_1_bit({{13, 10}});
const std::vector<std::pair<int, int>> FNAV_t0c_1_bit({{23, 14}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_SV_ID_PRN_1_bit({{7, 6}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_IODnav_1_bit({{13, 10}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_t0c_1_bit({{23, 14}});
const double FNAV_t0c_1_LSB = 60;
const std::vector<std::pair<int, int>> FNAV_af0_1_bit({{37, 31}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_af0_1_bit({{37, 31}});
const double FNAV_af0_1_LSB = TWO_N34;
const std::vector<std::pair<int, int>> FNAV_af1_1_bit({{68, 21}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_af1_1_bit({{68, 21}});
const double FNAV_af1_1_LSB = TWO_N46;
const std::vector<std::pair<int, int>> FNAV_af2_1_bit({{89, 6}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_af2_1_bit({{89, 6}});
const double FNAV_af2_1_LSB = TWO_N59;
const std::vector<std::pair<int, int>> FNAV_SISA_1_bit({{95, 8}});
const std::vector<std::pair<int, int>> FNAV_ai0_1_bit({{103, 11}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_SISA_1_bit({{95, 8}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_ai0_1_bit({{103, 11}});
const double FNAV_ai0_1_LSB = TWO_N2;
const std::vector<std::pair<int, int>> FNAV_ai1_1_bit({{114, 11}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_ai1_1_bit({{114, 11}});
const double FNAV_ai1_1_LSB = TWO_N8;
const std::vector<std::pair<int, int>> FNAV_ai2_1_bit({{125, 14}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_ai2_1_bit({{125, 14}});
const double FNAV_ai2_1_LSB = TWO_N15;
const std::vector<std::pair<int, int>> FNAV_region1_1_bit({{139, 1}});
const std::vector<std::pair<int, int>> FNAV_region2_1_bit({{140, 1}});
const std::vector<std::pair<int, int>> FNAV_region3_1_bit({{141, 1}});
const std::vector<std::pair<int, int>> FNAV_region4_1_bit({{142, 1}});
const std::vector<std::pair<int, int>> FNAV_region5_1_bit({{143, 1}});
const std::vector<std::pair<int, int>> FNAV_BGD_1_bit({{144, 10}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_region1_1_bit({{139, 1}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_region2_1_bit({{140, 1}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_region3_1_bit({{141, 1}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_region4_1_bit({{142, 1}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_region5_1_bit({{143, 1}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_BGD_1_bit({{144, 10}});
const double FNAV_BGD_1_LSB = TWO_N32;
const std::vector<std::pair<int, int>> FNAV_E5ahs_1_bit({{154, 2}});
const std::vector<std::pair<int, int>> FNAV_WN_1_bit({{156, 12}});
const std::vector<std::pair<int, int>> FNAV_TOW_1_bit({{168, 20}});
const std::vector<std::pair<int, int>> FNAV_E5advs_1_bit({{188, 1}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_E5ahs_1_bit({{154, 2}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_WN_1_bit({{156, 12}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_TOW_1_bit({{168, 20}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_E5advs_1_bit({{188, 1}});
// WORD 2 Ephemeris (1/3)
const std::vector<std::pair<int, int>> FNAV_IODnav_2_bit({{7, 10}});
const std::vector<std::pair<int, int>> FNAV_M0_2_bit({{17, 32}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_IODnav_2_bit({{7, 10}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_M0_2_bit({{17, 32}});
const double FNAV_M0_2_LSB = PI_TWO_N31;
const std::vector<std::pair<int, int>> FNAV_omegadot_2_bit({{49, 24}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_omegadot_2_bit({{49, 24}});
const double FNAV_omegadot_2_LSB = PI_TWO_N43;
const std::vector<std::pair<int, int>> FNAV_e_2_bit({{73, 32}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_e_2_bit({{73, 32}});
const double FNAV_e_2_LSB = TWO_N33;
const std::vector<std::pair<int, int>> FNAV_a12_2_bit({{105, 32}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_a12_2_bit({{105, 32}});
const double FNAV_a12_2_LSB = TWO_N19;
const std::vector<std::pair<int, int>> FNAV_omega0_2_bit({{137, 32}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_omega0_2_bit({{137, 32}});
const double FNAV_omega0_2_LSB = PI_TWO_N31;
const std::vector<std::pair<int, int>> FNAV_idot_2_bit({{169, 14}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_idot_2_bit({{169, 14}});
const double FNAV_idot_2_LSB = PI_TWO_N43;
const std::vector<std::pair<int, int>> FNAV_WN_2_bit({{183, 12}});
const std::vector<std::pair<int, int>> FNAV_TOW_2_bit({{195, 20}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_WN_2_bit({{183, 12}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_TOW_2_bit({{195, 20}});
// WORD 3 Ephemeris (2/3)
const std::vector<std::pair<int, int>> FNAV_IODnav_3_bit({{7, 10}});
const std::vector<std::pair<int, int>> FNAV_i0_3_bit({{17, 32}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_IODnav_3_bit({{7, 10}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_i0_3_bit({{17, 32}});
const double FNAV_i0_3_LSB = PI_TWO_N31;
const std::vector<std::pair<int, int>> FNAV_w_3_bit({{49, 32}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_w_3_bit({{49, 32}});
const double FNAV_w_3_LSB = PI_TWO_N31;
const std::vector<std::pair<int, int>> FNAV_deltan_3_bit({{81, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_deltan_3_bit({{81, 16}});
const double FNAV_deltan_3_LSB = PI_TWO_N43;
const std::vector<std::pair<int, int>> FNAV_Cuc_3_bit({{97, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_Cuc_3_bit({{97, 16}});
const double FNAV_Cuc_3_LSB = TWO_N29;
const std::vector<std::pair<int, int>> FNAV_Cus_3_bit({{113, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_Cus_3_bit({{113, 16}});
const double FNAV_Cus_3_LSB = TWO_N29;
const std::vector<std::pair<int, int>> FNAV_Crc_3_bit({{129, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_Crc_3_bit({{129, 16}});
const double FNAV_Crc_3_LSB = TWO_N5;
const std::vector<std::pair<int, int>> FNAV_Crs_3_bit({{145, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_Crs_3_bit({{145, 16}});
const double FNAV_Crs_3_LSB = TWO_N5;
const std::vector<std::pair<int, int>> FNAV_t0e_3_bit({{161, 14}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_t0e_3_bit({{161, 14}});
const double FNAV_t0e_3_LSB = 60;
const std::vector<std::pair<int, int>> FNAV_WN_3_bit({{175, 12}});
const std::vector<std::pair<int, int>> FNAV_TOW_3_bit({{187, 20}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_WN_3_bit({{175, 12}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_TOW_3_bit({{187, 20}});
// WORD 4 Ephemeris (3/3)
const std::vector<std::pair<int, int>> FNAV_IODnav_4_bit({{7, 10}});
const std::vector<std::pair<int, int>> FNAV_Cic_4_bit({{17, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_IODnav_4_bit({{7, 10}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_Cic_4_bit({{17, 16}});
const double FNAV_Cic_4_LSB = TWO_N29;
const std::vector<std::pair<int, int>> FNAV_Cis_4_bit({{33, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_Cis_4_bit({{33, 16}});
const double FNAV_Cis_4_LSB = TWO_N29;
const std::vector<std::pair<int, int>> FNAV_A0_4_bit({{49, 32}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_A0_4_bit({{49, 32}});
const double FNAV_A0_4_LSB = TWO_N30;
const std::vector<std::pair<int, int>> FNAV_A1_4_bit({{81, 24}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_A1_4_bit({{81, 24}});
const double FNAV_A1_4_LSB = TWO_N50;
const std::vector<std::pair<int, int>> FNAV_deltatls_4_bit({{105, 8}});
const std::vector<std::pair<int, int>> FNAV_t0t_4_bit({{113, 8}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_deltatls_4_bit({{105, 8}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_t0t_4_bit({{113, 8}});
const double FNAV_t0t_4_LSB = 3600;
const std::vector<std::pair<int, int>> FNAV_WNot_4_bit({{121, 8}});
const std::vector<std::pair<int, int>> FNAV_WNlsf_4_bit({{129, 8}});
const std::vector<std::pair<int, int>> FNAV_DN_4_bit({{137, 3}});
const std::vector<std::pair<int, int>> FNAV_deltatlsf_4_bit({{140, 8}});
const std::vector<std::pair<int, int>> FNAV_t0g_4_bit({{148, 8}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_WNot_4_bit({{121, 8}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_WNlsf_4_bit({{129, 8}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_DN_4_bit({{137, 3}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_deltatlsf_4_bit({{140, 8}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_t0g_4_bit({{148, 8}});
const double FNAV_t0g_4_LSB = 3600;
const std::vector<std::pair<int, int>> FNAV_A0g_4_bit({{156, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_A0g_4_bit({{156, 16}});
const double FNAV_A0g_4_LSB = TWO_N35;
const std::vector<std::pair<int, int>> FNAV_A1g_4_bit({{172, 12}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_A1g_4_bit({{172, 12}});
const double FNAV_A1g_4_LSB = TWO_N51;
const std::vector<std::pair<int, int>> FNAV_WN0g_4_bit({{184, 6}});
const std::vector<std::pair<int, int>> FNAV_TOW_4_bit({{190, 20}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_WN0g_4_bit({{184, 6}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_TOW_4_bit({{190, 20}});
// WORD 5 Almanac SVID1 SVID2(1/2)
const std::vector<std::pair<int, int>> FNAV_IODa_5_bit({{7, 4}});
const std::vector<std::pair<int, int>> FNAV_WNa_5_bit({{11, 2}});
const std::vector<std::pair<int, int>> FNAV_t0a_5_bit({{13, 10}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_IODa_5_bit({{7, 4}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_WNa_5_bit({{11, 2}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_t0a_5_bit({{13, 10}});
const double FNAV_t0a_5_LSB = 600;
const std::vector<std::pair<int, int>> FNAV_SVID1_5_bit({{23, 6}});
const std::vector<std::pair<int, int>> FNAV_Deltaa12_1_5_bit({{29, 13}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_SVID1_5_bit({{23, 6}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_Deltaa12_1_5_bit({{29, 13}});
const double FNAV_Deltaa12_5_LSB = TWO_N9;
const std::vector<std::pair<int, int>> FNAV_e_1_5_bit({{42, 11}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_e_1_5_bit({{42, 11}});
const double FNAV_e_5_LSB = TWO_N16;
const std::vector<std::pair<int, int>> FNAV_w_1_5_bit({{53, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_w_1_5_bit({{53, 16}});
const double FNAV_w_5_LSB = TWO_N15;
const std::vector<std::pair<int, int>> FNAV_deltai_1_5_bit({{69, 11}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_deltai_1_5_bit({{69, 11}});
const double FNAV_deltai_5_LSB = TWO_N14;
const std::vector<std::pair<int, int>> FNAV_Omega0_1_5_bit({{80, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_Omega0_1_5_bit({{80, 16}});
const double FNAV_Omega0_5_LSB = TWO_N15;
const std::vector<std::pair<int, int>> FNAV_Omegadot_1_5_bit({{96, 11}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_Omegadot_1_5_bit({{96, 11}});
const double FNAV_Omegadot_5_LSB = TWO_N33;
const std::vector<std::pair<int, int>> FNAV_M0_1_5_bit({{107, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_M0_1_5_bit({{107, 16}});
const double FNAV_M0_5_LSB = TWO_N15;
const std::vector<std::pair<int, int>> FNAV_af0_1_5_bit({{123, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_af0_1_5_bit({{123, 16}});
const double FNAV_af0_5_LSB = TWO_N19;
const std::vector<std::pair<int, int>> FNAV_af1_1_5_bit({{139, 13}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_af1_1_5_bit({{139, 13}});
const double FNAV_af1_5_LSB = TWO_N38;
const std::vector<std::pair<int, int>> FNAV_E5ahs_1_5_bit({{152, 2}});
const std::vector<std::pair<int, int>> FNAV_SVID2_5_bit({{154, 6}});
const std::vector<std::pair<int, int>> FNAV_Deltaa12_2_5_bit({{160, 13}});
const std::vector<std::pair<int, int>> FNAV_e_2_5_bit({{173, 11}});
const std::vector<std::pair<int, int>> FNAV_w_2_5_bit({{184, 16}});
const std::vector<std::pair<int, int>> FNAV_deltai_2_5_bit({{200, 11}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_E5ahs_1_5_bit({{152, 2}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_SVID2_5_bit({{154, 6}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_Deltaa12_2_5_bit({{160, 13}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_e_2_5_bit({{173, 11}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_w_2_5_bit({{184, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_deltai_2_5_bit({{200, 11}});
//const std::vector<std::pair<int,int>> FNAV_Omega012_2_5_bit({{210,4}});
// WORD 6 Almanac SVID2(1/2) SVID3
const std::vector<std::pair<int, int>> FNAV_IODa_6_bit({{7, 4}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_IODa_6_bit({{7, 4}});
//const std::vector<std::pair<int,int>> FNAV_Omega022_2_6_bit({{10,12}});
const std::vector<std::pair<int, int>> FNAV_Omegadot_2_6_bit({{23, 11}});
const std::vector<std::pair<int, int>> FNAV_M0_2_6_bit({{34, 16}});
const std::vector<std::pair<int, int>> FNAV_af0_2_6_bit({{50, 16}});
const std::vector<std::pair<int, int>> FNAV_af1_2_6_bit({{66, 13}});
const std::vector<std::pair<int, int>> FNAV_E5ahs_2_6_bit({{79, 2}});
const std::vector<std::pair<int, int>> FNAV_SVID3_6_bit({{81, 6}});
const std::vector<std::pair<int, int>> FNAV_Deltaa12_3_6_bit({{87, 13}});
const std::vector<std::pair<int, int>> FNAV_e_3_6_bit({{100, 11}});
const std::vector<std::pair<int, int>> FNAV_w_3_6_bit({{111, 16}});
const std::vector<std::pair<int, int>> FNAV_deltai_3_6_bit({{127, 11}});
const std::vector<std::pair<int, int>> FNAV_Omega0_3_6_bit({{138, 16}});
const std::vector<std::pair<int, int>> FNAV_Omegadot_3_6_bit({{154, 11}});
const std::vector<std::pair<int, int>> FNAV_M0_3_6_bit({{165, 16}});
const std::vector<std::pair<int, int>> FNAV_af0_3_6_bit({{181, 16}});
const std::vector<std::pair<int, int>> FNAV_af1_3_6_bit({{197, 13}});
const std::vector<std::pair<int, int>> FNAV_E5ahs_3_6_bit({{210, 2}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_Omegadot_2_6_bit({{23, 11}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_M0_2_6_bit({{34, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_af0_2_6_bit({{50, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_af1_2_6_bit({{66, 13}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_E5ahs_2_6_bit({{79, 2}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_SVID3_6_bit({{81, 6}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_Deltaa12_3_6_bit({{87, 13}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_e_3_6_bit({{100, 11}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_w_3_6_bit({{111, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_deltai_3_6_bit({{127, 11}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_Omega0_3_6_bit({{138, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_Omegadot_3_6_bit({{154, 11}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_M0_3_6_bit({{165, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_af0_3_6_bit({{181, 16}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_af1_3_6_bit({{197, 13}});
const std::vector<std::pair<int32_t, int32_t>> FNAV_E5ahs_3_6_bit({{210, 2}});
// Galileo E5a-I primary codes
const std::string Galileo_E5a_I_PRIMARY_CODE[Galileo_E5a_NUMBER_OF_CODES] = {
@ -274,6 +275,7 @@ const std::string Galileo_E5a_I_PRIMARY_CODE[Galileo_E5a_NUMBER_OF_CODES] = {
"84D5B404488AFCC35CFC6EF1CF7A848EE5EE527B7D2D2081EBD8FA8432414FCCB271A43FD618EF95CAF1CEF445B50F02AFDC6B41D5C1F1FF4B6B8F2AB94F90F259383F44246B2D400C3012FD76E2980827C9B5476C4651293CBE9FAA77EFC53E369B94F51BE480EEAA389D88AE421E75EC67C76E30A6FA7EF02500372E4C9AB875EBA1C357C003938B979859B0A914D58F21B3BF1BE8C33A1AF079C5A0A4EA532F93A10F6D96D0A63F3C99E6F06CBC072CC5D71A517FFF40BC260A26E3A46688E79E733E1E2F0010846937689E2998BC769186E0B977AE0A1689245D255AE7D5F34715AD526E824838B62546D9569009A191BA5192535E23142236F4035C90D1405C8530A57B402118FDED2A5DA4B40635D2F95AC7CEAA370686F0AB23AB31DED369BEFB066909B76F2C04039E49FF0CFD323628D03C26F0BD4054C127F21355C33B49F86895D5354C3BBD2C0D38ECD169289F7D8403AA1753B393AC06C887F98315324DBD78F9BFD1AD8880D41D4EA98956EC89BBDAD08F7CFEBF26988EB5AB01D4E49AA8273CAB6AFDFA1CC1C95EDF85284E6570332A0B8242FBA495D87A01A945E61CD36E865CD4F430F04A3B3EE74CE0486B5676F7A938B18E1DB2DAE2FE1C04B3D56892C7394D0B07C5A2F7698D196711DC83FFF6ABDD4E8131E1106EBA23245FB0E2A696E440FB6B0B1CB4DD22C9720AC76F09863711647A7E369FDE5D6911A5FCF987470B8C06C4EF7063B08A8320B4371866789147E9D7C5D477A662A501627F91E95C6E2CB6814651E9DFACD67CA0B1FE62F44081E3BDDB964C1E5ADDC093AD185F0203B4C0F7E3E96811F14C79BC54F2919FCE5B653F6845CF1AC34DA9E4CF52EBA626B739246E25204F9EF2CCF4F5ADBFC53CD8F629FDB82186CB52BEB7136F105D3CFF9CCCC2610BF2C8F943DF5BD03877ED7AFA25CA81C4063E1B97452A937FCF77F1AA068FE2A26F6ECDF662ACDF18391AF7D627C2AA07CF5597B5F33AA0ED4DAC98AA73C8321EBF6918EE568ADEB1A823527AD75CD5BF7ED3EB5633A4EDC8C59DB0A91DA79C248D6894CAF9CB411F302635BEEF1A1C7916C7545B8BE7C577692245E285D32B4FD18E1478F88F8373E22A5CEC6D22EACAD2A41612F05AB2C54A1C03C0512359B0F9C5F91615EF2EA80DE97230480F489FEDA38D52FC84E2F1258CB20FF0E850639B31C2958BA6C064D0D0F4AAEFF313E43C65EFFFBB47CF09F2A122D15F76E8B704DA8F2B8C71449AA49774EBB7B2DC97CF6004D2FF6D37B9C689261189B85CFD50C20C961F22A644F51497377426556B956DB8C899045B175A8B9CB22EFDE535CF487E9D958281E0467539853054FC3475D2E142D58F9201C1DC6B2C1A12B2878F9366E2216405069B7D03852AB37EE83112EF2EE172F4E5317A41653A656A06F6633AF59062A47263A9977A50B9115456A58F9C3424FE7E0CC57DA70FEE0411C1479B4CC2E6E720B01432CFB3C503983B37FFBE38C92E50D6C5795443F73244F6D28AE6270E27D46A25621F86A2BC4259DE6C04CCAA657FE656C640833B290F00A1660329A3F09FFE60152A23925F4D8B0933AC016B5802CA863F66F8CEB5C8383B1180A515AE6C51B5F56597C3A004F8D25F8A6235C97B4DE38468B63E3B859A487AFC4320598EB6D143E5C914409D25F6DFF6E957D575C71D3ECBC6743CCCC03E5F34791744637A994F3ADF86966B4FE911C06F7BA1A6C20A2971D82B64E49721A530D9D5A2319D5BE0F47B8119C5A835CABEC735A935E23CB439970437C6F4CCDE2525EF0D7B1555CBE70280D5E760",
"A5029C9EB4623226D321FF78D3C4EAB1F672A8B2B24A09CAEF21F561A851323C05A3C5E136A2DA7104ED19FBFFCAC3FC49B6D598F3060E93552EA6C700B837F7CE04721919B9C96A57B42AA1D832307C7A847091848066CB84947BE5F6B54654479E39F654819D3EF7AF4939FB9F4C9B20CA7F83DA0FDA2F171FDB72455B7ED0D43206992520CDD86B29C48BCC687573AAC4217D0B7DCF852811ADC3ECADDB2B34B4572675CCAEFDAAA01F83561E6E240878F229698185A80E6FECEE89455A72A377C24CE3FECAEC2A34B9CA98D288596D1C769CDEAB06871316CA7D1DDC5862E6282DECE33F362C64A73E57AB266715068932ECC31E62AD2ECFF7C6FBFE213384DA086ADF49E30F432EE2C715D9AC4DEF53A7B09B0D722CAC560FE8CF0059B80428458282F7E81717647D72E321A3E4BEF16FAEF76009BD98B8D9822B771EB62F1D0748E462FB7F3BEE9B12AA86D9629085AEDF8E43E1252EE59970CFF66A6F865C7651EF83F8FE10EB0E2615BF8F5C7F12FC601B0CF795C0D8B7057F54408BEFF86747C0F6F23EF212A9086EADD464A25341AB71FBA4ADED8F599C38FC15E790A5B86E64977C5AC718DD0B47C1A476AC9D7369396144F6288E84F7FFBDE02EC00EEAE8ED415C84648364ECBEC42164514D3E26BFD3187E0641C216FFC57E00DD752CDA581686916221DCD1AF07582391C5FBEF047FD1B7B956B458DE925C02A756FE197233E0304D0E034FF9A176B5B3F5FB683AB41D2691E13F97B3F4EB33238851331197C49C60233232DA0E2610430461876FF6F77FF3CCAF1BB2424B8B347588667B48480476D40BD9E487468CD5AFEB597C750A5E665B4E7C4C169ED08ADFC731FEA928052C4FB85B3064EC07B0CB988E324893B3F084291D964403F0350B7E1B06DFB73362C38318B762A972972BFB76CC5C08B5D47DBA0F3A2473D7749DE9F49F50C4C1620A9EE9FE56296124D72906497411DB87D4D8EC4E1F79BEF27232008A2299F5317FC1A6F455F1B827F1712BC01814F0B9D0CC162B25B804278B9C7BC5FC5616B317F2050234A7AF92FE35A59E22C959C7163DFA5F142022BE5CC4D5EF16D218216C57C2E29DA926436C00DCB82E68E16CA5A07158D8B8864D38A765D14E82175114A28CD97D11D564C8C7B87411589A4FBD49F9900D08939B7A73B5E6466B6F607F8AD22120A559A02BFCEF6456E7AECE8C9B7C9D2B322D2197124C05363B2CBFA58B74CD88877F22A5E5C202FC2C33531125F1518F4F0F38FA788E5E6B3307A75EC73E545391CEA200243DD6D25A5B8654A00B82BA57437BF0ACCB0ED37ED2FED221E54EC12B93AFA6E3939223596075F4C47340355D7222A8234A1F65EDDA42FFF5D19F7FACBF09AA77E7962F4CFBF61A0F26FB18E31A504B371714048874BEB286AFF71B43E4739A17E8AC25FA77121ABBE6E99754AF42F1D0021EA1E3FF088D0734BB191F91A520C96E22B4A28F9A2BD7DF81E8079EE5D0DDCBD517046F12098FAF6920E0EBA10DE8CFB391C63C60D62C1F4BB26BF8B6E421A830575731F67D306CEB5D6FF04637144790EC4AA2F435906320114CB81EB40C22B271FBB065474687AA5880F1DBAAA1744AB3E9B831A932A9208BEA9F5D526C52F5FDA56320E123CFB553E2B71A595DDED2ECBBD6E890B0421D765D2E9FD0D3995DF2A9523A65FE2040710DF16F2A83F510DCA08493DC138541E5681B51EE87D84C9AC11612EB5C06F5A63E22BD6275E35216766D79B215DBD087E9CADA0CEB09BFE435DF9B7809A76DE323B373682B8C58CB4F08D9C708EB050DEC",
};
// Galileo E5a-Q primary codes
const std::string Galileo_E5a_Q_PRIMARY_CODE[Galileo_E5a_NUMBER_OF_CODES] = {
"515537AD5E5F4216C16046FB0AC50DCDBE5CEE7E3CBB51B6ABB4E87A407B90E0EFD49DE1DE5ED29184E7FF0DC31F75FBB94F46FF6586B36C7771E5A68D060A965ACCF8D640C6B6E4530FDF19DD2491BCAB69ACBCFD3EC7281CCC31253A471B652E21C4CB0B43613EC542266460F0A6199B436BEFD95572DEBEE920A915FD854D17FFD0DF8C74E23B21B28493A0927709709B07C65878C43B69DC501E9D0AA21061ECF173876CAE708C764435832D9D6FCFE62DDF2543016D6325A56D9BF1007886E62E8A832BC32063CB0717D723C5E8C5F0C0EB3960577D364C93060B64EE04A539B7601CC3113E0AEC53CF21AFAD0154DC5CCECF038474E0F4004A65B1EE2801F81968B88C3D35E87CBB126C02D770CC3D32A552883D351DEF47847391484F80646728221F993921BFC14126EE3D9527DE607152724C6D2DD305D3FEA0AAAEDF6509A2FE3248494A54FDA8E3CE7E6BBCE234E4686BA5A19724BA2CB78CFE71A6AF45532EFB286C5BB47BC3C1EEF4E4A8C757786AE974F30A86CD60EBCBFDF5502AA8F643819CBA4301E731ADBA1345B61C0B444FE7B817EA86F8DD749C451AE7D24A68D914F26C918238953E8AE61CC8553213DD6856C7863F9F6BAB1B4C84B225911E7B92BFFC12AC211B2B2CD905877FE976E07057963D47C437FE47D89648053F81AC39E8FD2F3A726866F6693E503CB6F0C3F0AA9B3EE2EA3BCDB16D726E1C6D8B073AA15F64EB68D53B1F8CDAC19C7AC33361226E81F1C793BF188755A3FE1BAC38B91ABBD4F077F7A28983EAFADC346CB941D49492625893453B364D07FE06FE42B160C16FE0462AB6366FFDEE54DC9CE4DCCA21E4E4AE5E92C872D1E4EC6FF6D3063C98A5AA5EE72481A0BDF15152E2A5425AB722101474D0E1EC8401273EA1BE1DAF7403190A94305BD1C7DFBE1F35F65D5CB97E82B7A297047507FFA0012FB73360FB8719C174E78A989A96E60A9184B3F3A8188DE100AB361921D38E8142859C8F0F7D441DB1B2E9687BBD1086643987C83DEE0BE8CED4C83BCC82B62B45311CE4F13ABC55BF5EB1ECDF15F5A07F8B2C42F07FACE0E299E87727E2D534FEBF7B9C3894CC3E2E4127A294B9FA2A671273B174DBB81D247CD2846116500A072DC3962C65FFECD0C0B46DC2AF52882058259C26FDE50BEB319AEECFA1FABA34C069680B9EBAA9D96EEBD7EA30E748213E1283396A2AFC63527624641D4E1F1022A973B1898BD4CEF4D712B49371A51D60E08F42ED1EA90AC49EEFBCC53E7F9E899DD1AA4056F11462DF1A4C81620A73C831CEB897430A22252B901EC3D6F3DF58EF26422F796EA31AA4E0E9CE5B4A9C312A22305E298FEB3B3628283D405EDF726937327D90C542434BA3B60684584A9DB244839D2ACBCD7EF147A541E35687B5B8F5F07764973112D20D1ED75DC31F6A938542B42EFAAEE0F11B0583AA4925C3132356200E8D6BDB3127B975F4115A7A8A1C471836E3C5450B501A24D4A1308BB319AA827222B550F253F64B6F7D2322C6A2D3012FEC265A66A60102A3340CBDAB900DFDB36693D41DAD8DDB8875F8C3BE76AD5355DD81D67AAEBFFFE9458E522BE0312E60F63DD92F25C0D7CF82F223AEC0BD7456752CBD5151FEB5368F8857EAFAA90E8C7499B75D46EC4CA20BA8A24C90C016B5BD2CD7864828C6140E98EDB9509AD1194F56D49675D077DE92CD481B469E3A37F7DF0D5392DA4CE4CB282530F1C73482CC0926B877B00B0CE49FAD21E4C26194C7E950E0078F3854EF88755E08E9380165C584A3DBF1ECEF6A31B224FC321326B93797BFE8",
@ -327,8 +329,10 @@ const std::string Galileo_E5a_Q_PRIMARY_CODE[Galileo_E5a_NUMBER_OF_CODES] = {
"71BB1B2E833793D854F8A9A81E6A6947057B9571F2BA99380DDB25D878D6B48F09ED7DBFACE92B6B82F413E038128F6128AF3BC467E9A4DF2861DAAC674B6D948A10F28F7D43657FEE26577AF438A2F4422186930702EBC6C9173E661D59CE7594DF95B861F9D12EB060FCD3BA43159C9A1BDC1EF13E04893E411267331588CF4831978469FF569C1A738C54001BB5CF4FABD289075A165EDE0A58F6CF6D215D306A7840CBECD0E87E3AD186F7A67A967373551E13D2956E5C578A7F5BD50E2D570F9B914848D46A640913EBED2E2ABFB86916BC34EEB3E8A671AD771F6D3780B6FEC143E26F53B02977255314BAE9A2CD9E5BA2B49C73226FDC724A859F8BAD3A9FACA1B0E5F2DFE7E1E45DB6D4BE2B76535A817F94594A4541C01BB62AA83A690B6D84FC13B632972C61D940F2C9D32837413AF8E42045ECA3072CD044B2183400CE63C418879D13FD281A8D0835256DDD2BC3C9750C1D44CF1037FD7264B7716398FCF1D31CFFD0B7C52C6370E4CE6FC163B40436490A757465B20B8890C3B5C0AFB971ABFD01796569E3BC73C13D1E4B1FBC1CDCE59D21B6B110272E5770C589603FE67779A49AD0EC66910A2BF4D8C8ECC18A32EF92F502126A5DC3DE618233B9914A9608B2F17E5161115D9A3BEF1D5701A9D465A1437DE24371C9179800CB5728A7F3D734A2A706BC64D356BDF591389970B6CC139AC510A98E3C75F20120450CE45373AAEA6A279BBD17221BCD32ECF82C11B4C1CEE0A44792CF56978D3D2399F7ECDE9F8D9217F8BA22770E210D0F1AA852178B872E296762873765A73DEC08873C04ED69C995C5751B97DEC23B94CA674FE3F66211317B074D8203EC530A20B6E6DD21AB55895BEE1CBD0876183D652F4A0D2EFC95749F8F192F860BEA534598FD709B396C209CEAE4D9190980733E7E98C8ABE52A53C68D86053B56BA6FCAB5C827292D729CB8BFD1FC8CAFCDE15E4527B604018F28AA16C1E913F55461AF87C9A7BE1A742002E52B3A14EC30B259DDE7BB892CEAF77D25B7670B339B334878F697C00CE6740117AE7C67DF3F8A7BEAC89D4872682C47F368F835AFD7ECF0D8471AD01468B7BBB0A974EC469A8F79ECF8D379DC13685D2A8F6F19CE102C3DE34B11422AFB42E894C8D00F606296DABA7123FCE039ED27324D60E853BA94DC638454088281335D437A954333FF1A8D08E2A4D25CB3BA0D08BF6625E25EAD3C1EBFA2666AA49550578D3763ECDCE81303B53F18B00C8900AF4E0532C5ECBC94513DD9F50BE511CFE4D3DDBB3F112AE148DB062B2EADDB901CDA6AB6BF59D37F356AB34AF97D3DAAAA417642E87C9B95AA546C682ED641214605F82A4F486C9C72576106F76D7152615EC8E77187D4485071CFC6B0AE44880442790696E057A3AE20C860691353B3F6BEC5F1C2DA07563B423BC01E0334099571158A432441256D7C409B7B6EF26442075ED17E2BE37F8EBC049CFBE0FA89CDA7A58DD32C417B34E899FBE86E2FAB8D30846DA17144A6A66AAE1C24FCFABDA5B573FD2D6337226B5E49BB031B4D2B455B6DB871076F67AC03C3A73CEC01BD0B1EC42ABD177127E62A66FE8E475B982B4490F0877466EEFC7317A703C5C07937340ED4B53E5DE5325197FA31B8C8E05AA2222064EE5D7C06D4A1EB53151F75C94A2E259688CA0716548465C5C255D81FF10BACC2C13098ED8CF7F5B15193EE14FB5D258E95EDCC93E9796FA823892C705A5771D561787C12592D269D657FBB71F021F365B7453D50C35F748FB2B7F36DF28769B81EF12A26A237FB0239C173559540",
"53DA0E7B84741AA9E225483630169ACBCC03EB8CDA28B7BDA685C756D66B14488A2D0AEF7E6CB2D80F2726327257B7284B93EA1B56AB80FAE668C04FA49FCD658D896A997685E1EDB4DDF85456B37F32FC8CDE50882EF0F09BE4ED4AB9A425806A49E8347A42A50B38FA8D1DA2FD2C9438618B6701DEE159060C186D50170F24F38E07B185E3272EAEA4A0A7CA41A69C69E9D95E271287D3AB8284146A58440EA131A7F47D73CB2BCF40FE3A58E1B998C2E5EF9CEEC8EA2F8467BB7757C03A99FC8F014EE933A7080CD46625A2A7A251B7A37E4208956A8C9BD35E6F8674BC06FCAA5DD04A2558C9665C7985014D3AD95ED256FAFA358962EF5BB26AE2FCE899392DF858F99303E2417BCA7672E991FEB891F5DFCA2D461148367C5C0DE1460BF557194533DAF01A5E8E0E43D57B825AF7EEFF163DAA23B9F95C063A26B3D213459D885AA96023715CD21DFA2A2250F7610B78A77123443BD06EFB7DC85D1F16D0019D2937C3DEC4DE6389485ABB21642B6E41ADD43CE96F228C08DF6288A647EC2FE96032B6DCD651FF950B72964EE08FC2030272E3F601DB7F7E770E655389CA6CFA2F9B87CE76FB0E0CDCA4EEE5E80FC756BE46CC09F84BDB34ADA2AFC024ABDE0066ED939F8EBC236CB3F577C1BFD741F9D101A038EC86AB0A85462BAFB2E484D6722499A6310FA449D979030B2A21206D44225800BE2228FA00AE6D92C8DA652E1B003BD2734D30557B735CC2A591E090394DB791245C22B4D29E706476593B6F90C694C5B87BBB0FA2C479E292A768A9687A713336A21D1199186F852C41F586E9BBC64004D8BB6814BFE739834C99923177AAF87B926D56A7AFC0879C027332A60951C84E9314380A5A78E1196D094F15D856AA36742825D2B397156BCAD8ABE7291FB41DB4365AAE49CA82CA066D3B4366D3122ABBC00F05559DAFEBA9F98361DDAEF068D60B18265E7184C4D6BC9C3619CFF5C758090FF6398CCCEB78176D2A8A2A4B9854C4ACF5CB614DC1CA0E15E7E85442241D48FD3D6E851A5D3947FA769560928948FA26FA16EFBD2159994BD92B3D6B0C62818C91D4724413A7F40B2A2D67F4FC97B5DF6A7E3CEC03158E201D6643F402D3DD6995A42900D46C2881198CAD28A27489F5116ECEC3E38D999B2020E0C381DB3B8230811270D75950D9BB61548802DBBCB68ED8C7BCCB50D606BE400BECF873498621E66ABD2AA179B3E90E055C3719CE2FE047F815B95B065BA086B467AF4124E276F8CEAD000BCA5499D36217B250009A7B43E81CB3F8B1A3238EE436FE61F2F942796DBCBE570BB4FC783B35C3CA31BDD432B33AD75B08107253E8F910EFE0D0B5453A8A055D884892278688B3ECA612452B590AF38DBDD9A7070C5610E7A3CA6C91D24438E7F45E7A2A330F164AEDFFF1789D5E875EEF121298DB79C77278ABFEC3FE3DF843C46F40E847272EB2669BABA808C38E31F13516D5066AF4DFCDE6EDB2FF0B0A4CE9FA9B4101F6F144B02384868617CD39175852E065473D6F566CD18D7403FFD24DD33ADDB52C7CC22167E49102C46DC369A92CE2D2FCB81B4D1F14B7CD2F80A65D8FBD20FDAA23219873ACB8CF934E68D6F8FED6B41193CFAB1F44CE4BFC7C67DE1E8804B47DFD7E8AE281E19846AEB6FF94AE7E7CF6FFAB46242843811E6C5BDB78157C76DF4F92FD3653D7FA5978316EB055059C6A2B6306C957418860A88F63355E76D96F4727128D9B3EB98501AF5B093F2C314F98EA2CDB89468E1BD51138CBF25E8B911C26B97DCCA47F1A1D6C1CD415A5079A756B8A8715DD3164",
};
// Galileo E5a-I secondary code
const std::string Galileo_E5a_I_SECONDARY_CODE = "10000100001011101001";
// Galileo E5a-Q secondary codes
const std::string Galileo_E5a_Q_SECONDARY_CODE[Galileo_E5a_NUMBER_OF_CODES] = {
"1000001111110110111101101001110110001111011011100001010101000001000111111011100011001001101100011100",

View File

@ -32,7 +32,7 @@
Galileo_Almanac::Galileo_Almanac()
{
/*Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number*/
// Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number
IOD_a_7 = 0;
WN_a_7 = 0.0;
t0a_7 = 0.0;
@ -45,7 +45,7 @@ Galileo_Almanac::Galileo_Almanac()
Omega_dot_7 = 0.0;
M0_7 = 0.0;
/*Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)*/
// Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)
IOD_a_8 = 0;
af0_8 = 0.0;
af1_8 = 0.0;
@ -60,7 +60,7 @@ Galileo_Almanac::Galileo_Almanac()
Omega0_8 = 0.0;
Omega_dot_8 = 0.0;
/*Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2)*/
// Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2)
IOD_a_9 = 0;
WN_a_9 = 0.0;
t0a_9 = 0.0;
@ -76,7 +76,7 @@ Galileo_Almanac::Galileo_Almanac()
omega_9 = 0.0;
delta_i_9 = 0.0;
/*Word type 10: Almanac for SVID3 (2/2)*/
// Word type 10: Almanac for SVID3 (2/2)
IOD_a_10 = 0;
Omega0_10 = 0.0;
Omega_dot_10 = 0.0;
@ -87,7 +87,7 @@ Galileo_Almanac::Galileo_Almanac()
E1B_HS_10 = 0.0;
E5a_HS_10 = 0.0;
/*GPS to Galileo GST conversion parameters*/
// GPS to Galileo GST conversion parameters
A_0G_10 = 0.0;
A_1G_10 = 0.0;
t_0G_10 = 0.0;

View File

@ -31,6 +31,7 @@
#ifndef GNSS_SDR_GALILEO_ALMANAC_H_
#define GNSS_SDR_GALILEO_ALMANAC_H_
#include <cstdint>
/*!
* \brief This class is a storage for the GALILEO ALMANAC data as described in GALILEO ICD
@ -40,11 +41,11 @@
class Galileo_Almanac
{
public:
/*Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number*/
int IOD_a_7;
// Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number
int32_t IOD_a_7;
double WN_a_7;
double t0a_7;
int SVID1_7;
int32_t SVID1_7;
double DELTA_A_7;
double e_7;
double omega_7;
@ -53,14 +54,14 @@ public:
double Omega_dot_7;
double M0_7;
/*Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)*/
int IOD_a_8;
// Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)
int32_t IOD_a_8;
double af0_8;
double af1_8;
double E5b_HS_8;
double E1B_HS_8;
double E5a_HS_8;
int SVID2_8;
int32_t SVID2_8;
double DELTA_A_8;
double e_8;
double omega_8;
@ -68,8 +69,8 @@ public:
double Omega0_8;
double Omega_dot_8;
/*Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2)*/
int IOD_a_9;
// Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2)
int32_t IOD_a_9;
double WN_a_9;
double t0a_9;
double M0_9;
@ -78,14 +79,14 @@ public:
double E5b_HS_9;
double E1B_HS_9;
double E5a_HS_9;
int SVID3_9;
int32_t SVID3_9;
double DELTA_A_9;
double e_9;
double omega_9;
double delta_i_9;
/*Word type 10: Almanac for SVID3 (2/2)*/
int IOD_a_10;
// Word type 10: Almanac for SVID3 (2/2)
int32_t IOD_a_10;
double Omega0_10;
double Omega_dot_10;
double M0_10;
@ -95,7 +96,7 @@ public:
double E1B_HS_10;
double E5a_HS_10;
/*GPS to Galileo GST conversion parameters*/
// GPS to Galileo GST conversion parameters
double A_0G_10;
double A_1G_10;
double t_0G_10;

View File

@ -39,40 +39,43 @@ Galileo_Ephemeris::Galileo_Ephemeris()
IOD_ephemeris = 0;
IOD_nav_1 = 0;
SV_ID_PRN_4 = 0;
M0_1 = 0; // Mean anomaly at reference time [semi-circles]
delta_n_3 = 0; // Mean motion difference from computed value [semi-circles/sec]
e_1 = 0; // Eccentricity
A_1 = 0; // Square root of the semi-major axis [meters^1/2]
OMEGA_0_2 = 0; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
i_0_2 = 0; // Inclination angle at reference time [semi-circles]
omega_2 = 0; // Argument of perigee [semi-circles]
OMEGA_dot_3 = 0; // Rate of right ascension [semi-circles/sec]
iDot_2 = 0; // Rate of inclination angle [semi-circles/sec]
C_uc_3 = 0; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians]
C_us_3 = 0; // Amplitude of the sine harmonic correction term to the argument of latitude [radians]
C_rc_3 = 0; // Amplitude of the cosine harmonic correction term to the orbit radius [meters]
C_rs_3 = 0; // Amplitude of the sine harmonic correction term to the orbit radius [meters]
C_ic_4 = 0; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians]
C_is_4 = 0; // Amplitude of the sine harmonic correction term to the angle of inclination [radians]
t0e_1 = 0; // Ephemeris reference time [s]
/*Clock correction parameters*/
t0c_4 = 0; // Clock correction data reference Time of Week [sec]
af0_4 = 0; // SV clock bias correction coefficient [s]
af1_4 = 0; // SV clock drift correction coefficient [s/s]
af2_4 = 0; // SV clock drift rate correction coefficient [s/s^2]
/*GST*/
WN_5 = 0;
TOW_5 = 0;
M0_1 = 0.0; // Mean anomaly at reference time [semi-circles]
delta_n_3 = 0.0; // Mean motion difference from computed value [semi-circles/sec]
e_1 = 0.0; // Eccentricity
A_1 = 0.0; // Square root of the semi-major axis [meters^1/2]
OMEGA_0_2 = 0.0; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
i_0_2 = 0.0; // Inclination angle at reference time [semi-circles]
omega_2 = 0.0; // Argument of perigee [semi-circles]
OMEGA_dot_3 = 0.0; // Rate of right ascension [semi-circles/sec]
iDot_2 = 0.0; // Rate of inclination angle [semi-circles/sec]
C_uc_3 = 0.0; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians]
C_us_3 = 0.0; // Amplitude of the sine harmonic correction term to the argument of latitude [radians]
C_rc_3 = 0.0; // Amplitude of the cosine harmonic correction term to the orbit radius [meters]
C_rs_3 = 0.0; // Amplitude of the sine harmonic correction term to the orbit radius [meters]
C_ic_4 = 0.0; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians]
C_is_4 = 0.0; // Amplitude of the sine harmonic correction term to the angle of inclination [radians]
t0e_1 = 0.0; // Ephemeris reference time [s]
// Clock correction parameters
t0c_4 = 0.0; // Clock correction data reference Time of Week [sec]
af0_4 = 0.0; // SV clock bias correction coefficient [s]
af1_4 = 0.0; // SV clock drift correction coefficient [s/s]
af2_4 = 0.0; // SV clock drift rate correction coefficient [s/s^2]
// GST
WN_5 = 0.0;
TOW_5 = 0.0;
// SV status
SISA_3 = 0;
E5a_HS = 0;
E5b_HS_5 = 0;
E1B_HS_5 = 0;
SISA_3 = 0.0;
E5a_HS = 0U;
E5b_HS_5 = 0.0;
E1B_HS_5 = 0.0;
E5a_DVS = false;
E5b_DVS_5 = 0;
E1B_DVS_5 = 0;
BGD_E1E5a_5 = 0; // E1-E5a Broadcast Group Delay [s]
BGD_E1E5b_5 = 0; // E1-E5b Broadcast Group Delay [s]
E5b_DVS_5 = 0.0;
E1B_DVS_5 = 0.0;
BGD_E1E5a_5 = 0.0; // E1-E5a Broadcast Group Delay [s]
BGD_E1E5b_5 = 0.0; // E1-E5b Broadcast Group Delay [s]
Galileo_satClkDrift = 0.0;
Galileo_dtr = 0.0;
@ -81,12 +84,13 @@ Galileo_Ephemeris::Galileo_Ephemeris()
d_satpos_X = 0.0;
d_satpos_Y = 0.0;
d_satpos_Z = 0.0;
// Satellite velocity
d_satvel_X = 0.0;
d_satvel_Y = 0.0;
d_satvel_Z = 0.0;
i_satellite_PRN = 0;
i_satellite_PRN = 0U;
}
@ -170,7 +174,7 @@ double Galileo_Ephemeris::sv_clock_relativistic_term(double transmitTime) // Sa
E = M;
// --- Iteratively compute eccentric anomaly ----------------------------
for (int ii = 1; ii < 20; ii++)
for (int32_t ii = 1; ii < 20; ii++)
{
E_old = E;
E = M + e_1 * sin(E);
@ -230,7 +234,7 @@ void Galileo_Ephemeris::satellitePosition(double transmitTime)
E = M;
// --- Iteratively compute eccentric anomaly ----------------------------
for (int ii = 1; ii < 20; ii++)
for (int32_t ii = 1; ii < 20; ii++)
{
E_old = E;
E = M + e_1 * sin(E);

View File

@ -35,6 +35,7 @@
#include <boost/assign.hpp>
#include <boost/serialization/nvp.hpp>
#include <cstdint>
/*!
@ -48,9 +49,9 @@ public:
/* Galileo ephemeris are 16 parameters and here are reported following the ICD order, paragraph 5.1.1.
The number in the name after underscore (_1, _2, _3 and so on) refers to the page were we can find that parameter */
bool flag_all_ephemeris;
int IOD_ephemeris;
int IOD_nav_1;
int SV_ID_PRN_4;
int32_t IOD_ephemeris;
int32_t IOD_nav_1;
int32_t SV_ID_PRN_4;
double M0_1; //!< Mean anomaly at reference time [semi-circles]
double delta_n_3; //!< Mean motion difference from computed value [semi-circles/sec]
double e_1; //!< Eccentricity
@ -83,12 +84,12 @@ public:
// SV status
double SISA_3;
unsigned int E5a_HS; //!< E5a Signal Health Status
double E5b_HS_5; //!< E5b Signal Health Status
double E1B_HS_5; //!< E1B Signal Health Status
bool E5a_DVS; //!< E5a Data Validity Status
double E5b_DVS_5; //!< E5b Data Validity Status
double E1B_DVS_5; //!< E1B Data Validity Status
uint32_t E5a_HS; //!< E5a Signal Health Status
double E5b_HS_5; //!< E5b Signal Health Status
double E1B_HS_5; //!< E1B Signal Health Status
bool E5a_DVS; //!< E5a Data Validity Status
double E5b_DVS_5; //!< E5b Data Validity Status
double E1B_DVS_5; //!< E1B Data Validity Status
double BGD_E1E5a_5; //!< E1-E5a Broadcast Group Delay [s]
double BGD_E1E5b_5; //!< E1-E5b Broadcast Group Delay [s]
@ -103,7 +104,7 @@ public:
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]
unsigned int i_satellite_PRN; //!< SV PRN NUMBER
uint32_t i_satellite_PRN; //!< SV PRN NUMBER
void satellitePosition(double transmitTime); //!< Computes the ECEF SV coordinates and ECEF velocity
double Galileo_System_Time(double WN, double TOW); //!< Galileo System Time (GST), ICD paragraph 5.1.2
@ -116,7 +117,7 @@ public:
/*!
* \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.
*/
inline void serialize(Archive& archive, const unsigned int version)
inline void serialize(Archive& archive, const uint32_t version)
{
using boost::serialization::make_nvp;
if (version)

View File

@ -66,131 +66,120 @@ void Galileo_Fnav_Message::reset()
IOD_ephemeris = 0;
page_type = 0;
/* WORD 1 SVID, Clock correction, SISA, Ionospheric correction, BGD, GST, Signal
* health and Data validity status*/
// WORD 1 SVID, Clock correction, SISA, Ionospheric correction, BGD, GST, Signal
// health and Data validity status
FNAV_SV_ID_PRN_1 = 0;
FNAV_IODnav_1 = -1;
FNAV_t0c_1 = 0;
FNAV_af0_1 = 0;
FNAV_af1_1 = 0;
FNAV_af2_1 = 0;
FNAV_SISA_1 = 0;
FNAV_ai0_1 = 0;
FNAV_ai1_1 = 0;
FNAV_ai2_1 = 0;
FNAV_region1_1 = 0;
FNAV_region2_1 = 0;
FNAV_region3_1 = 0;
FNAV_region4_1 = 0;
FNAV_region5_1 = 0;
FNAV_BGD_1 = 0;
FNAV_E5ahs_1 = 0;
FNAV_WN_1 = 0;
FNAV_TOW_1 = 0;
FNAV_E5advs_1 = 0;
FNAV_t0c_1 = 0.0;
FNAV_af0_1 = 0.0;
FNAV_af1_1 = 0.0;
FNAV_af2_1 = 0.0;
FNAV_SISA_1 = 0.0;
FNAV_ai0_1 = 0.0;
FNAV_ai1_1 = 0.0;
FNAV_ai2_1 = 0.0;
FNAV_region1_1 = false;
FNAV_region2_1 = false;
FNAV_region3_1 = false;
FNAV_region4_1 = false;
FNAV_region5_1 = false;
FNAV_BGD_1 = 0.0;
FNAV_E5ahs_1 = 0.0;
FNAV_WN_1 = 0.0;
FNAV_TOW_1 = 0.0;
FNAV_E5advs_1 = false;
// WORD 2 Ephemeris (1/3) and GST
FNAV_IODnav_2 = -2;
FNAV_M0_2 = 0;
FNAV_omegadot_2 = 0;
FNAV_e_2 = 0;
FNAV_a12_2 = 0;
FNAV_omega0_2 = 0;
FNAV_idot_2 = 0;
FNAV_WN_2 = 0;
FNAV_TOW_2 = 0;
FNAV_M0_2 = 0.0;
FNAV_omegadot_2 = 0.0;
FNAV_e_2 = 0.0;
FNAV_a12_2 = 0.0;
FNAV_omega0_2 = 0.0;
FNAV_idot_2 = 0.0;
FNAV_WN_2 = 0.0;
FNAV_TOW_2 = 0.0;
// WORD 3 Ephemeris (2/3) and GST
FNAV_IODnav_3 = -3;
FNAV_i0_3 = 0;
FNAV_w_3 = 0;
FNAV_deltan_3 = 0;
FNAV_Cuc_3 = 0;
FNAV_Cus_3 = 0;
FNAV_Crc_3 = 0;
FNAV_Crs_3 = 0;
FNAV_t0e_3 = 0;
FNAV_WN_3 = 0;
FNAV_TOW_3 = 0;
FNAV_i0_3 = 0.0;
FNAV_w_3 = 0.0;
FNAV_deltan_3 = 0.0;
FNAV_Cuc_3 = 0.0;
FNAV_Cus_3 = 0.0;
FNAV_Crc_3 = 0.0;
FNAV_Crs_3 = 0.0;
FNAV_t0e_3 = 0.0;
FNAV_WN_3 = 0.0;
FNAV_TOW_3 = 0.0;
/* WORD 4 Ephemeris (3/3), GST-UTC conversion, GST-GPS conversion and TOW.
Note that the clock is repeated in this page type*/
// WORD 4 Ephemeris (3/3), GST-UTC conversion, GST-GPS conversion and TOW.
// Note that the clock is repeated in this page type
FNAV_IODnav_4 = -4;
FNAV_Cic_4 = 0;
FNAV_Cis_4 = 0;
FNAV_A0_4 = 0;
FNAV_A1_4 = 0;
FNAV_deltatls_4 = 0;
FNAV_t0t_4 = 0;
FNAV_WNot_4 = 0;
FNAV_WNlsf_4 = 0;
FNAV_DN_4 = 0;
FNAV_deltatlsf_4 = 0;
FNAV_t0g_4 = 0;
FNAV_A0g_4 = 0;
FNAV_A1g_4 = 0;
FNAV_WN0g_4 = 0;
FNAV_TOW_4 = 0;
FNAV_Cic_4 = 0.0;
FNAV_Cis_4 = 0.0;
FNAV_A0_4 = 0.0;
FNAV_A1_4 = 0.0;
FNAV_deltatls_4 = 0.0;
FNAV_t0t_4 = 0.0;
FNAV_WNot_4 = 0.0;
FNAV_WNlsf_4 = 0.0;
FNAV_DN_4 = 0.0;
FNAV_deltatlsf_4 = 0.0;
FNAV_t0g_4 = 0.0;
FNAV_A0g_4 = 0.0;
FNAV_A1g_4 = 0.0;
FNAV_WN0g_4 = 0.0;
FNAV_TOW_4 = 0.0;
// WORD 5 Almanac (SVID1 and SVID2(1/2)), Week Number and almanac reference time
FNAV_IODa_5 = 0;
FNAV_WNa_5 = 0;
FNAV_t0a_5 = 0;
FNAV_WNa_5 = 0.0;
FNAV_t0a_5 = 0.0;
FNAV_SVID1_5 = 0;
FNAV_Deltaa12_1_5 = 0;
FNAV_e_1_5 = 0;
FNAV_w_1_5 = 0;
FNAV_deltai_1_5 = 0;
FNAV_Omega0_1_5 = 0;
FNAV_Omegadot_1_5 = 0;
FNAV_M0_1_5 = 0;
FNAV_af0_1_5 = 0;
FNAV_af1_1_5 = 0;
FNAV_E5ahs_1_5 = 0;
FNAV_Deltaa12_1_5 = 0.0;
FNAV_e_1_5 = 0.0;
FNAV_w_1_5 = 0.0;
FNAV_deltai_1_5 = 0.0;
FNAV_Omega0_1_5 = 0.0;
FNAV_Omegadot_1_5 = 0.0;
FNAV_M0_1_5 = 0.0;
FNAV_af0_1_5 = 0.0;
FNAV_af1_1_5 = 0.0;
FNAV_E5ahs_1_5 = 0U;
FNAV_SVID2_5 = 0;
FNAV_Deltaa12_2_5 = 0;
FNAV_e_2_5 = 0;
FNAV_w_2_5 = 0;
FNAV_deltai_2_5 = 0;
FNAV_e_2_5 = 0.0;
FNAV_w_2_5 = 0.0;
FNAV_deltai_2_5 = 0.0;
// WORD 6 Almanac (SVID2(2/2) and SVID3)
FNAV_IODa_6 = 0;
FNAV_Omega0_2_6 = 0;
FNAV_Omegadot_2_6 = 0;
FNAV_M0_2_6 = 0;
FNAV_af0_2_6 = 0;
FNAV_af1_2_6 = 0;
FNAV_E5ahs_2_6 = 0;
FNAV_Omega0_2_6 = 0.0;
FNAV_Omegadot_2_6 = 0.0;
FNAV_M0_2_6 = 0.0;
FNAV_af0_2_6 = 0.0;
FNAV_af1_2_6 = 0.0;
FNAV_E5ahs_2_6 = 0.0;
FNAV_SVID3_6 = 0;
FNAV_Deltaa12_3_6 = 0;
FNAV_e_3_6 = 0;
FNAV_w_3_6 = 0;
FNAV_deltai_3_6 = 0;
FNAV_Omega0_3_6 = 0;
FNAV_Omegadot_3_6 = 0;
FNAV_M0_3_6 = 0;
FNAV_af0_3_6 = 0;
FNAV_af1_3_6 = 0;
FNAV_E5ahs_3_6 = 0;
FNAV_Deltaa12_3_6 = 0.0;
FNAV_e_3_6 = 0.0;
FNAV_w_3_6 = 0.0;
FNAV_deltai_3_6 = 0.0;
FNAV_Omega0_3_6 = 0.0;
FNAV_Omegadot_3_6 = 0.0;
FNAV_M0_3_6 = 0.0;
FNAV_af0_3_6 = 0.0;
FNAV_af1_3_6 = 0.0;
FNAV_E5ahs_3_6 = 0.0;
}
Galileo_Fnav_Message::Galileo_Fnav_Message()
{
reset();
}
//int Galileo_Fnav_Message::toInt(std::string bitString)
//{
// int tempInt;
// int num=0;
// int sLength = bitString.length();
// for(int i=0; i<sLength; i++)
// {
// num |= (1 << (sLength-1-i))*tempInt;
// }
//
// return num;
//}
void Galileo_Fnav_Message::split_page(std::string page_string)
{
@ -211,20 +200,20 @@ void Galileo_Fnav_Message::split_page(std::string page_string)
}
bool Galileo_Fnav_Message::_CRC_test(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, boost::uint32_t checksum)
bool Galileo_Fnav_Message::_CRC_test(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, uint32_t checksum)
{
CRC_Galileo_FNAV_type CRC_Galileo;
boost::uint32_t crc_computed;
uint32_t crc_computed;
// Galileo FNAV frame for CRC is not an integer multiple of bytes
// it needs to be filled with zeroes at the start of the frame.
// This operation is done in the transformation from bits to bytes
// using boost::dynamic_bitset.
// ToDo: Use boost::dynamic_bitset for all the bitset operations in this class
boost::dynamic_bitset<unsigned char> frame_bits(std::string(bits.to_string()));
boost::dynamic_bitset<uint8_t> frame_bits(std::string(bits.to_string()));
std::vector<unsigned char> bytes;
std::vector<uint8_t> bytes;
boost::to_block_range(frame_bits, std::back_inserter(bytes));
std::reverse(bytes.begin(), bytes.end());
@ -249,8 +238,8 @@ void Galileo_Fnav_Message::decode_page(std::string data)
switch (page_type)
{
case 1: // SVID, Clock correction, SISA, Ionospheric correction, BGD, GST, Signal health and Data validity status
FNAV_SV_ID_PRN_1 = static_cast<int>(read_navigation_unsigned(data_bits, FNAV_SV_ID_PRN_1_bit));
FNAV_IODnav_1 = static_cast<int>(read_navigation_unsigned(data_bits, FNAV_IODnav_1_bit));
FNAV_SV_ID_PRN_1 = static_cast<int32_t>(read_navigation_unsigned(data_bits, FNAV_SV_ID_PRN_1_bit));
FNAV_IODnav_1 = static_cast<int32_t>(read_navigation_unsigned(data_bits, FNAV_IODnav_1_bit));
FNAV_t0c_1 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_t0c_1_bit));
FNAV_t0c_1 *= FNAV_t0c_1_LSB;
FNAV_af0_1 = static_cast<double>(read_navigation_signed(data_bits, FNAV_af0_1_bit));
@ -273,17 +262,16 @@ void Galileo_Fnav_Message::decode_page(std::string data)
FNAV_region5_1 = static_cast<bool>(read_navigation_unsigned(data_bits, FNAV_region5_1_bit));
FNAV_BGD_1 = static_cast<double>(read_navigation_signed(data_bits, FNAV_BGD_1_bit));
FNAV_BGD_1 *= FNAV_BGD_1_LSB;
FNAV_E5ahs_1 = static_cast<unsigned int>(read_navigation_unsigned(data_bits, FNAV_E5ahs_1_bit));
FNAV_E5ahs_1 = static_cast<uint32_t>(read_navigation_unsigned(data_bits, FNAV_E5ahs_1_bit));
FNAV_WN_1 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_WN_1_bit));
FNAV_TOW_1 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_TOW_1_bit));
FNAV_E5advs_1 = static_cast<bool>(read_navigation_unsigned(data_bits, FNAV_E5advs_1_bit));
flag_TOW_1 = true;
flag_TOW_set = true;
flag_iono_and_GST = true; //set to false externally
flag_iono_and_GST = true; // set to false externally
break;
case 2: // Ephemeris (1/3) and GST
FNAV_IODnav_2 = static_cast<int>(read_navigation_unsigned(data_bits, FNAV_IODnav_2_bit));
FNAV_IODnav_2 = static_cast<int32_t>(read_navigation_unsigned(data_bits, FNAV_IODnav_2_bit));
FNAV_M0_2 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_M0_2_bit));
FNAV_M0_2 *= FNAV_M0_2_LSB;
FNAV_omegadot_2 = static_cast<double>(read_navigation_signed(data_bits, FNAV_omegadot_2_bit));
@ -298,13 +286,12 @@ void Galileo_Fnav_Message::decode_page(std::string data)
FNAV_idot_2 *= FNAV_idot_2_LSB;
FNAV_WN_2 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_WN_2_bit));
FNAV_TOW_2 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_TOW_2_bit));
flag_TOW_2 = true;
flag_TOW_set = true;
flag_ephemeris_1 = true;
break;
case 3: // Ephemeris (2/3) and GST
FNAV_IODnav_3 = static_cast<int>(read_navigation_unsigned(data_bits, FNAV_IODnav_3_bit));
FNAV_IODnav_3 = static_cast<int32_t>(read_navigation_unsigned(data_bits, FNAV_IODnav_3_bit));
FNAV_i0_3 = static_cast<double>(read_navigation_signed(data_bits, FNAV_i0_3_bit));
FNAV_i0_3 *= FNAV_i0_3_LSB;
FNAV_w_3 = static_cast<double>(read_navigation_signed(data_bits, FNAV_w_3_bit));
@ -323,13 +310,12 @@ void Galileo_Fnav_Message::decode_page(std::string data)
FNAV_t0e_3 *= FNAV_t0e_3_LSB;
FNAV_WN_3 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_WN_3_bit));
FNAV_TOW_3 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_TOW_3_bit));
flag_TOW_3 = true;
flag_TOW_set = true;
flag_ephemeris_2 = true;
break;
case 4: // Ephemeris (3/3), GST-UTC conversion, GST-GPS conversion and TOW
FNAV_IODnav_4 = static_cast<int>(read_navigation_unsigned(data_bits, FNAV_IODnav_4_bit));
FNAV_IODnav_4 = static_cast<int32_t>(read_navigation_unsigned(data_bits, FNAV_IODnav_4_bit));
FNAV_Cic_4 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_Cic_4_bit));
FNAV_Cic_4 *= FNAV_Cic_4_LSB;
FNAV_Cis_4 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_Cis_4_bit));
@ -353,18 +339,17 @@ void Galileo_Fnav_Message::decode_page(std::string data)
FNAV_A1g_4 *= FNAV_A1g_4_LSB;
FNAV_WN0g_4 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_WN0g_4_bit));
FNAV_TOW_4 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_TOW_4_bit));
flag_TOW_4 = true;
flag_TOW_set = true;
flag_ephemeris_3 = true;
flag_utc_model = true; //set to false externally
flag_utc_model = true; // set to false externally
break;
case 5: // Almanac (SVID1 and SVID2(1/2)), Week Number and almanac reference time
FNAV_IODa_5 = static_cast<int>(read_navigation_unsigned(data_bits, FNAV_IODa_5_bit));
FNAV_IODa_5 = static_cast<int32_t>(read_navigation_unsigned(data_bits, FNAV_IODa_5_bit));
FNAV_WNa_5 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_WNa_5_bit));
FNAV_t0a_5 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_t0a_5_bit));
FNAV_t0a_5 *= FNAV_t0a_5_LSB;
FNAV_SVID1_5 = static_cast<int>(read_navigation_unsigned(data_bits, FNAV_SVID1_5_bit));
FNAV_SVID1_5 = static_cast<int32_t>(read_navigation_unsigned(data_bits, FNAV_SVID1_5_bit));
FNAV_Deltaa12_1_5 = static_cast<double>(read_navigation_signed(data_bits, FNAV_Deltaa12_1_5_bit));
FNAV_Deltaa12_1_5 *= FNAV_Deltaa12_5_LSB;
FNAV_e_1_5 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_e_1_5_bit));
@ -384,7 +369,7 @@ void Galileo_Fnav_Message::decode_page(std::string data)
FNAV_af1_1_5 = static_cast<double>(read_navigation_signed(data_bits, FNAV_af1_1_5_bit));
FNAV_af1_1_5 *= FNAV_af1_5_LSB;
FNAV_E5ahs_1_5 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_E5ahs_1_5_bit));
FNAV_SVID2_5 = static_cast<int>(read_navigation_unsigned(data_bits, FNAV_SVID2_5_bit));
FNAV_SVID2_5 = static_cast<int32_t>(read_navigation_unsigned(data_bits, FNAV_SVID2_5_bit));
FNAV_Deltaa12_2_5 = static_cast<double>(read_navigation_signed(data_bits, FNAV_Deltaa12_2_5_bit));
FNAV_Deltaa12_2_5 *= FNAV_Deltaa12_5_LSB;
FNAV_e_2_5 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_e_2_5_bit));
@ -399,21 +384,18 @@ void Galileo_Fnav_Message::decode_page(std::string data)
//omega_flag=true;
//
//FNAV_Omega012_2_5=static_cast<double>(read_navigation_signed(data_bits, FNAV_Omega012_2_5_bit);
flag_almanac_1 = true;
break;
case 6: // Almanac (SVID2(2/2) and SVID3)
FNAV_IODa_6 = static_cast<int>(read_navigation_unsigned(data_bits, FNAV_IODa_6_bit));
/* Don't worry about omega pieces. If page 5 has not been received, all_ephemeris
* flag will be set to false and the data won't be recorded.*/
FNAV_IODa_6 = static_cast<int32_t>(read_navigation_unsigned(data_bits, FNAV_IODa_6_bit));
// Don't worry about omega pieces. If page 5 has not been received, all_ephemeris
// flag will be set to false and the data won't be recorded.*/
std::string omega0_2 = data.substr(10, 12);
std::string Omega0 = omega0_1 + omega0_2;
std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> omega_bits(Omega0);
const std::vector<std::pair<int, int>> om_bit({{0, 12}});
const std::vector<std::pair<int32_t, int32_t>> om_bit({{0, 12}});
FNAV_Omega0_2_6 = static_cast<double>(read_navigation_signed(omega_bits, om_bit));
FNAV_Omega0_2_6 *= FNAV_Omega0_5_LSB;
//
FNAV_Omegadot_2_6 = static_cast<double>(read_navigation_signed(data_bits, FNAV_Omegadot_2_6_bit));
FNAV_Omegadot_2_6 *= FNAV_Omegadot_5_LSB;
FNAV_M0_2_6 = static_cast<double>(read_navigation_signed(data_bits, FNAV_M0_2_6_bit));
@ -423,7 +405,7 @@ void Galileo_Fnav_Message::decode_page(std::string data)
FNAV_af1_2_6 = static_cast<double>(read_navigation_signed(data_bits, FNAV_af1_2_6_bit));
FNAV_af1_2_6 *= FNAV_af1_5_LSB;
FNAV_E5ahs_2_6 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_E5ahs_2_6_bit));
FNAV_SVID3_6 = static_cast<int>(read_navigation_unsigned(data_bits, FNAV_SVID3_6_bit));
FNAV_SVID3_6 = static_cast<int32_t>(read_navigation_unsigned(data_bits, FNAV_SVID3_6_bit));
FNAV_Deltaa12_3_6 = static_cast<double>(read_navigation_signed(data_bits, FNAV_Deltaa12_3_6_bit));
FNAV_Deltaa12_3_6 *= FNAV_Deltaa12_5_LSB;
FNAV_e_3_6 = static_cast<double>(read_navigation_unsigned(data_bits, FNAV_e_3_6_bit));
@ -450,7 +432,7 @@ void Galileo_Fnav_Message::decode_page(std::string data)
}
uint64_t Galileo_Fnav_Message::read_navigation_unsigned(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter)
uint64_t Galileo_Fnav_Message::read_navigation_unsigned(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter)
{
uint64_t value = 0;
int num_of_slices = parameter.size();
@ -458,7 +440,7 @@ uint64_t Galileo_Fnav_Message::read_navigation_unsigned(std::bitset<GALILEO_FNAV
{
for (int j = 0; j < parameter[i].second; j++)
{
value <<= 1; //shift left
value <<= 1; // shift left
if (bits[GALILEO_FNAV_DATA_FRAME_BITS - parameter[i].first - j] == 1)
{
value += 1; // insert the bit
@ -469,12 +451,12 @@ uint64_t Galileo_Fnav_Message::read_navigation_unsigned(std::bitset<GALILEO_FNAV
}
int64_t Galileo_Fnav_Message::read_navigation_signed(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter)
int64_t Galileo_Fnav_Message::read_navigation_signed(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter)
{
int64_t value = 0;
int num_of_slices = parameter.size();
// Discriminate between 64 bits and 32 bits compiler
int long_int_size_bytes = sizeof(int64_t);
int long_int_size_bytes = sizeof(long int);
if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system
{
// read the MSB and perform the sign extension
@ -491,8 +473,8 @@ int64_t Galileo_Fnav_Message::read_navigation_signed(std::bitset<GALILEO_FNAV_DA
{
for (int j = 0; j < parameter[i].second; j++)
{
value <<= 1; //shift left
value &= 0xFFFFFFFFFFFFFFFE; //reset the corresponding bit (for the 64 bits variable)
value <<= 1; // shift left
value &= 0xFFFFFFFFFFFFFFFE; // reset the corresponding bit (for the 64 bits variable)
if (bits[GALILEO_FNAV_DATA_FRAME_BITS - parameter[i].first - j] == 1)
{
value += 1; // insert the bit
@ -516,8 +498,8 @@ int64_t Galileo_Fnav_Message::read_navigation_signed(std::bitset<GALILEO_FNAV_DA
{
for (int j = 0; j < parameter[i].second; j++)
{
value <<= 1; //shift left
value &= 0xFFFFFFFE; //reset the corresponding bit
value <<= 1; // shift left
value &= 0xFFFFFFFE; // reset the corresponding bit
if (bits[GALILEO_FNAV_DATA_FRAME_BITS - parameter[i].first - j] == 1)
{
value += 1; // insert the bit
@ -529,11 +511,11 @@ int64_t Galileo_Fnav_Message::read_navigation_signed(std::bitset<GALILEO_FNAV_DA
}
bool Galileo_Fnav_Message::have_new_ephemeris() //Check if we have a new ephemeris stored in the galileo navigation class
bool Galileo_Fnav_Message::have_new_ephemeris() // Check if we have a new ephemeris stored in the galileo navigation class
{
if ((flag_ephemeris_1 == true) and (flag_ephemeris_2 == true) and (flag_ephemeris_3 == true) and (flag_iono_and_GST == true))
{
//if all ephemeris pages have the same IOD, then they belong to the same block
// if all ephemeris pages have the same IOD, then they belong to the same block
if ((FNAV_IODnav_1 == FNAV_IODnav_2) and (FNAV_IODnav_3 == FNAV_IODnav_4) and (FNAV_IODnav_1 == FNAV_IODnav_3))
{
std::cout << "Ephemeris (1, 2, 3) have been received and belong to the same batch" << std::endl;
@ -555,9 +537,9 @@ bool Galileo_Fnav_Message::have_new_ephemeris() //Check if we have a new epheme
}
bool Galileo_Fnav_Message::have_new_iono_and_GST() //Check if we have a new iono data set stored in the galileo navigation class
bool Galileo_Fnav_Message::have_new_iono_and_GST() // Check if we have a new iono data set stored in the galileo navigation class
{
if ((flag_iono_and_GST == true) and (flag_utc_model == true)) //the condition on flag_utc_model is added to have a time stamp for iono
if ((flag_iono_and_GST == true) and (flag_utc_model == true)) // the condition on flag_utc_model is added to have a time stamp for iono
{
flag_iono_and_GST = false; // clear the flag
return true;
@ -579,11 +561,11 @@ bool Galileo_Fnav_Message::have_new_utc_model() // Check if we have a new utc d
}
bool Galileo_Fnav_Message::have_new_almanac() //Check if we have a new almanac data set stored in the galileo navigation class
bool Galileo_Fnav_Message::have_new_almanac() // Check if we have a new almanac data set stored in the galileo navigation class
{
if ((flag_almanac_1 == true) and (flag_almanac_2 == true))
{
//All almanac have been received
// All almanac have been received
flag_almanac_1 = false;
flag_almanac_2 = false;
flag_all_almanac = true;
@ -618,17 +600,17 @@ Galileo_Ephemeris Galileo_Fnav_Message::get_ephemeris()
ephemeris.C_is_4 = FNAV_Cis_4; // Amplitude of the sine harmonic correction term to the angle of inclination [radians]
ephemeris.t0e_1 = FNAV_t0e_3; // Ephemeris reference time [s]
/*Clock correction parameters*/
// Clock correction parameters
ephemeris.t0c_4 = FNAV_t0c_1; // Clock correction data reference Time of Week [sec]
ephemeris.af0_4 = FNAV_af0_1; // SV clock bias correction coefficient [s]
ephemeris.af1_4 = FNAV_af1_1; // SV clock drift correction coefficient [s/s]
ephemeris.af2_4 = FNAV_af2_1; // SV clock drift rate correction coefficient [s/s^2]
/*GST*/
// GST
ephemeris.WN_5 = FNAV_WN_3; // Week number
ephemeris.TOW_5 = FNAV_TOW_3; // Time of Week
/* Health status */
// Health status
ephemeris.E5a_HS = FNAV_E5ahs_1;
ephemeris.E5a_DVS = FNAV_E5advs_1;
return ephemeris;
@ -638,20 +620,19 @@ Galileo_Ephemeris Galileo_Fnav_Message::get_ephemeris()
Galileo_Iono Galileo_Fnav_Message::get_iono()
{
Galileo_Iono iono;
/*Ionospheric correction*/
/*Az*/
// Ionospheric correction
iono.ai0_5 = FNAV_ai0_1; // Effective Ionisation Level 1st order parameter [sfu]
iono.ai1_5 = FNAV_ai1_1; // Effective Ionisation Level 2st order parameter [sfu/degree]
iono.ai2_5 = FNAV_ai2_1; // Effective Ionisation Level 3st order parameter [sfu/degree]
/*Ionospheric disturbance flag*/
// Ionospheric disturbance flag
iono.Region1_flag_5 = FNAV_region1_1; // Ionospheric Disturbance Flag for region 1
iono.Region2_flag_5 = FNAV_region2_1; // Ionospheric Disturbance Flag for region 2
iono.Region3_flag_5 = FNAV_region3_1; // Ionospheric Disturbance Flag for region 3
iono.Region4_flag_5 = FNAV_region4_1; // Ionospheric Disturbance Flag for region 4
iono.Region5_flag_5 = FNAV_region5_1; // Ionospheric Disturbance Flag for region 5
/*GST*/
// GST
iono.TOW_5 = FNAV_TOW_1;
iono.WN_5 = FNAV_WN_1;
return iono;
@ -661,8 +642,7 @@ Galileo_Iono Galileo_Fnav_Message::get_iono()
Galileo_Utc_Model Galileo_Fnav_Message::get_utc_model()
{
Galileo_Utc_Model utc_model;
//Gal_utc_model.valid = flag_utc_model_valid;
/*Word type 6: GST-UTC conversion parameters*/
// Word type 6: GST-UTC conversion parameters
utc_model.A0_6 = FNAV_A0_4;
utc_model.A1_6 = FNAV_A1_4;
utc_model.Delta_tLS_6 = FNAV_deltatls_4;
@ -672,7 +652,7 @@ Galileo_Utc_Model Galileo_Fnav_Message::get_utc_model()
utc_model.DN_6 = FNAV_DN_4;
utc_model.Delta_tLSF_6 = FNAV_deltatlsf_4;
utc_model.flag_utc_model = flag_utc_model;
/*GST*/
// GST
//utc_model.WN_5 = WN_5; //Week number
//utc_model.TOW_5 = WN_5; //Time of Week
return utc_model;
@ -682,7 +662,7 @@ Galileo_Utc_Model Galileo_Fnav_Message::get_utc_model()
Galileo_Almanac Galileo_Fnav_Message::get_almanac()
{
Galileo_Almanac almanac;
/*FNAV equivalent of INAV Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number*/
// FNAV equivalent of INAV Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number
almanac.IOD_a_7 = FNAV_IODa_5;
almanac.WN_a_7 = FNAV_WNa_5;
almanac.t0a_7 = FNAV_t0a_5;
@ -695,7 +675,7 @@ Galileo_Almanac Galileo_Fnav_Message::get_almanac()
almanac.Omega_dot_7 = FNAV_Omegadot_1_5;
almanac.M0_7 = FNAV_M0_1_5;
/*FNAV equivalent of INAV Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)*/
// FNAV equivalent of INAV Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)
almanac.IOD_a_8 = FNAV_IODa_5;
almanac.af0_8 = FNAV_af0_1_5;
almanac.af1_8 = FNAV_af1_1_5;
@ -708,7 +688,7 @@ Galileo_Almanac Galileo_Fnav_Message::get_almanac()
almanac.Omega0_8 = FNAV_Omega0_2_6;
almanac.Omega_dot_8 = FNAV_Omegadot_2_6;
/*FNAV equivalent of INAV Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2)*/
// FNAV equivalent of INAV Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2)
almanac.IOD_a_9 = FNAV_IODa_6;
almanac.WN_a_9 = FNAV_WNa_5;
almanac.t0a_9 = FNAV_t0a_5;
@ -722,7 +702,7 @@ Galileo_Almanac Galileo_Fnav_Message::get_almanac()
almanac.omega_9 = FNAV_w_3_6;
almanac.delta_i_9 = FNAV_deltai_3_6;
/*FNAV equivalent of INAV Word type 10: Almanac for SVID3 (2/2)*/
// FNAV equivalent of INAV Word type 10: Almanac for SVID3 (2/2)
almanac.IOD_a_10 = FNAV_IODa_6;
almanac.Omega0_10 = FNAV_Omega0_3_6;
almanac.Omega_dot_10 = FNAV_Omegadot_3_6;

View File

@ -43,7 +43,6 @@
#include "galileo_almanac.h"
#include "galileo_utc_model.h"
#include "Galileo_E5a.h"
#include <boost/cstdint.hpp> // for boost::uint16_t
#include <bitset>
#include <cstdint>
#include <string>
@ -58,17 +57,6 @@
class Galileo_Fnav_Message
{
public:
// void Galileo_Fnav_Message::split_page(std::string page_string);
// void Galileo_Fnav_Message::reset();
// bool Galileo_Fnav_Message::have_new_ephemeris();
// bool Galileo_Fnav_Message::have_new_iono_and_GST();
// bool Galileo_Fnav_Message::have_new_utc_model();
// bool Galileo_Fnav_Message::have_new_almanac();
// Galileo_Ephemeris Galileo_Fnav_Message::get_ephemeris();
// Galileo_Iono Galileo_Fnav_Message::get_iono();
// Galileo_Utc_Model Galileo_Fnav_Message::get_utc_model();
// Galileo_Almanac Galileo_Fnav_Message::get_almanac();
//
void split_page(std::string page_string);
void reset();
bool have_new_ephemeris();
@ -100,13 +88,13 @@ public:
bool flag_almanac_1; //!< Flag indicating that almanac 1/2 (word 5) have been received
bool flag_almanac_2; //!< Flag indicating that almanac 2/2 (word 6) have been received
int IOD_ephemeris;
int32_t IOD_ephemeris;
int page_type;
/* WORD 1 SVID, Clock correction, SISA, Ionospheric correction, BGD, GST, Signal
* health and Data validity status*/
int FNAV_SV_ID_PRN_1;
int FNAV_IODnav_1;
int32_t page_type;
// WORD 1 SVID, Clock correction, SISA, Ionospheric correction, BGD, GST, Signal
// health and Data validity status
int32_t FNAV_SV_ID_PRN_1;
int32_t FNAV_IODnav_1;
double FNAV_t0c_1;
double FNAV_af0_1;
double FNAV_af1_1;
@ -127,7 +115,7 @@ public:
bool FNAV_E5advs_1;
// WORD 2 Ephemeris (1/3) and GST
int FNAV_IODnav_2;
int32_t FNAV_IODnav_2;
double FNAV_M0_2;
double FNAV_omegadot_2;
double FNAV_e_2;
@ -138,7 +126,7 @@ public:
double FNAV_TOW_2;
// WORD 3 Ephemeris (2/3) and GST
int FNAV_IODnav_3;
int32_t FNAV_IODnav_3;
double FNAV_i0_3;
double FNAV_w_3;
double FNAV_deltan_3;
@ -150,9 +138,9 @@ public:
double FNAV_WN_3;
double FNAV_TOW_3;
/* WORD 4 Ephemeris (3/3), GST-UTC conversion, GST-GPS conversion and TOW.
Note that the clock is repeated in this page type*/
int FNAV_IODnav_4;
// WORD 4 Ephemeris (3/3), GST-UTC conversion, GST-GPS conversion and TOW.
// Note that the clock is repeated in this page type
int32_t FNAV_IODnav_4;
double FNAV_Cic_4;
double FNAV_Cis_4;
double FNAV_A0_4;
@ -170,10 +158,10 @@ public:
double FNAV_TOW_4;
// WORD 5 Almanac (SVID1 and SVID2(1/2)), Week Number and almanac reference time
int FNAV_IODa_5;
int32_t FNAV_IODa_5;
double FNAV_WNa_5;
double FNAV_t0a_5;
int FNAV_SVID1_5;
int32_t FNAV_SVID1_5;
double FNAV_Deltaa12_1_5;
double FNAV_e_1_5;
double FNAV_w_1_5;
@ -183,22 +171,22 @@ public:
double FNAV_M0_1_5;
double FNAV_af0_1_5;
double FNAV_af1_1_5;
unsigned int FNAV_E5ahs_1_5;
int FNAV_SVID2_5;
uint32_t FNAV_E5ahs_1_5;
int32_t FNAV_SVID2_5;
double FNAV_Deltaa12_2_5;
double FNAV_e_2_5;
double FNAV_w_2_5;
double FNAV_deltai_2_5;
// WORD 6 Almanac (SVID2(2/2) and SVID3)
int FNAV_IODa_6;
int32_t FNAV_IODa_6;
double FNAV_Omega0_2_6;
double FNAV_Omegadot_2_6;
double FNAV_M0_2_6;
double FNAV_af0_2_6;
double FNAV_af1_2_6;
double FNAV_E5ahs_2_6;
int FNAV_SVID3_6;
int32_t FNAV_SVID3_6;
double FNAV_Deltaa12_3_6;
double FNAV_e_3_6;
double FNAV_w_3_6;
@ -210,12 +198,11 @@ public:
double FNAV_af1_3_6;
double FNAV_E5ahs_3_6;
private:
bool _CRC_test(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, boost::uint32_t checksum);
bool _CRC_test(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, uint32_t checksum);
void decode_page(std::string data);
uint64_t read_navigation_unsigned(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
int64_t read_navigation_signed(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
uint64_t read_navigation_unsigned(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter);
int64_t read_navigation_signed(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter);
std::string omega0_1;
//std::string omega0_2;

View File

@ -33,18 +33,18 @@
Galileo_Iono::Galileo_Iono()
{
/* Ionospheric correction */
ai0_5 = 0; // Effective Ionisation Level 1st order parameter [sfu]
ai1_5 = 0; // Effective Ionisation Level 2st order parameter [sfu/degree]
ai2_5 = 0; // Effective Ionisation Level 3st order parameter [sfu/degree]
// Ionospheric correction
ai0_5 = 0.0; // Effective Ionisation Level 1st order parameter [sfu]
ai1_5 = 0.0; // Effective Ionisation Level 2st order parameter [sfu/degree]
ai2_5 = 0.0; // Effective Ionisation Level 3st order parameter [sfu/degree]
/* Ionospheric disturbance flag */
// Ionospheric disturbance flag
Region1_flag_5 = false; // Ionospheric Disturbance Flag for region 1
Region2_flag_5 = false; // Ionospheric Disturbance Flag for region 2
Region3_flag_5 = false; // Ionospheric Disturbance Flag for region 3
Region4_flag_5 = false; // Ionospheric Disturbance Flag for region 4
Region5_flag_5 = false; // Ionospheric Disturbance Flag for region 5
TOW_5 = 0;
WN_5 = 0;
TOW_5 = 0.0;
WN_5 = 0.0;
}

View File

@ -41,19 +41,19 @@
class Galileo_Iono
{
public:
/*Ionospheric correction*/
// Ionospheric correction
double ai0_5; //!< Effective Ionisation Level 1st order parameter [sfu]
double ai1_5; //!< Effective Ionisation Level 2st order parameter [sfu/degree]
double ai2_5; //!< Effective Ionisation Level 3st order parameter [sfu/degree]
/*Ionospheric disturbance flag*/
// Ionospheric disturbance flag
bool Region1_flag_5; //!< Ionospheric Disturbance Flag for region 1
bool Region2_flag_5; //!< Ionospheric Disturbance Flag for region 2
bool Region3_flag_5; //!< Ionospheric Disturbance Flag for region 3
bool Region4_flag_5; //!< Ionospheric Disturbance Flag for region 4
bool Region5_flag_5; //!< Ionospheric Disturbance Flag for region 5
/*from page 5 (UTC) to have a timestamp*/
// from page 5 (UTC) to have a timestamp
double TOW_5; //!< UTC data reference Time of Week [s]
double WN_5; //!< UTC data reference Week number [week]

View File

@ -61,7 +61,7 @@ void Galileo_Navigation_Message::reset()
flag_almanac_3 = false; // flag indicating that almanac 3/4 (word 9) have been received
flag_almanac_4 = false; // flag indicating that almanac 4/4 (word 10) have been received
flag_TOW_5 = 0;
flag_TOW_5 = false;
flag_TOW_set = false;
flag_GGTO = false;
@ -71,139 +71,141 @@ void Galileo_Navigation_Message::reset()
flag_GGTO_4 = false;
IOD_ephemeris = 0;
/*Word type 1: Ephemeris (1/4)*/
// Word type 1: Ephemeris (1/4)
IOD_nav_1 = 0;
t0e_1 = 0;
M0_1 = 0;
e_1 = 0;
A_1 = 0;
t0e_1 = 0.0;
M0_1 = 0.0;
e_1 = 0.0;
A_1 = 0.0;
/*Word type 2: Ephemeris (2/4)*/
IOD_nav_2 = 0; // IOD_nav page 2
OMEGA_0_2 = 0; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
i_0_2 = 0; // Inclination angle at reference time [semi-circles]
omega_2 = 0; // Argument of perigee [semi-circles]
iDot_2 = 0; // Rate of inclination angle [semi-circles/sec]
// Word type 2: Ephemeris (2/4)
IOD_nav_2 = 0; // IOD_nav page 2
OMEGA_0_2 = 0.0; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
i_0_2 = 0.0; // Inclination angle at reference time [semi-circles]
omega_2 = 0.0; // Argument of perigee [semi-circles]
iDot_2 = 0.0; // Rate of inclination angle [semi-circles/sec]
// Word type 3: Ephemeris (3/4) and SISA
IOD_nav_3 = 0;
OMEGA_dot_3 = 0.0; // Rate of right ascension [semi-circles/sec]
delta_n_3 = 0.0; // Mean motion difference from computed value [semi-circles/sec]
C_uc_3 = 0.0; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians]
C_us_3 = 0.0; // Amplitude of the sine harmonic correction term to the argument of latitude [radians]
C_rc_3 = 0.0; // Amplitude of the cosine harmonic correction term to the orbit radius [meters]
C_rs_3 = 0.0; // Amplitude of the sine harmonic correction term to the orbit radius [meters]
SISA_3 = 0.0; //
/*Word type 3: Ephemeris (3/4) and SISA*/
IOD_nav_3 = 0; //
OMEGA_dot_3 = 0; // Rate of right ascension [semi-circles/sec]
delta_n_3 = 0; // Mean motion difference from computed value [semi-circles/sec]
C_uc_3 = 0; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians]
C_us_3 = 0; // Amplitude of the sine harmonic correction term to the argument of latitude [radians]
C_rc_3 = 0; // Amplitude of the cosine harmonic correction term to the orbit radius [meters]
C_rs_3 = 0; // Amplitude of the sine harmonic correction term to the orbit radius [meters]
SISA_3 = 0; //
// Word type 4: Ephemeris (4/4) and Clock correction parameter/
IOD_nav_4 = 0;
SV_ID_PRN_4 = 0;
C_ic_4 = 0.0; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians]
C_is_4 = 0.0; // Amplitude of the sine harmonic correction term to the angle of inclination [radians]
// Clock correction parameters
t0c_4 = 0.0;
af0_4 = 0.0;
af1_4 = 0.0;
af2_4 = 0.0;
spare_4 = 0.0;
/*Word type 4: Ephemeris (4/4) and Clock correction parameters*/
IOD_nav_4 = 0; //
SV_ID_PRN_4 = 0; //
C_ic_4 = 0; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians]
C_is_4 = 0; // Amplitude of the sine harmonic correction term to the angle of inclination [radians]
/*Clock correction parameters*/
t0c_4 = 0; //
af0_4 = 0; //
af1_4 = 0; //
af2_4 = 0; //
spare_4 = 0;
// Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST
// Ionospheric correction
ai0_5 = 0.0;
ai1_5 = 0.0;
ai2_5 = 0.0;
/*Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST*/
/*Ionospheric correction*/
/*Az*/
ai0_5 = 0; //
ai1_5 = 0; //
ai2_5 = 0; //
/*Ionospheric disturbance flag*/
Region1_flag_5 = 0; // Region1_flag_5;
Region2_flag_5 = 0; //
Region3_flag_5 = 0; //
Region4_flag_5 = 0; //
Region5_flag_5 = 0; //
BGD_E1E5a_5 = 0; //
BGD_E1E5b_5 = 0; //
E5b_HS_5 = 0;
E1B_HS_5 = 0;
E5b_DVS_5 = 0; //
E1B_DVS_5 = 0; //
/*GST*/
WN_5 = 0;
TOW_5 = 0;
spare_5 = 0;
// Ionospheric disturbance flag
Region1_flag_5 = false; // Region1_flag_5;
Region2_flag_5 = false;
Region3_flag_5 = false;
Region4_flag_5 = false;
Region5_flag_5 = false;
BGD_E1E5a_5 = 0.0;
BGD_E1E5b_5 = 0.0;
E5b_HS_5 = 0.0;
E1B_HS_5 = 0.0;
E5b_DVS_5 = 0.0;
E1B_DVS_5 = 0.0;
/*Word type 6: GST-UTC conversion parameters*/
A0_6 = 0;
A1_6 = 0;
Delta_tLS_6 = 0;
t0t_6 = 0;
WNot_6 = 0;
WN_LSF_6 = 0;
DN_6 = 0;
Delta_tLSF_6 = 0;
TOW_6 = 0;
// GST
WN_5 = 0.0;
TOW_5 = 0.0;
spare_5 = 0.0;
/*Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number*/
// Word type 6: GST-UTC conversion parameters
A0_6 = 0.0;
A1_6 = 0.0;
Delta_tLS_6 = 0.0;
t0t_6 = 0.0;
WNot_6 = 0.0;
WN_LSF_6 = 0.0;
DN_6 = 0.0;
Delta_tLSF_6 = 0.0;
TOW_6 = 0.0;
// Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number
IOD_a_7 = 0;
WN_a_7 = 0;
t0a_7 = 0;
WN_a_7 = 0.0;
t0a_7 = 0.0;
SVID1_7 = 0;
DELTA_A_7 = 0;
e_7 = 0;
omega_7 = 0;
delta_i_7 = 0;
Omega0_7 = 0;
Omega_dot_7 = 0;
M0_7 = 0;
DELTA_A_7 = 0.0;
e_7 = 0.0;
omega_7 = 0.0;
delta_i_7 = 0.0;
Omega0_7 = 0.0;
Omega_dot_7 = 0.0;
M0_7 = 0.0;
/*Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)*/
// Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)
IOD_a_8 = 0;
af0_8 = 0;
af1_8 = 0;
E5b_HS_8 = 0;
E1B_HS_8 = 0;
af0_8 = 0.0;
af1_8 = 0.0;
E5b_HS_8 = 0.0;
E1B_HS_8 = 0.0;
SVID2_8 = 0;
DELTA_A_8 = 0;
e_8 = 0;
omega_8 = 0;
delta_i_8 = 0;
Omega0_8 = 0;
Omega_dot_8 = 0;
DELTA_A_8 = 0.0;
e_8 = 0.0;
omega_8 = 0.0;
delta_i_8 = 0.0;
Omega0_8 = 0.0;
Omega_dot_8 = 0.0;
/*Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2)*/
// Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2)
IOD_a_9 = 0;
WN_a_9 = 0;
t0a_9 = 0;
M0_9 = 0;
af0_9 = 0;
af1_9 = 0;
E5b_HS_9 = 0;
E1B_HS_9 = 0;
WN_a_9 = 0.0;
t0a_9 = 0.0;
M0_9 = 0.0;
af0_9 = 0.0;
af1_9 = 0.0;
E5b_HS_9 = 0.0;
E1B_HS_9 = 0.0;
SVID3_9 = 0;
DELTA_A_9 = 0;
e_9 = 0;
omega_9 = 0;
delta_i_9 = 0;
DELTA_A_9 = 0.0;
e_9 = 0.0;
omega_9 = 0.0;
delta_i_9 = 0.0;
/*Word type 10: Almanac for SVID3 (2/2) and GST-GPS conversion parameters*/
// Word type 10: Almanac for SVID3 (2/2) and GST-GPS conversion parameters
IOD_a_10 = 0;
Omega0_10 = 0;
Omega_dot_10 = 0;
M0_10 = 0;
af0_10 = 0;
af1_10 = 0;
E5b_HS_10 = 0;
E1B_HS_10 = 0;
//GST-GPS
A_0G_10 = 0;
A_1G_10 = 0;
t_0G_10 = 0;
WN_0G_10 = 0;
Omega0_10 = 0.0;
Omega_dot_10 = 0.0;
M0_10 = 0.0;
af0_10 = 0.0;
af1_10 = 0.0;
E5b_HS_10 = 0.0;
E1B_HS_10 = 0.0;
/*Word type 0: I/NAV Spare Word*/
Time_0 = 0;
WN_0 = 0;
TOW_0 = 0;
// GST-GPS
A_0G_10 = 0.0;
A_1G_10 = 0.0;
t_0G_10 = 0.0;
WN_0G_10 = 0.0;
// Word type 0: I/NAV Spare Word
Time_0 = 0.0;
WN_0 = 0.0;
TOW_0 = 0.0;
flag_TOW_6 = false;
@ -258,13 +260,13 @@ bool Galileo_Navigation_Message::CRC_test(std::bitset<GALILEO_DATA_FRAME_BITS> b
}
uint64_t Galileo_Navigation_Message::read_navigation_unsigned(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter)
uint64_t Galileo_Navigation_Message::read_navigation_unsigned(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int32_t, int32_t> > parameter)
{
uint64_t value = 0;
int num_of_slices = parameter.size();
for (int i = 0; i < num_of_slices; i++)
int32_t num_of_slices = parameter.size();
for (int32_t i = 0; i < num_of_slices; i++)
{
for (int j = 0; j < parameter[i].second; j++)
for (int32_t j = 0; j < parameter[i].second; j++)
{
value <<= 1; //shift left
if (bits[GALILEO_DATA_JK_BITS - parameter[i].first - j] == 1)
@ -277,13 +279,13 @@ uint64_t Galileo_Navigation_Message::read_navigation_unsigned(std::bitset<GALILE
}
uint64_t Galileo_Navigation_Message::read_page_type_unsigned(std::bitset<GALILEO_PAGE_TYPE_BITS> bits, const std::vector<std::pair<int, int> > parameter)
uint64_t Galileo_Navigation_Message::read_page_type_unsigned(std::bitset<GALILEO_PAGE_TYPE_BITS> bits, const std::vector<std::pair<int32_t, int32_t> > parameter)
{
uint64_t value = 0;
int num_of_slices = parameter.size();
for (int i = 0; i < num_of_slices; i++)
int32_t num_of_slices = parameter.size();
for (int32_t i = 0; i < num_of_slices; i++)
{
for (int j = 0; j < parameter[i].second; j++)
for (int32_t j = 0; j < parameter[i].second; j++)
{
value <<= 1; //shift left
if (bits[GALILEO_PAGE_TYPE_BITS - parameter[i].first - j] == 1)
@ -296,30 +298,30 @@ uint64_t Galileo_Navigation_Message::read_page_type_unsigned(std::bitset<GALILEO
}
int64_t Galileo_Navigation_Message::read_navigation_signed(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter)
int64_t Galileo_Navigation_Message::read_navigation_signed(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int32_t, int32_t> > parameter)
{
int64_t value = 0;
int num_of_slices = parameter.size();
int32_t num_of_slices = parameter.size();
// Discriminate between 64 bits and 32 bits compiler
int long_int_size_bytes = sizeof(int64_t);
int32_t long_int_size_bytes = sizeof(long int);
if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system
{
// read the MSB and perform the sign extension
if (bits[GALILEO_DATA_JK_BITS - parameter[0].first] == 1)
{
value ^= 0xFFFFFFFFFFFFFFFF; //64 bits variable
value ^= 0xFFFFFFFFFFFFFFFF; // 64 bits variable
}
else
{
value &= 0;
}
for (int i = 0; i < num_of_slices; i++)
for (int32_t i = 0; i < num_of_slices; i++)
{
for (int j = 0; j < parameter[i].second; j++)
for (int32_t j = 0; j < parameter[i].second; j++)
{
value <<= 1; //shift left
value &= 0xFFFFFFFFFFFFFFFE; //reset the corresponding bit (for the 64 bits variable)
value <<= 1; // shift left
value &= 0xFFFFFFFFFFFFFFFE; // reset the corresponding bit (for the 64 bits variable)
if (bits[GALILEO_DATA_JK_BITS - parameter[i].first - j] == 1)
{
value += 1; // insert the bit
@ -339,12 +341,12 @@ int64_t Galileo_Navigation_Message::read_navigation_signed(std::bitset<GALILEO_D
value &= 0;
}
for (int i = 0; i < num_of_slices; i++)
for (int32_t i = 0; i < num_of_slices; i++)
{
for (int j = 0; j < parameter[i].second; j++)
for (int32_t j = 0; j < parameter[i].second; j++)
{
value <<= 1; //shift left
value &= 0xFFFFFFFE; //reset the corresponding bit
value <<= 1; // shift left
value &= 0xFFFFFFFE; // reset the corresponding bit
if (bits[GALILEO_DATA_JK_BITS - parameter[i].first - j] == 1)
{
value += 1; // insert the bit
@ -356,7 +358,7 @@ int64_t Galileo_Navigation_Message::read_navigation_signed(std::bitset<GALILEO_D
}
bool Galileo_Navigation_Message::read_navigation_bool(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter)
bool Galileo_Navigation_Message::read_navigation_bool(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int32_t, int32_t> > parameter)
{
bool value;
if (bits[GALILEO_DATA_JK_BITS - parameter[0].first] == 1)
@ -371,20 +373,20 @@ bool Galileo_Navigation_Message::read_navigation_bool(std::bitset<GALILEO_DATA_J
}
void Galileo_Navigation_Message::split_page(std::string page_string, int flag_even_word)
void Galileo_Navigation_Message::split_page(std::string page_string, int32_t flag_even_word)
{
// ToDo: Clean all the tests and create an independent google test code for the telemetry decoder.
//char correct_tail[7]="011110"; //the viterbi decoder output change the tail to this value (why?)
//char correct_tail[7]="000000";
int Page_type = 0;
//std::cout << "Start decoding Galileo I/NAV " << std::endl;
int32_t Page_type = 0;
// std::cout << "Start decoding Galileo I/NAV " << std::endl;
if (page_string.at(0) == '1') // if page is odd
{
//std::cout<< "page_string.at(0) split page="<<page_string.at(0) << std::endl;
// std::cout<< "page_string.at(0) split page="<<page_string.at(0) << std::endl;
std::string page_Odd = page_string;
//std::cout<<"Page odd string in split page"<< std::endl << page_Odd << std::endl;
// std::cout<<"Page odd string in split page"<< std::endl << page_Odd << std::endl;
if (flag_even_word == 1) // An odd page has been received but the previous even page is kept in memory and it is considered to join pages
{
@ -410,7 +412,7 @@ void Galileo_Navigation_Message::split_page(std::string page_string, int flag_ev
std::string Reserved_2 = page_INAV.substr(220, 8);
std::string Tail_odd = page_INAV.substr(228, 6);
//************ CRC checksum control *******/
// ************ CRC checksum control *******/
std::stringstream TLM_word_for_CRC_stream;
TLM_word_for_CRC_stream << page_INAV;
std::string TLM_word_for_CRC;
@ -428,7 +430,7 @@ void Galileo_Navigation_Message::split_page(std::string page_string, int flag_ev
// CRC correct: Decode word
std::string page_number_bits = Data_k.substr(0, 6);
std::bitset<GALILEO_PAGE_TYPE_BITS> page_type_bits(page_number_bits); // from string to bitset
Page_type = static_cast<int>(read_page_type_unsigned(page_type_bits, type));
Page_type = static_cast<int32_t>(read_page_type_unsigned(page_type_bits, type));
Page_type_time_stamp = Page_type;
std::string Data_jk_ephemeris = Data_k + Data_j;
page_jk_decoder(Data_jk_ephemeris.c_str());
@ -452,11 +454,11 @@ void Galileo_Navigation_Message::split_page(std::string page_string, int flag_ev
}
bool Galileo_Navigation_Message::have_new_ephemeris() //Check if we have a new ephemeris stored in the galileo navigation class
bool Galileo_Navigation_Message::have_new_ephemeris() // Check if we have a new ephemeris stored in the galileo navigation class
{
if ((flag_ephemeris_1 == true) and (flag_ephemeris_2 == true) and (flag_ephemeris_3 == true) and (flag_ephemeris_4 == true) and (flag_iono_and_GST == true))
{
//if all ephemeris pages have the same IOD, then they belong to the same block
// if all ephemeris pages have the same IOD, then they belong to the same block
if ((IOD_nav_1 == IOD_nav_2) and (IOD_nav_3 == IOD_nav_4) and (IOD_nav_1 == IOD_nav_3))
{
std::cout << "Ephemeris (1, 2, 3, 4) have been received and belong to the same batch" << std::endl;
@ -479,9 +481,9 @@ bool Galileo_Navigation_Message::have_new_ephemeris() //Check if we have a new
}
bool Galileo_Navigation_Message::have_new_iono_and_GST() //Check if we have a new iono data set stored in the galileo navigation class
bool Galileo_Navigation_Message::have_new_iono_and_GST() // Check if we have a new iono data set stored in the galileo navigation class
{
if ((flag_iono_and_GST == true) and (flag_utc_model == true)) //the condition on flag_utc_model is added to have a time stamp for iono
if ((flag_iono_and_GST == true) and (flag_utc_model == true)) // the condition on flag_utc_model is added to have a time stamp for iono
{
flag_iono_and_GST = false; // clear the flag
return true;
@ -503,11 +505,11 @@ bool Galileo_Navigation_Message::have_new_utc_model() // Check if we have a new
}
bool Galileo_Navigation_Message::have_new_almanac() //Check if we have a new almanac data set stored in the galileo navigation class
bool Galileo_Navigation_Message::have_new_almanac() // Check if we have a new almanac data set stored in the galileo navigation class
{
if ((flag_almanac_1 == true) and (flag_almanac_2 == true) and (flag_almanac_3 == true) and (flag_almanac_4 == true))
{
//All almanac have been received
// All almanac have been received
flag_almanac_1 = false;
flag_almanac_2 = false;
flag_almanac_3 = false;
@ -544,13 +546,13 @@ Galileo_Ephemeris Galileo_Navigation_Message::get_ephemeris()
ephemeris.C_is_4 = C_is_4; // Amplitude of the sine harmonic correction term to the angle of inclination [radians]
ephemeris.t0e_1 = t0e_1; // Ephemeris reference time [s]
/*Clock correction parameters*/
// Clock correction parameters
ephemeris.t0c_4 = t0c_4; // Clock correction data reference Time of Week [sec]
ephemeris.af0_4 = af0_4; // SV clock bias correction coefficient [s]
ephemeris.af1_4 = af1_4; // SV clock drift correction coefficient [s/s]
ephemeris.af2_4 = af2_4; // SV clock drift rate correction coefficient [s/s^2]
/*GST*/
// GST
ephemeris.WN_5 = WN_5; // Week number
ephemeris.TOW_5 = TOW_5; // Time of Week
@ -572,20 +574,19 @@ Galileo_Ephemeris Galileo_Navigation_Message::get_ephemeris()
Galileo_Iono Galileo_Navigation_Message::get_iono()
{
Galileo_Iono iono;
/*Ionospheric correction*/
/*Az*/
// Ionospheric correction
iono.ai0_5 = ai0_5; // Effective Ionisation Level 1st order parameter [sfu]
iono.ai1_5 = ai1_5; // Effective Ionisation Level 2st order parameter [sfu/degree]
iono.ai2_5 = ai2_5; // Effective Ionisation Level 3st order parameter [sfu/degree]
/*Ionospheric disturbance flag*/
// Ionospheric disturbance flag
iono.Region1_flag_5 = Region1_flag_5; // Ionospheric Disturbance Flag for region 1
iono.Region2_flag_5 = Region2_flag_5; // Ionospheric Disturbance Flag for region 2
iono.Region3_flag_5 = Region3_flag_5; // Ionospheric Disturbance Flag for region 3
iono.Region4_flag_5 = Region4_flag_5; // Ionospheric Disturbance Flag for region 4
iono.Region5_flag_5 = Region5_flag_5; // Ionospheric Disturbance Flag for region 5
/*GST*/
// GST
// This is the ONLY page containing the Week Number (WN)
iono.TOW_5 = TOW_5;
iono.WN_5 = WN_5;
@ -596,8 +597,7 @@ Galileo_Iono Galileo_Navigation_Message::get_iono()
Galileo_Utc_Model Galileo_Navigation_Message::get_utc_model()
{
Galileo_Utc_Model utc_model;
//Gal_utc_model.valid = flag_utc_model_valid;
/*Word type 6: GST-UTC conversion parameters*/
// Word type 6: GST-UTC conversion parameters
utc_model.A0_6 = A0_6;
utc_model.A1_6 = A1_6;
utc_model.Delta_tLS_6 = Delta_tLS_6;
@ -607,9 +607,6 @@ Galileo_Utc_Model Galileo_Navigation_Message::get_utc_model()
utc_model.DN_6 = DN_6;
utc_model.Delta_tLSF_6 = Delta_tLSF_6;
utc_model.flag_utc_model = flag_utc_model;
/*GST*/
//utc_model.WN_5 = WN_5; //Week number
//utc_model.TOW_5 = WN_5; //Time of Week
return utc_model;
}
@ -617,7 +614,7 @@ Galileo_Utc_Model Galileo_Navigation_Message::get_utc_model()
Galileo_Almanac Galileo_Navigation_Message::get_almanac()
{
Galileo_Almanac almanac;
/*Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number*/
// Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number
almanac.IOD_a_7 = IOD_a_7;
almanac.WN_a_7 = WN_a_7;
almanac.t0a_7 = t0a_7;
@ -630,7 +627,7 @@ Galileo_Almanac Galileo_Navigation_Message::get_almanac()
almanac.Omega_dot_7 = Omega_dot_7;
almanac.M0_7 = M0_7;
/*Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)*/
// Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)
almanac.IOD_a_8 = IOD_a_8;
almanac.af0_8 = af0_8;
almanac.af1_8 = af1_8;
@ -644,7 +641,7 @@ Galileo_Almanac Galileo_Navigation_Message::get_almanac()
almanac.Omega0_8 = Omega0_8;
almanac.Omega_dot_8 = Omega_dot_8;
/*Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2)*/
// Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2)
almanac.IOD_a_9 = IOD_a_9;
almanac.WN_a_9 = WN_a_9;
almanac.t0a_9 = t0a_9;
@ -659,7 +656,7 @@ Galileo_Almanac Galileo_Navigation_Message::get_almanac()
almanac.omega_9 = omega_9;
almanac.delta_i_9 = delta_i_9;
/*Word type 10: Almanac for SVID3 (2/2)*/
// Word type 10: Almanac for SVID3 (2/2)
almanac.IOD_a_10 = IOD_a_10;
almanac.Omega0_10 = Omega0_10;
almanac.Omega_dot_10 = Omega_dot_10;
@ -669,7 +666,7 @@ Galileo_Almanac Galileo_Navigation_Message::get_almanac()
almanac.E5b_HS_10 = E5b_HS_10;
almanac.E1B_HS_10 = E1B_HS_10;
/*GPS to Galileo GST conversion parameters*/
// GPS to Galileo GST conversion parameters
almanac.A_0G_10 = A_0G_10;
almanac.A_1G_10 = A_1G_10;
almanac.t_0G_10 = t_0G_10;
@ -679,21 +676,20 @@ Galileo_Almanac Galileo_Navigation_Message::get_almanac()
}
int Galileo_Navigation_Message::page_jk_decoder(const char *data_jk)
int32_t Galileo_Navigation_Message::page_jk_decoder(const char *data_jk)
{
int page_number = 0;
int32_t page_number = 0;
std::string data_jk_string = data_jk;
std::bitset<GALILEO_DATA_JK_BITS> data_jk_bits(data_jk_string);
//DLOG(INFO) << "Data_jk_bits (bitset) "<< endl << data_jk_bits << endl;
page_number = static_cast<int>(read_navigation_unsigned(data_jk_bits, PAGE_TYPE_bit));
page_number = static_cast<int32_t>(read_navigation_unsigned(data_jk_bits, PAGE_TYPE_bit));
LOG(INFO) << "Page number = " << page_number;
switch (page_number)
{
case 1: /*Word type 1: Ephemeris (1/4)*/
IOD_nav_1 = static_cast<int>(read_navigation_unsigned(data_jk_bits, IOD_nav_1_bit));
case 1: // Word type 1: Ephemeris (1/4)
IOD_nav_1 = static_cast<int32_t>(read_navigation_unsigned(data_jk_bits, IOD_nav_1_bit));
DLOG(INFO) << "IOD_nav_1= " << IOD_nav_1;
t0e_1 = static_cast<double>(read_navigation_unsigned(data_jk_bits, T0E_1_bit));
t0e_1 = t0e_1 * t0e_1_LSB;
@ -711,8 +707,8 @@ int Galileo_Navigation_Message::page_jk_decoder(const char *data_jk)
DLOG(INFO) << "flag_tow_set" << flag_TOW_set;
break;
case 2: /*Word type 2: Ephemeris (2/4)*/
IOD_nav_2 = static_cast<int>(read_navigation_unsigned(data_jk_bits, IOD_nav_2_bit));
case 2: // Word type 2: Ephemeris (2/4)
IOD_nav_2 = static_cast<int32_t>(read_navigation_unsigned(data_jk_bits, IOD_nav_2_bit));
DLOG(INFO) << "IOD_nav_2= " << IOD_nav_2;
OMEGA_0_2 = static_cast<double>(read_navigation_signed(data_jk_bits, OMEGA_0_2_bit));
OMEGA_0_2 = OMEGA_0_2 * OMEGA_0_2_LSB;
@ -730,8 +726,8 @@ int Galileo_Navigation_Message::page_jk_decoder(const char *data_jk)
DLOG(INFO) << "flag_tow_set" << flag_TOW_set;
break;
case 3: /*Word type 3: Ephemeris (3/4) and SISA*/
IOD_nav_3 = static_cast<int>(read_navigation_unsigned(data_jk_bits, IOD_nav_3_bit));
case 3: // Word type 3: Ephemeris (3/4) and SISA
IOD_nav_3 = static_cast<int32_t>(read_navigation_unsigned(data_jk_bits, IOD_nav_3_bit));
DLOG(INFO) << "IOD_nav_3= " << IOD_nav_3;
OMEGA_dot_3 = static_cast<double>(read_navigation_signed(data_jk_bits, OMEGA_dot_3_bit));
OMEGA_dot_3 = OMEGA_dot_3 * OMEGA_dot_3_LSB;
@ -757,10 +753,10 @@ int Galileo_Navigation_Message::page_jk_decoder(const char *data_jk)
DLOG(INFO) << "flag_tow_set" << flag_TOW_set;
break;
case 4: /* Word type 4: Ephemeris (4/4) and Clock correction parameters*/
IOD_nav_4 = static_cast<int>(read_navigation_unsigned(data_jk_bits, IOD_nav_4_bit));
case 4: // Word type 4: Ephemeris (4/4) and Clock correction parameters
IOD_nav_4 = static_cast<int32_t>(read_navigation_unsigned(data_jk_bits, IOD_nav_4_bit));
DLOG(INFO) << "IOD_nav_4= " << IOD_nav_4;
SV_ID_PRN_4 = static_cast<int>(read_navigation_unsigned(data_jk_bits, SV_ID_PRN_4_bit));
SV_ID_PRN_4 = static_cast<int32_t>(read_navigation_unsigned(data_jk_bits, SV_ID_PRN_4_bit));
DLOG(INFO) << "SV_ID_PRN_4= " << SV_ID_PRN_4;
C_ic_4 = static_cast<double>(read_navigation_signed(data_jk_bits, C_ic_4_bit));
C_ic_4 = C_ic_4 * C_ic_4_LSB;
@ -768,7 +764,7 @@ int Galileo_Navigation_Message::page_jk_decoder(const char *data_jk)
C_is_4 = static_cast<double>(read_navigation_signed(data_jk_bits, C_is_4_bit));
C_is_4 = C_is_4 * C_is_4_LSB;
DLOG(INFO) << "C_is_4= " << C_is_4;
/*Clock correction parameters*/
// Clock correction parameters
t0c_4 = static_cast<double>(read_navigation_unsigned(data_jk_bits, t0c_4_bit));
t0c_4 = t0c_4 * t0c_4_LSB;
DLOG(INFO) << "t0c_4= " << t0c_4;
@ -787,9 +783,8 @@ int Galileo_Navigation_Message::page_jk_decoder(const char *data_jk)
DLOG(INFO) << "flag_tow_set" << flag_TOW_set;
break;
case 5: /*Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST*/
/*Ionospheric correction*/
/*Az*/
case 5: // Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST
// Ionospheric correction
ai0_5 = static_cast<double>(read_navigation_unsigned(data_jk_bits, ai0_5_bit));
ai0_5 = ai0_5 * ai0_5_LSB;
DLOG(INFO) << "ai0_5= " << ai0_5;
@ -799,7 +794,7 @@ int Galileo_Navigation_Message::page_jk_decoder(const char *data_jk)
ai2_5 = static_cast<double>(read_navigation_signed(data_jk_bits, ai2_5_bit));
ai2_5 = ai2_5 * ai2_5_LSB;
DLOG(INFO) << "ai2_5= " << ai2_5;
/*Ionospheric disturbance flag*/
// Ionospheric disturbance flag
Region1_flag_5 = static_cast<bool>(read_navigation_bool(data_jk_bits, Region1_5_bit));
DLOG(INFO) << "Region1_flag_5= " << Region1_flag_5;
Region2_flag_5 = static_cast<bool>(read_navigation_bool(data_jk_bits, Region2_5_bit));
@ -824,20 +819,20 @@ int Galileo_Navigation_Message::page_jk_decoder(const char *data_jk)
DLOG(INFO) << "E5b_DVS_5= " << E5b_DVS_5;
E1B_DVS_5 = static_cast<double>(read_navigation_unsigned(data_jk_bits, E1B_DVS_5_bit));
DLOG(INFO) << "E1B_DVS_5= " << E1B_DVS_5;
/*GST*/
// GST
WN_5 = static_cast<double>(read_navigation_unsigned(data_jk_bits, WN_5_bit));
DLOG(INFO) << "WN_5= " << WN_5;
TOW_5 = static_cast<double>(read_navigation_unsigned(data_jk_bits, TOW_5_bit));
DLOG(INFO) << "TOW_5= " << TOW_5;
flag_TOW_5 = true; //set to false externally
flag_TOW_5 = true; // set to false externally
spare_5 = static_cast<double>(read_navigation_unsigned(data_jk_bits, spare_5_bit));
DLOG(INFO) << "spare_5= " << spare_5;
flag_iono_and_GST = true; //set to false externally
flag_TOW_set = true; //set to false externally
flag_iono_and_GST = true; // set to false externally
flag_TOW_set = true; // set to false externally
DLOG(INFO) << "flag_tow_set" << flag_TOW_set;
break;
case 6: /*Word type 6: GST-UTC conversion parameters*/
case 6: // Word type 6: GST-UTC conversion parameters
A0_6 = static_cast<double>(read_navigation_signed(data_jk_bits, A0_6_bit));
A0_6 = A0_6 * A0_6_LSB;
DLOG(INFO) << "A0_6= " << A0_6;
@ -859,13 +854,13 @@ int Galileo_Navigation_Message::page_jk_decoder(const char *data_jk)
DLOG(INFO) << "Delta_tLSF_6= " << Delta_tLSF_6;
TOW_6 = static_cast<double>(read_navigation_unsigned(data_jk_bits, TOW_6_bit));
DLOG(INFO) << "TOW_6= " << TOW_6;
flag_TOW_6 = true; //set to false externally
flag_utc_model = true; //set to false externally
flag_TOW_set = true; //set to false externally
flag_TOW_6 = true; // set to false externally
flag_utc_model = true; // set to false externally
flag_TOW_set = true; // set to false externally
DLOG(INFO) << "flag_tow_set" << flag_TOW_set;
break;
case 7: /*Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number*/
case 7: // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number
IOD_a_7 = static_cast<double>(read_navigation_unsigned(data_jk_bits, IOD_a_7_bit));
DLOG(INFO) << "IOD_a_7= " << IOD_a_7;
WN_a_7 = static_cast<double>(read_navigation_unsigned(data_jk_bits, WN_a_7_bit));
@ -900,7 +895,7 @@ int Galileo_Navigation_Message::page_jk_decoder(const char *data_jk)
DLOG(INFO) << "flag_tow_set" << flag_TOW_set;
break;
case 8: /*Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)*/
case 8: // Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)*/
IOD_a_8 = static_cast<double>(read_navigation_unsigned(data_jk_bits, IOD_a_8_bit));
DLOG(INFO) << "IOD_a_8= " << IOD_a_8;
af0_8 = static_cast<double>(read_navigation_signed(data_jk_bits, af0_8_bit));
@ -937,7 +932,7 @@ int Galileo_Navigation_Message::page_jk_decoder(const char *data_jk)
DLOG(INFO) << "flag_tow_set" << flag_TOW_set;
break;
case 9: /*Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2)*/
case 9: // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2)
IOD_a_9 = static_cast<double>(read_navigation_unsigned(data_jk_bits, IOD_a_9_bit));
DLOG(INFO) << "IOD_a_9= " << IOD_a_9;
WN_a_9 = static_cast<double>(read_navigation_unsigned(data_jk_bits, WN_a_9_bit));
@ -976,7 +971,7 @@ int Galileo_Navigation_Message::page_jk_decoder(const char *data_jk)
DLOG(INFO) << "flag_tow_set" << flag_TOW_set;
break;
case 10: /*Word type 10: Almanac for SVID3 (2/2) and GST-GPS conversion parameters*/
case 10: // Word type 10: Almanac for SVID3 (2/2) and GST-GPS conversion parameters
IOD_a_10 = static_cast<double>(read_navigation_unsigned(data_jk_bits, IOD_a_10_bit));
DLOG(INFO) << "IOD_a_10= " << IOD_a_10;
Omega0_10 = static_cast<double>(read_navigation_signed(data_jk_bits, Omega0_10_bit));
@ -1017,7 +1012,7 @@ int Galileo_Navigation_Message::page_jk_decoder(const char *data_jk)
DLOG(INFO) << "flag_tow_set" << flag_TOW_set;
break;
case 0: /*Word type 0: I/NAV Spare Word*/
case 0: // Word type 0: I/NAV Spare Word
Time_0 = static_cast<double>(read_navigation_unsigned(data_jk_bits, Time_0_bit));
DLOG(INFO) << "Time_0= " << Time_0;
WN_0 = static_cast<double>(read_navigation_unsigned(data_jk_bits, WN_0_bit));

View File

@ -38,7 +38,6 @@
#include "galileo_almanac.h"
#include "galileo_utc_model.h"
#include "Galileo_E1.h"
//#include <boost/cstdint.hpp> // for boost::uint32_t
#include <bitset>
#include <cstdint>
#include <map>
@ -56,15 +55,14 @@ class Galileo_Navigation_Message
{
private:
bool CRC_test(std::bitset<GALILEO_DATA_FRAME_BITS> bits, uint32_t checksum);
bool read_navigation_bool(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter);
//void print_galileo_word_bytes(unsigned int GPS_word);
uint64_t read_navigation_unsigned(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter);
uint64_t read_page_type_unsigned(std::bitset<GALILEO_PAGE_TYPE_BITS> bits, const std::vector<std::pair<int, int> > parameter);
int64_t read_navigation_signed(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter);
bool read_navigation_bool(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int32_t, int32_t> > parameter);
uint64_t read_navigation_unsigned(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int32_t, int32_t> > parameter);
uint64_t read_page_type_unsigned(std::bitset<GALILEO_PAGE_TYPE_BITS> bits, const std::vector<std::pair<int32_t, int32_t> > parameter);
int64_t read_navigation_signed(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int32_t, int32_t> > parameter);
public:
int Page_type_time_stamp;
int flag_even_word;
int32_t Page_type_time_stamp;
int32_t flag_even_word;
std::string page_Even;
bool flag_CRC_test;
bool flag_all_ephemeris; //!< Flag indicating that all words containing ephemeris have been received
@ -85,7 +83,7 @@ public:
bool flag_almanac_3; //!< Flag indicating that almanac 3/4 (word 9) have been received
bool flag_almanac_4; //!< Flag indicating that almanac 4/4 (word 10) have been received
int IOD_ephemeris;
int32_t IOD_ephemeris;
bool flag_GGTO;
bool flag_GGTO_1;
@ -93,22 +91,22 @@ public:
bool flag_GGTO_3;
bool flag_GGTO_4;
/*Word type 1: Ephemeris (1/4)*/
int IOD_nav_1; //!< IOD_nav page 1
double t0e_1; //!< Ephemeris reference time [s]
double M0_1; //!< Mean anomaly at reference time [semi-circles]
double e_1; //!< Eccentricity
double A_1; //!< Square root of the semi-major axis [meters^1/2]
// Word type 1: Ephemeris (1/4)
int32_t IOD_nav_1; //!< IOD_nav page 1
double t0e_1; //!< Ephemeris reference time [s]
double M0_1; //!< Mean anomaly at reference time [semi-circles]
double e_1; //!< Eccentricity
double A_1; //!< Square root of the semi-major axis [meters^1/2]
/*Word type 2: Ephemeris (2/4)*/
int IOD_nav_2; //!< IOD_nav page 2
double OMEGA_0_2; //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
double i_0_2; //!< Inclination angle at reference time [semi-circles]
double omega_2; //!< Argument of perigee [semi-circles]
double iDot_2; //!< Rate of inclination angle [semi-circles/sec]
// Word type 2: Ephemeris (2/4)
int32_t IOD_nav_2; //!< IOD_nav page 2
double OMEGA_0_2; //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
double i_0_2; //!< Inclination angle at reference time [semi-circles]
double omega_2; //!< Argument of perigee [semi-circles]
double iDot_2; //!< Rate of inclination angle [semi-circles/sec]
/*Word type 3: Ephemeris (3/4) and SISA*/
int IOD_nav_3; //
// Word type 3: Ephemeris (3/4) and SISA
int32_t IOD_nav_3; //
double OMEGA_dot_3; //!< Rate of right ascension [semi-circles/sec]
double delta_n_3; //!< Mean motion difference from computed value [semi-circles/sec]
double C_uc_3; //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians]
@ -117,25 +115,26 @@ public:
double C_rs_3; //!< Amplitude of the sine harmonic correction term to the orbit radius [meters]
double SISA_3;
/*Word type 4: Ephemeris (4/4) and Clock correction parameters*/
int IOD_nav_4; //
int SV_ID_PRN_4; //
double C_ic_4; //!<Amplitude of the cosine harmonic correction term to the angle of inclination [radians]
double C_is_4; //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians]
/*Clock correction parameters*/
// Word type 4: Ephemeris (4/4) and Clock correction parameters*/
int32_t IOD_nav_4; //
int32_t SV_ID_PRN_4; //
double C_ic_4; //!<Amplitude of the cosine harmonic correction term to the angle of inclination [radians]
double C_is_4; //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians]
// Clock correction parameters
double t0c_4; //!< Clock correction data reference Time of Week [sec]
double af0_4; //!< SV clock bias correction coefficient [s]
double af1_4; //!< SV clock drift correction coefficient [s/s]
double af2_4; //!< clock drift rate correction coefficient [s/s^2]
double spare_4;
/* Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST*/
/* Ionospheric correction*/
// Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST*/
// Ionospheric correction
double ai0_5; //!< Effective Ionisation Level 1st order parameter [sfu]
double ai1_5; //!< Effective Ionisation Level 2st order parameter [sfu/degree]
double ai2_5; //!< Effective Ionisation Level 3st order parameter [sfu/degree]
/*Ionospheric disturbance flag*/
// Ionospheric disturbance flag
bool Region1_flag_5; //!< Ionospheric Disturbance Flag for region 1
bool Region2_flag_5; //!< Ionospheric Disturbance Flag for region 2
bool Region3_flag_5; //!< Ionospheric Disturbance Flag for region 3
@ -148,12 +147,13 @@ public:
double E1B_HS_5; //!< E1B Signal Health Status
double E5b_DVS_5; //!< E5b Data Validity Status
double E1B_DVS_5; //!< E1B Data Validity Status
/*GST*/
// GST
double WN_5;
double TOW_5;
double spare_5;
/* Word type 6: GST-UTC conversion parameters */
// Word type 6: GST-UTC conversion parameters
double A0_6;
double A1_6;
double Delta_tLS_6;
@ -164,11 +164,11 @@ public:
double Delta_tLSF_6;
double TOW_6;
/* Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number */
int IOD_a_7;
// Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number
int32_t IOD_a_7;
double WN_a_7;
double t0a_7;
int SVID1_7;
int32_t SVID1_7;
double DELTA_A_7;
double e_7;
double omega_7;
@ -177,13 +177,13 @@ public:
double Omega_dot_7;
double M0_7;
/* Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2) */
int IOD_a_8;
// Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)
int32_t IOD_a_8;
double af0_8;
double af1_8;
double E5b_HS_8;
double E1B_HS_8;
int SVID2_8;
int32_t SVID2_8;
double DELTA_A_8;
double e_8;
double omega_8;
@ -191,8 +191,8 @@ public:
double Omega0_8;
double Omega_dot_8;
/* Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) */
int IOD_a_9;
// Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2)
int32_t IOD_a_9;
double WN_a_9;
double t0a_9;
double M0_9;
@ -200,14 +200,14 @@ public:
double af1_9;
double E5b_HS_9;
double E1B_HS_9;
int SVID3_9;
int32_t SVID3_9;
double DELTA_A_9;
double e_9;
double omega_9;
double delta_i_9;
/* Word type 10: Almanac for SVID3 (2/2) and GST-GPS conversion parameters */
int IOD_a_10;
// Word type 10: Almanac for SVID3 (2/2) and GST-GPS conversion parameters
int32_t IOD_a_10;
double Omega0_10;
double Omega_dot_10;
double M0_10;
@ -215,12 +215,14 @@ public:
double af1_10;
double E5b_HS_10;
double E1B_HS_10;
// GST-GPS conversion
double A_0G_10; //!< Constant term of the offset Delta t systems
double A_1G_10; //!< Rate of change of the offset Delta t systems
double t_0G_10; //!< Reference time for Galileo/GPS Time Offset (GGTO) data
double WN_0G_10; //!< Week Number of Galileo/GPS Time Offset (GGTO) reference
/*Word type 0: I/NAV Spare Word*/
// Word type 0: I/NAV Spare Word
double Time_0;
double WN_0;
double TOW_0;
@ -232,6 +234,7 @@ public:
double galileo_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 galileo_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system.
double galileo_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 galileo_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m]
double galileo_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m]
@ -240,14 +243,14 @@ public:
/*
* \brief Takes in input a page (Odd or Even) of 120 bit, split it according ICD 4.3.2.3 and join Data_k with Data_j
*/
void split_page(std::string page_string, int flag_even_word);
void split_page(std::string page_string, int32_t flag_even_word);
/*
* \brief Takes in input Data_jk (128 bit) and split it in ephemeris parameters according ICD 4.3.5
*
* Takes in input Data_jk (128 bit) and split it in ephemeris parameters according ICD 4.3.5
*/
int page_jk_decoder(const char *data_jk);
int32_t page_jk_decoder(const char *data_jk);
void reset();

View File

@ -33,19 +33,19 @@
Galileo_Utc_Model::Galileo_Utc_Model()
{
//valid = false;
/*Word type 6: GST-UTC conversion parameters*/
A0_6 = 0;
A1_6 = 0;
Delta_tLS_6 = 0;
t0t_6 = 0;
WNot_6 = 0;
WN_LSF_6 = 0;
DN_6 = 0;
Delta_tLSF_6 = 0;
// Word type 6: GST-UTC conversion parameters
A0_6 = 0.0;
A1_6 = 0.0;
Delta_tLS_6 = 0.0;
t0t_6 = 0.0;
WNot_6 = 0.0;
WN_LSF_6 = 0.0;
DN_6 = 0.0;
Delta_tLSF_6 = 0.0;
flag_utc_model = false;
}
double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int WN)
{
double t_Utc;
@ -56,7 +56,7 @@ double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int WN)
if ((weeksToLeapSecondEvent) >= 0) // is not in the past
{
//Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s
// Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s
int secondOfLeapSecondEvent = DN_6 * 24 * 60 * 60;
if (std::abs(t_e - secondOfLeapSecondEvent) > 21600)
{
@ -74,7 +74,7 @@ double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int WN)
{
/* 5.1.7b GST->UTC case b
* Whenever the user's current time falls within the time span of six hours
* prior to the leap second adjustment to six hours after the adjustment time, ,
* prior to the leap second adjustment to six hours after the adjustment time,
* the effective time is computed according to the following equations:
*/
Delta_t_Utc = Delta_tLS_6 + A0_6 + A1_6 * (t_e - t0t_6 + 604800 * static_cast<double>((WN % 256) - WNot_6));

View File

@ -42,7 +42,7 @@
class Galileo_Utc_Model
{
public:
/*Word type 6: GST-UTC conversion parameters*/
// Word type 6: GST-UTC conversion parameters
double A0_6;
double A1_6;
double Delta_tLS_6;

View File

@ -35,8 +35,8 @@
Glonass_Gnav_Almanac::Glonass_Gnav_Almanac()
{
i_satellite_freq_channel = 0;
i_satellite_PRN = 0;
i_satellite_slot_number = 0;
i_satellite_PRN = 0U;
i_satellite_slot_number = 0U;
d_n_A = 0.0;
d_H_n_A = 0.0;

View File

@ -35,6 +35,7 @@
#define GNSS_SDR_GLONASS_ALMANAC_H_
#include <boost/serialization/nvp.hpp>
#include <cstdint>
/*!
* \brief This class is a storage for the GLONASS SV ALMANAC data as described GLONASS ICD (Edition 5.1)
@ -60,15 +61,15 @@ public:
bool d_l_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
// Satellite Identification Information
int i_satellite_freq_channel; //!< SV Frequency Channel Number
unsigned int i_satellite_PRN; //!< SV PRN Number, equivalent to slot number for compatibility with GPS
unsigned int i_satellite_slot_number; //!< SV Slot Number
int32_t i_satellite_freq_channel; //!< SV Frequency Channel Number
uint32_t i_satellite_PRN; //!< SV PRN Number, equivalent to slot number for compatibility with GPS
uint32_t i_satellite_slot_number; //!< SV Slot Number
template <class Archive>
/*!
* \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the almanac data on disk file.
*/
void serialize(Archive& archive, const unsigned int version)
void serialize(Archive& archive, const uint32_t version)
{
using boost::serialization::make_nvp;
if (version)

View File

@ -69,8 +69,8 @@ Glonass_Gnav_Ephemeris::Glonass_Gnav_Ephemeris()
// Satellite Identification Information
i_satellite_freq_channel = 0; //!< SV Frequency Channel Number
i_satellite_PRN = 0; //!< SV PRN Number, equivalent to slot number for compatibility with GPS
i_satellite_slot_number = 0; //!< SV Slot Number
i_satellite_PRN = 0U; //!< SV PRN Number, equivalent to slot number for compatibility with GPS
i_satellite_slot_number = 0U; //!< SV Slot Number
d_yr = 1972; //!< Current year, defaults to 1972 (UTC Epoch with leap seconds)
d_satClkDrift = 0.0; //!< GLONASS clock error
d_dtr = 0.0; //!< relativistic clock correction term

View File

@ -37,7 +37,7 @@
#include <boost/serialization/nvp.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <cstdint>
/*!
* \brief This class is a storage and orbital model functions for the GLONASS SV ephemeris data as described in GLONASS ICD (Edition 5.1)
@ -86,26 +86,26 @@ public:
bool d_l3rd_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is healthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
bool d_l5th_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is healthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
// Inmediate deliverables of ephemeris information
// Immediate deliverables of ephemeris information
// Satellite Identification Information
int i_satellite_freq_channel; //!< SV Frequency Channel Number
unsigned int i_satellite_PRN; //!< SV PRN Number, equivalent to slot number for compatibility with GPS
unsigned int i_satellite_slot_number; //!< SV Slot Number
double d_yr; //!< Current year
double d_satClkDrift; //!< GLONASS clock error
double d_dtr; //!< relativistic clock correction term
double d_iode; //!< Issue of data, ephemeris (Bit 0-6 of tb)
double d_tau_c; //!< GLONASST 2 UTC correction (todo) may be eliminated
double d_TOW; //!< GLONASST IN GPST seconds of week
double d_WN; //!< GLONASST IN GPST week number of the start of frame
double d_tod; //!< Time of Day since ephemeris where decoded
int32_t i_satellite_freq_channel; //!< SV Frequency Channel Number
uint32_t i_satellite_PRN; //!< SV PRN Number, equivalent to slot number for compatibility with GPS
uint32_t i_satellite_slot_number; //!< SV Slot Number
double d_yr; //!< Current year
double d_satClkDrift; //!< GLONASS clock error
double d_dtr; //!< relativistic clock correction term
double d_iode; //!< Issue of data, ephemeris (Bit 0-6 of tb)
double d_tau_c; //!< GLONASST 2 UTC correction (todo) may be eliminated
double d_TOW; //!< GLONASST IN GPST seconds of week
double d_WN; //!< GLONASST IN GPST week number of the start of frame
double d_tod; //!< Time of Day since ephemeris where decoded
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)
void serialize(Archive& archive, const uint32_t version)
{
using boost::serialization::make_nvp;
if (version)

View File

@ -38,8 +38,8 @@
void Glonass_Gnav_Navigation_Message::reset()
{
// Satellite Identification
i_satellite_PRN = 0;
i_alm_satellite_slot_number = 0; //!< SV Orbit Slot Number
i_satellite_PRN = 0U;
i_alm_satellite_slot_number = 0; // SV Orbit Slot Number
flag_update_slot_number = false;
// Ephmeris Flags
@ -63,17 +63,17 @@ void Glonass_Gnav_Navigation_Message::reset()
flag_almanac_str_15 = false;
// UTC and System Clocks Flags
flag_utc_model_valid = false; //!< If set, it indicates that the UTC model parameters are filled
flag_utc_model_str_5 = false; //!< Clock info send in string 5 of navigation data
flag_utc_model_str_15 = false; //!< Clock info send in string 15 of frame 5 of navigation data
flag_utc_model_valid = false; // If set, it indicates that the UTC model parameters are filled
flag_utc_model_str_5 = false; // Clock info send in string 5 of navigation data
flag_utc_model_str_15 = false; // Clock info send in string 15 of frame 5 of navigation data
// broadcast orbit 1
flag_TOW_set = false;
flag_TOW_new = false;
flag_CRC_test = false;
d_frame_ID = 0;
d_string_ID = 0;
d_frame_ID = 0U;
d_string_ID = 0U;
i_channel_ID = 0;
// Clock terms
@ -83,15 +83,15 @@ void Glonass_Gnav_Navigation_Message::reset()
// Data update information
d_previous_tb = 0.0;
for (unsigned int i = 0; i < GLONASS_CA_NBR_SATS; i++)
for (uint32_t i = 0; i < GLONASS_CA_NBR_SATS; i++)
d_previous_Na[i] = 0.0;
std::map<int, std::string> satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus
std::map<int, std::string> satelliteBlock; // Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus
auto gnss_sat = Gnss_Satellite();
std::string _system("GLONASS");
//TODO SHould number of channels be hardcoded?
for (unsigned int i = 1; i < 14; i++)
for (uint32_t i = 1; i < 14; i++)
{
satelliteBlock[i] = gnss_sat.what_block(_system, i);
}
@ -106,94 +106,94 @@ Glonass_Gnav_Navigation_Message::Glonass_Gnav_Navigation_Message()
bool Glonass_Gnav_Navigation_Message::CRC_test(std::bitset<GLONASS_GNAV_STRING_BITS> bits)
{
int sum_bits = 0;
int sum_hamming = 0;
int C1 = 0;
int C2 = 0;
int C3 = 0;
int C4 = 0;
int C5 = 0;
int C6 = 0;
int C7 = 0;
int C_Sigma = 0;
std::vector<int> string_bits(GLONASS_GNAV_STRING_BITS);
int32_t sum_bits = 0;
int32_t sum_hamming = 0;
int32_t C1 = 0;
int32_t C2 = 0;
int32_t C3 = 0;
int32_t C4 = 0;
int32_t C5 = 0;
int32_t C6 = 0;
int32_t C7 = 0;
int32_t C_Sigma = 0;
std::vector<int32_t> string_bits(GLONASS_GNAV_STRING_BITS);
//!< Populate data and hamming code vectors
for (int i = 0; i < static_cast<int>(GLONASS_GNAV_STRING_BITS); i++)
// Populate data and hamming code vectors
for (int32_t i = 0; i < static_cast<int32_t>(GLONASS_GNAV_STRING_BITS); i++)
{
string_bits[i] = static_cast<int>(bits[i]);
string_bits[i] = static_cast<int32_t>(bits[i]);
}
//!< Compute C1 term
// Compute C1 term
sum_bits = 0;
for (int i = 0; i < static_cast<int>(GLONASS_GNAV_CRC_I_INDEX.size()); i++)
for (int32_t i = 0; i < static_cast<int32_t>(GLONASS_GNAV_CRC_I_INDEX.size()); i++)
{
sum_bits += string_bits[GLONASS_GNAV_CRC_I_INDEX[i] - 1];
}
C1 = string_bits[0] ^ (sum_bits % 2);
//!< Compute C2 term
// Compute C2 term
sum_bits = 0;
for (int j = 0; j < static_cast<int>(GLONASS_GNAV_CRC_J_INDEX.size()); j++)
for (int32_t j = 0; j < static_cast<int32_t>(GLONASS_GNAV_CRC_J_INDEX.size()); j++)
{
sum_bits += string_bits[GLONASS_GNAV_CRC_J_INDEX[j] - 1];
}
C2 = (string_bits[1]) ^ (sum_bits % 2);
//!< Compute C3 term
// Compute C3 term
sum_bits = 0;
for (int k = 0; k < static_cast<int>(GLONASS_GNAV_CRC_K_INDEX.size()); k++)
for (int32_t k = 0; k < static_cast<int32_t>(GLONASS_GNAV_CRC_K_INDEX.size()); k++)
{
sum_bits += string_bits[GLONASS_GNAV_CRC_K_INDEX[k] - 1];
}
C3 = string_bits[2] ^ (sum_bits % 2);
//!< Compute C4 term
// Compute C4 term
sum_bits = 0;
for (int l = 0; l < static_cast<int>(GLONASS_GNAV_CRC_L_INDEX.size()); l++)
for (int32_t l = 0; l < static_cast<int32_t>(GLONASS_GNAV_CRC_L_INDEX.size()); l++)
{
sum_bits += string_bits[GLONASS_GNAV_CRC_L_INDEX[l] - 1];
}
C4 = string_bits[3] ^ (sum_bits % 2);
//!< Compute C5 term
// Compute C5 term
sum_bits = 0;
for (int m = 0; m < static_cast<int>(GLONASS_GNAV_CRC_M_INDEX.size()); m++)
for (int32_t m = 0; m < static_cast<int32_t>(GLONASS_GNAV_CRC_M_INDEX.size()); m++)
{
sum_bits += string_bits[GLONASS_GNAV_CRC_M_INDEX[m] - 1];
}
C5 = string_bits[4] ^ (sum_bits % 2);
//!< Compute C6 term
// Compute C6 term
sum_bits = 0;
for (int n = 0; n < static_cast<int>(GLONASS_GNAV_CRC_N_INDEX.size()); n++)
for (int32_t n = 0; n < static_cast<int32_t>(GLONASS_GNAV_CRC_N_INDEX.size()); n++)
{
sum_bits += string_bits[GLONASS_GNAV_CRC_N_INDEX[n] - 1];
}
C6 = string_bits[5] ^ (sum_bits % 2);
//!< Compute C7 term
// Compute C7 term
sum_bits = 0;
for (int p = 0; p < static_cast<int>(GLONASS_GNAV_CRC_P_INDEX.size()); p++)
for (int32_t p = 0; p < static_cast<int32_t>(GLONASS_GNAV_CRC_P_INDEX.size()); p++)
{
sum_bits += string_bits[GLONASS_GNAV_CRC_P_INDEX[p] - 1];
}
C7 = string_bits[6] ^ (sum_bits % 2);
//!< Compute C_Sigma term
// Compute C_Sigma term
sum_bits = 0;
sum_hamming = 0;
for (int q = 0; q < static_cast<int>(GLONASS_GNAV_CRC_Q_INDEX.size()); q++)
for (int32_t q = 0; q < static_cast<int32_t>(GLONASS_GNAV_CRC_Q_INDEX.size()); q++)
{
sum_bits += string_bits[GLONASS_GNAV_CRC_Q_INDEX[q] - 1];
}
for (int q = 0; q < 8; q++)
for (int32_t q = 0; q < 8; q++)
{
sum_hamming += string_bits[q];
}
C_Sigma = (sum_hamming % 2) ^ (sum_bits % 2);
//!< Verification of the data
// Verification of the data
// (a-i) All checksums (C1,...,C7 and C_Sigma) are equal to zero
if ((C1 + C2 + C3 + C4 + C5 + C6 + C7 + C_Sigma) == 0)
{
@ -212,7 +212,7 @@ bool Glonass_Gnav_Navigation_Message::CRC_test(std::bitset<GLONASS_GNAV_STRING_B
}
bool Glonass_Gnav_Navigation_Message::read_navigation_bool(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter)
bool Glonass_Gnav_Navigation_Message::read_navigation_bool(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter)
{
bool value;
@ -228,13 +228,13 @@ bool Glonass_Gnav_Navigation_Message::read_navigation_bool(std::bitset<GLONASS_G
}
uint64_t Glonass_Gnav_Navigation_Message::read_navigation_unsigned(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter)
uint64_t Glonass_Gnav_Navigation_Message::read_navigation_unsigned(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter)
{
uint64_t value = 0;
int num_of_slices = parameter.size();
for (int i = 0; i < num_of_slices; i++)
int32_t num_of_slices = parameter.size();
for (int32_t i = 0; i < num_of_slices; i++)
{
for (int j = 0; j < parameter[i].second; j++)
for (int32_t j = 0; j < parameter[i].second; j++)
{
value <<= 1; //shift left
if (bits[GLONASS_GNAV_STRING_BITS - parameter[i].first - j] == 1)
@ -247,11 +247,11 @@ uint64_t Glonass_Gnav_Navigation_Message::read_navigation_unsigned(std::bitset<G
}
int64_t Glonass_Gnav_Navigation_Message::read_navigation_signed(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter)
int64_t Glonass_Gnav_Navigation_Message::read_navigation_signed(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter)
{
int64_t value = 0;
int64_t sign = 0;
int num_of_slices = parameter.size();
int32_t num_of_slices = parameter.size();
// read the MSB and perform the sign extension
if (bits[GLONASS_GNAV_STRING_BITS - parameter[0].first] == 1)
{
@ -261,9 +261,9 @@ int64_t Glonass_Gnav_Navigation_Message::read_navigation_signed(std::bitset<GLON
{
sign = 1;
}
for (int i = 0; i < num_of_slices; i++)
for (int32_t i = 0; i < num_of_slices; i++)
{
for (int j = 1; j < parameter[i].second; j++)
for (int32_t j = 1; j < parameter[i].second; j++)
{
value <<= 1; //shift left
if (bits[GLONASS_GNAV_STRING_BITS - parameter[i].first - j] == 1)
@ -276,9 +276,9 @@ int64_t Glonass_Gnav_Navigation_Message::read_navigation_signed(std::bitset<GLON
}
unsigned int Glonass_Gnav_Navigation_Message::get_frame_number(unsigned int satellite_slot_number)
uint32_t Glonass_Gnav_Navigation_Message::get_frame_number(uint32_t satellite_slot_number)
{
unsigned int frame_ID = 0;
uint32_t frame_ID = 0;
if (satellite_slot_number >= 1 and satellite_slot_number <= 5)
{
@ -310,9 +310,9 @@ unsigned int Glonass_Gnav_Navigation_Message::get_frame_number(unsigned int sate
}
int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
int32_t Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
{
int J = 0;
int32_t J = 0;
d_string_ID = 0;
d_frame_ID = 0;
@ -325,11 +325,11 @@ int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
return 0;
// Decode all 15 string messages
d_string_ID = static_cast<unsigned int>(read_navigation_unsigned(string_bits, STRING_ID));
d_string_ID = static_cast<uint32_t>(read_navigation_unsigned(string_bits, STRING_ID));
switch (d_string_ID)
{
case 1:
//--- It is string 1 -----------------------------------------------
// --- It is string 1 -----------------------------------------------
gnav_ephemeris.d_P_1 = (static_cast<double>(read_navigation_unsigned(string_bits, P1)) + 1) * 15;
gnav_ephemeris.d_t_k = static_cast<double>(read_navigation_unsigned(string_bits, T_K_HR)) * 3600 +
static_cast<double>(read_navigation_unsigned(string_bits, T_K_MIN)) * 60 +
@ -343,7 +343,7 @@ int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
break;
case 2:
//--- It is string 2 -----------------------------------------------
// --- It is string 2 -----------------------------------------------
if (flag_ephemeris_str_1 == true)
{
gnav_ephemeris.d_B_n = static_cast<double>(read_navigation_unsigned(string_bits, B_N));
@ -391,8 +391,8 @@ int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
// Fill in ephemeris deliverables in the code
flag_update_slot_number = true;
gnav_ephemeris.i_satellite_slot_number = static_cast<unsigned int>(gnav_ephemeris.d_n);
gnav_ephemeris.i_satellite_PRN = static_cast<unsigned int>(gnav_ephemeris.d_n);
gnav_ephemeris.i_satellite_slot_number = static_cast<uint32_t>(gnav_ephemeris.d_n);
gnav_ephemeris.i_satellite_PRN = static_cast<uint32_t>(gnav_ephemeris.d_n);
flag_ephemeris_str_4 = true;
}
@ -449,7 +449,7 @@ int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
case 6:
// --- It is string 6 ----------------------------------------------
i_alm_satellite_slot_number = static_cast<unsigned int>(read_navigation_unsigned(string_bits, n_A));
i_alm_satellite_slot_number = static_cast<uint32_t>(read_navigation_unsigned(string_bits, n_A));
d_frame_ID = get_frame_number(i_alm_satellite_slot_number);
// Make sure a valid frame_ID or satellite slot number is returned
if (d_frame_ID == 0)
@ -497,7 +497,7 @@ int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
case 8:
// --- It is string 8 ----------------------------------------------
i_alm_satellite_slot_number = static_cast<unsigned int>(read_navigation_unsigned(string_bits, n_A));
i_alm_satellite_slot_number = static_cast<uint32_t>(read_navigation_unsigned(string_bits, n_A));
d_frame_ID = get_frame_number(i_alm_satellite_slot_number);
// Make sure a valid frame_ID or satellite slot number is returned
if (d_frame_ID == 0)
@ -540,7 +540,7 @@ int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
case 10:
// --- It is string 10 ---------------------------------------------
i_alm_satellite_slot_number = static_cast<unsigned int>(read_navigation_unsigned(string_bits, n_A));
i_alm_satellite_slot_number = static_cast<uint32_t>(read_navigation_unsigned(string_bits, n_A));
d_frame_ID = get_frame_number(i_alm_satellite_slot_number);
// Make sure a valid frame_ID or satellite slot number is returned
if (d_frame_ID == 0)
@ -583,7 +583,7 @@ int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
case 12:
// --- It is string 12 ---------------------------------------------
i_alm_satellite_slot_number = static_cast<unsigned int>(read_navigation_unsigned(string_bits, n_A));
i_alm_satellite_slot_number = static_cast<uint32_t>(read_navigation_unsigned(string_bits, n_A));
d_frame_ID = get_frame_number(i_alm_satellite_slot_number);
// Make sure a valid frame_ID or satellite slot number is returned
if (d_frame_ID == 0)
@ -632,7 +632,7 @@ int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
}
else
{
i_alm_satellite_slot_number = static_cast<unsigned int>(read_navigation_unsigned(string_bits, n_A));
i_alm_satellite_slot_number = static_cast<uint32_t>(read_navigation_unsigned(string_bits, n_A));
d_frame_ID = get_frame_number(i_alm_satellite_slot_number);
// Make sure a valid frame_ID or satellite slot number is returned
if (d_frame_ID == 0)
@ -694,7 +694,7 @@ Glonass_Gnav_Utc_Model Glonass_Gnav_Navigation_Message::get_utc_model()
}
Glonass_Gnav_Almanac Glonass_Gnav_Navigation_Message::get_almanac(unsigned int satellite_slot_number)
Glonass_Gnav_Almanac Glonass_Gnav_Navigation_Message::get_almanac(uint32_t satellite_slot_number)
{
return gnav_almanac[satellite_slot_number - 1];
}
@ -738,14 +738,14 @@ bool Glonass_Gnav_Navigation_Message::have_new_utc_model() // Check if we have
}
bool Glonass_Gnav_Navigation_Message::have_new_almanac() //Check if we have a new almanac data set stored in the galileo navigation class
bool Glonass_Gnav_Navigation_Message::have_new_almanac() // Check if we have a new almanac data set stored in the galileo navigation class
{
bool new_alm = false;
if ((flag_almanac_str_6 == true) and (flag_almanac_str_7 == true))
{
if (d_previous_Na[i_alm_satellite_slot_number] != gnav_utc_model.d_N_A)
{
//All almanac have been received for this satellite
// All almanac have been received for this satellite
flag_almanac_str_6 = false;
flag_almanac_str_7 = false;
new_alm = true;

View File

@ -51,18 +51,18 @@
class Glonass_Gnav_Navigation_Message
{
private:
uint64_t read_navigation_unsigned(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter);
int64_t read_navigation_signed(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter);
bool read_navigation_bool(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter);
uint64_t read_navigation_unsigned(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter);
int64_t read_navigation_signed(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter);
bool read_navigation_bool(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter);
public:
bool flag_CRC_test;
unsigned int d_frame_ID;
unsigned int d_string_ID;
uint32_t d_frame_ID;
uint32_t d_string_ID;
bool flag_update_slot_number;
int i_channel_ID;
unsigned int i_satellite_PRN;
int32_t i_channel_ID;
uint32_t i_satellite_PRN;
Glonass_Gnav_Ephemeris gnav_ephemeris; //!< Ephemeris information decoded
Glonass_Gnav_Utc_Model gnav_utc_model; //!< UTC model information
@ -76,18 +76,18 @@ public:
bool flag_ephemeris_str_4; //!< Flag indicating that ephemeris 4/4 (string 4) have been received
// Almanac Flags
bool flag_all_almanac; //!< Flag indicating that all almanac have been received
bool flag_almanac_str_6; //!< Flag indicating that almanac of string 6 have been received
bool flag_almanac_str_7; //!< Flag indicating that almanac of string 7 have been received
bool flag_almanac_str_8; //!< Flag indicating that almanac of string 8 have been received
bool flag_almanac_str_9; //!< Flag indicating that almanac of string 9 have been received
bool flag_almanac_str_10; //!< Flag indicating that almanac of string 10 have been received
bool flag_almanac_str_11; //!< Flag indicating that almanac of string 11 have been received
bool flag_almanac_str_12; //!< Flag indicating that almanac of string 12 have been received
bool flag_almanac_str_13; //!< Flag indicating that almanac of string 13 have been received
bool flag_almanac_str_14; //!< Flag indicating that almanac of string 14 have been received
bool flag_almanac_str_15; //!< Flag indicating that almanac of string 15 have been received
unsigned int i_alm_satellite_slot_number; //!< SV Orbit Slot Number
bool flag_all_almanac; //!< Flag indicating that all almanac have been received
bool flag_almanac_str_6; //!< Flag indicating that almanac of string 6 have been received
bool flag_almanac_str_7; //!< Flag indicating that almanac of string 7 have been received
bool flag_almanac_str_8; //!< Flag indicating that almanac of string 8 have been received
bool flag_almanac_str_9; //!< Flag indicating that almanac of string 9 have been received
bool flag_almanac_str_10; //!< Flag indicating that almanac of string 10 have been received
bool flag_almanac_str_11; //!< Flag indicating that almanac of string 11 have been received
bool flag_almanac_str_12; //!< Flag indicating that almanac of string 12 have been received
bool flag_almanac_str_13; //!< Flag indicating that almanac of string 13 have been received
bool flag_almanac_str_14; //!< Flag indicating that almanac of string 14 have been received
bool flag_almanac_str_15; //!< Flag indicating that almanac of string 15 have been received
uint32_t i_alm_satellite_slot_number; //!< SV Orbit Slot Number
// UTC and System Clocks Flags
bool flag_utc_model_valid; //!< If set, it indicates that the UTC model parameters are filled
@ -115,7 +115,7 @@ public:
* \param satellite_slot_number [in] Satellite slot number identifier
* \returns Frame number being decoded, 0 if operation was not successful.
*/
unsigned int get_frame_number(unsigned int satellite_slot_number);
uint32_t get_frame_number(uint32_t satellite_slot_number);
/*!
* \brief Reset GLONASS GNAV Navigation Information
@ -137,7 +137,7 @@ public:
* \param satellite_slot_number Slot number identifier for the satellite
* \returns Returns the Glonass_Gnav_Almanac object for the input slot number
*/
Glonass_Gnav_Almanac get_almanac(unsigned int satellite_slot_number);
Glonass_Gnav_Almanac get_almanac(uint32_t satellite_slot_number);
/*!
* \brief Returns true if a new Glonass_Gnav_Ephemeris object has arrived.
@ -159,7 +159,7 @@ public:
* \param frame_string [in] is the string message within the parsed frame
* \returns Returns the ID of the decoded string
*/
int string_decoder(std::string frame_string);
int32_t string_decoder(std::string frame_string);
/*!
* Default constructor

View File

@ -49,7 +49,7 @@ double Glonass_Gnav_Utc_Model::utc_time(double glonass_time_corrected)
double t_utc;
// GLONASS Time is relative to UTC Moscow, so we simply add its time difference
t_utc = glonass_time_corrected + 3 * 3600 + d_tau_c;
t_utc = glonass_time_corrected + 3.0 * 3600.0 + d_tau_c;
return t_utc;
}

View File

@ -34,8 +34,8 @@
#ifndef GNSS_SDR_GLONASS_GNAV_UTC_MODEL_H_
#define GNSS_SDR_GLONASS_GNAV_UTC_MODEL_H_
#include <boost/assign.hpp>
#include <boost/serialization/nvp.hpp>
#include <cstdint>
/*!
* \brief This class is a storage for the GLONASS GNAV UTC MODEL data as described in GLONASS ICD (Edition 5.1)
@ -58,7 +58,7 @@ public:
/*!
* \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the almanac data on disk file.
*/
void serialize(Archive& archive, const unsigned int version)
void serialize(Archive& archive, const uint32_t version)
{
using boost::serialization::make_nvp;
if (version)

View File

@ -33,64 +33,65 @@
#ifndef GNSS_SDR_GNSS_OBS_CODES_H_
#define GNSS_SDR_GNSS_OBS_CODES_H_
#include <cstdint>
const unsigned int CODE_NONE = 0; //!< obs code: none or unknown
const unsigned int CODE_L1C = 1; //!< obs code: L1C/A,G1C/A,E1C (GPS,GLO,GAL,QZS,SBS)
const unsigned int CODE_L1P = 2; //!< obs code: L1P,G1P (GPS,GLO)
const unsigned int CODE_L1W = 3; //!< obs code: L1 Z-track (GPS)
const unsigned int CODE_L1Y = 4; //!< obs code: L1Y (GPS)
const unsigned int CODE_L1M = 5; //!< obs code: L1M (GPS)
const unsigned int CODE_L1N = 6; //!< obs code: L1codeless (GPS)
const unsigned int CODE_L1S = 7; //!< obs code: L1C(D) (GPS,QZS)
const unsigned int CODE_L1L = 8; //!< obs code: L1C(P) (GPS,QZS)
const unsigned int CODE_L1E = 9; //!< (not used)
const unsigned int CODE_L1A = 10; //!< obs code: E1A (GAL)
const unsigned int CODE_L1B = 11; //!< obs code: E1B (GAL)
const unsigned int CODE_L1X = 12; //!< obs code: E1B+C,L1C(D+P) (GAL,QZS)
const unsigned int CODE_L1Z = 13; //!< obs code: E1A+B+C,L1SAIF (GAL,QZS)
const unsigned int CODE_L2C = 14; //!< obs code: L2C/A,G1C/A (GPS,GLO)
const unsigned int CODE_L2D = 15; //!< obs code: L2 L1C/A-(P2-P1) (GPS)
const unsigned int CODE_L2S = 16; //!< obs code: L2C(M) (GPS,QZS)
const unsigned int CODE_L2L = 17; //!< obs code: L2C(L) (GPS,QZS)
const unsigned int CODE_L2X = 18; //!< obs code: L2C(M+L),B1I+Q (GPS,QZS,BDS)
const unsigned int CODE_L2P = 19; //!< obs code: L2P,G2P (GPS,GLO)
const unsigned int CODE_L2W = 20; //!< obs code: L2 Z-track (GPS)
const unsigned int CODE_L2Y = 21; //!< obs code: L2Y (GPS)
const unsigned int CODE_L2M = 22; //!< obs code: L2M (GPS)
const unsigned int CODE_L2N = 23; //!< obs code: L2codeless (GPS)
const unsigned int CODE_L5I = 24; //!< obs code: L5/E5aI (GPS,GAL,QZS,SBS)
const unsigned int CODE_L5Q = 25; //!< obs code: L5/E5aQ (GPS,GAL,QZS,SBS)
const unsigned int CODE_L5X = 26; //!< obs code: L5/E5aI+Q/L5B+C (GPS,GAL,QZS,IRN,SBS)
const unsigned int CODE_L7I = 27; //!< obs code: E5bI,B2I (GAL,BDS)
const unsigned int CODE_L7Q = 28; //!< obs code: E5bQ,B2Q (GAL,BDS)
const unsigned int CODE_L7X = 29; //!< obs code: E5bI+Q,B2I+Q (GAL,BDS)
const unsigned int CODE_L6A = 30; //!< obs code: E6A (GAL)
const unsigned int CODE_L6B = 31; //!< obs code: E6B (GAL)
const unsigned int CODE_L6C = 32; //!< obs code: E6C (GAL)
const unsigned int CODE_L6X = 33; //!< obs code: E6B+C,LEXS+L,B3I+Q (GAL,QZS,BDS)
const unsigned int CODE_L6Z = 34; //!< obs code: E6A+B+C (GAL)
const unsigned int CODE_L6S = 35; //!< obs code: LEXS (QZS)
const unsigned int CODE_L6L = 36; //!< obs code: LEXL (QZS)
const unsigned int CODE_L8I = 37; //!< obs code: E5(a+b)I (GAL)
const unsigned int CODE_L8Q = 38; //!< obs code: E5(a+b)Q (GAL)
const unsigned int CODE_L8X = 39; //!< obs code: E5(a+b)I+Q (GAL)
const unsigned int CODE_L2I = 40; //!< obs code: B1I (BDS)
const unsigned int CODE_L2Q = 41; //!< obs code: B1Q (BDS)
const unsigned int CODE_L6I = 42; //!< obs code: B3I (BDS)
const unsigned int CODE_L6Q = 43; //!< obs code: B3Q (BDS)
const unsigned int CODE_L3I = 44; //!< obs code: G3I (GLO)
const unsigned int CODE_L3Q = 45; //!< obs code: G3Q (GLO)
const unsigned int CODE_L3X = 46; //!< obs code: G3I+Q (GLO)
const unsigned int CODE_L1I = 47; //!< obs code: B1I (BDS)
const unsigned int CODE_L1Q = 48; //!< obs code: B1Q (BDS)
const unsigned int CODE_L5A = 49; //!< obs code: L5A SPS (IRN)
const unsigned int CODE_L5B = 50; //!< obs code: L5B RS(D) (IRN)
const unsigned int CODE_L5C = 51; //!< obs code: L5C RS(P) (IRN)
const unsigned int CODE_L9A = 52; //!< obs code: SA SPS (IRN)
const unsigned int CODE_L9B = 53; //!< obs code: SB RS(D) (IRN)
const unsigned int CODE_L9C = 54; //!< obs code: SC RS(P) (IRN)
const unsigned int CODE_L9X = 55; //!< obs code: SB+C (IRN)
const int MAXCODE = 55; //!< max number of obs code
const uint32_t CODE_NONE = 0; //!< obs code: none or unknown
const uint32_t CODE_L1C = 1; //!< obs code: L1C/A,G1C/A,E1C (GPS,GLO,GAL,QZS,SBS)
const uint32_t CODE_L1P = 2; //!< obs code: L1P,G1P (GPS,GLO)
const uint32_t CODE_L1W = 3; //!< obs code: L1 Z-track (GPS)
const uint32_t CODE_L1Y = 4; //!< obs code: L1Y (GPS)
const uint32_t CODE_L1M = 5; //!< obs code: L1M (GPS)
const uint32_t CODE_L1N = 6; //!< obs code: L1codeless (GPS)
const uint32_t CODE_L1S = 7; //!< obs code: L1C(D) (GPS,QZS)
const uint32_t CODE_L1L = 8; //!< obs code: L1C(P) (GPS,QZS)
const uint32_t CODE_L1E = 9; //!< (not used)
const uint32_t CODE_L1A = 10; //!< obs code: E1A (GAL)
const uint32_t CODE_L1B = 11; //!< obs code: E1B (GAL)
const uint32_t CODE_L1X = 12; //!< obs code: E1B+C,L1C(D+P) (GAL,QZS)
const uint32_t CODE_L1Z = 13; //!< obs code: E1A+B+C,L1SAIF (GAL,QZS)
const uint32_t CODE_L2C = 14; //!< obs code: L2C/A,G1C/A (GPS,GLO)
const uint32_t CODE_L2D = 15; //!< obs code: L2 L1C/A-(P2-P1) (GPS)
const uint32_t CODE_L2S = 16; //!< obs code: L2C(M) (GPS,QZS)
const uint32_t CODE_L2L = 17; //!< obs code: L2C(L) (GPS,QZS)
const uint32_t CODE_L2X = 18; //!< obs code: L2C(M+L),B1I+Q (GPS,QZS,BDS)
const uint32_t CODE_L2P = 19; //!< obs code: L2P,G2P (GPS,GLO)
const uint32_t CODE_L2W = 20; //!< obs code: L2 Z-track (GPS)
const uint32_t CODE_L2Y = 21; //!< obs code: L2Y (GPS)
const uint32_t CODE_L2M = 22; //!< obs code: L2M (GPS)
const uint32_t CODE_L2N = 23; //!< obs code: L2codeless (GPS)
const uint32_t CODE_L5I = 24; //!< obs code: L5/E5aI (GPS,GAL,QZS,SBS)
const uint32_t CODE_L5Q = 25; //!< obs code: L5/E5aQ (GPS,GAL,QZS,SBS)
const uint32_t CODE_L5X = 26; //!< obs code: L5/E5aI+Q/L5B+C (GPS,GAL,QZS,IRN,SBS)
const uint32_t CODE_L7I = 27; //!< obs code: E5bI,B2I (GAL,BDS)
const uint32_t CODE_L7Q = 28; //!< obs code: E5bQ,B2Q (GAL,BDS)
const uint32_t CODE_L7X = 29; //!< obs code: E5bI+Q,B2I+Q (GAL,BDS)
const uint32_t CODE_L6A = 30; //!< obs code: E6A (GAL)
const uint32_t CODE_L6B = 31; //!< obs code: E6B (GAL)
const uint32_t CODE_L6C = 32; //!< obs code: E6C (GAL)
const uint32_t CODE_L6X = 33; //!< obs code: E6B+C,LEXS+L,B3I+Q (GAL,QZS,BDS)
const uint32_t CODE_L6Z = 34; //!< obs code: E6A+B+C (GAL)
const uint32_t CODE_L6S = 35; //!< obs code: LEXS (QZS)
const uint32_t CODE_L6L = 36; //!< obs code: LEXL (QZS)
const uint32_t CODE_L8I = 37; //!< obs code: E5(a+b)I (GAL)
const uint32_t CODE_L8Q = 38; //!< obs code: E5(a+b)Q (GAL)
const uint32_t CODE_L8X = 39; //!< obs code: E5(a+b)I+Q (GAL)
const uint32_t CODE_L2I = 40; //!< obs code: B1I (BDS)
const uint32_t CODE_L2Q = 41; //!< obs code: B1Q (BDS)
const uint32_t CODE_L6I = 42; //!< obs code: B3I (BDS)
const uint32_t CODE_L6Q = 43; //!< obs code: B3Q (BDS)
const uint32_t CODE_L3I = 44; //!< obs code: G3I (GLO)
const uint32_t CODE_L3Q = 45; //!< obs code: G3Q (GLO)
const uint32_t CODE_L3X = 46; //!< obs code: G3I+Q (GLO)
const uint32_t CODE_L1I = 47; //!< obs code: B1I (BDS)
const uint32_t CODE_L1Q = 48; //!< obs code: B1Q (BDS)
const uint32_t CODE_L5A = 49; //!< obs code: L5A SPS (IRN)
const uint32_t CODE_L5B = 50; //!< obs code: L5B RS(D) (IRN)
const uint32_t CODE_L5C = 51; //!< obs code: L5C RS(P) (IRN)
const uint32_t CODE_L9A = 52; //!< obs code: SA SPS (IRN)
const uint32_t CODE_L9B = 53; //!< obs code: SB RS(D) (IRN)
const uint32_t CODE_L9C = 54; //!< obs code: SC RS(P) (IRN)
const uint32_t CODE_L9X = 55; //!< obs code: SB+C (IRN)
const int32_t MAXCODE = 55; //!< max number of obs code
#endif

View File

@ -38,7 +38,7 @@ Gnss_Satellite::Gnss_Satellite()
}
Gnss_Satellite::Gnss_Satellite(const std::string& system_, unsigned int PRN_)
Gnss_Satellite::Gnss_Satellite(const std::string& system_, uint32_t PRN_)
{
Gnss_Satellite::reset();
Gnss_Satellite::set_system(system_);
@ -98,9 +98,9 @@ Gnss_Satellite& Gnss_Satellite::operator=(const Gnss_Satellite &rhs) {
if (this != &rhs) {
// Deallocate, allocate new space, copy values...
const std::string system_ = rhs.get_system();
const unsigned int PRN_ = rhs.get_PRN();
const uint32_t PRN_ = rhs.get_PRN();
const std::string block_ = rhs.get_block();
// const signed int rf_link_ = 0;
// const int32_t rf_link_ = 0;
this->set_system(system_);
this->set_PRN(PRN_);
this->set_block(system_, PRN_);
@ -127,7 +127,7 @@ void Gnss_Satellite::set_system(const std::string& system_)
}
void Gnss_Satellite::update_PRN(unsigned int PRN_)
void Gnss_Satellite::update_PRN(uint32_t PRN_)
{
if (system.compare("Glonass") != 0)
{
@ -150,7 +150,7 @@ void Gnss_Satellite::update_PRN(unsigned int PRN_)
}
void Gnss_Satellite::set_PRN(unsigned int PRN_)
void Gnss_Satellite::set_PRN(uint32_t PRN_)
{
// Set satellite's PRN
if (system.compare("") == 0)
@ -230,19 +230,19 @@ void Gnss_Satellite::set_PRN(unsigned int PRN_)
}
signed int Gnss_Satellite::get_rf_link() const
int32_t Gnss_Satellite::get_rf_link() const
{
// Get satellite's rf link. Identifies the GLONASS Frequency Channel
signed int rf_link_;
int32_t rf_link_;
rf_link_ = rf_link;
return rf_link_;
}
unsigned int Gnss_Satellite::get_PRN() const
uint32_t Gnss_Satellite::get_PRN() const
{
// Get satellite's PRN
unsigned int PRN_;
uint32_t PRN_;
PRN_ = PRN;
return PRN_;
}
@ -273,7 +273,7 @@ std::string Gnss_Satellite::get_block() const
}
std::string Gnss_Satellite::what_block(const std::string& system_, unsigned int PRN_)
std::string Gnss_Satellite::what_block(const std::string& system_, uint32_t PRN_)
{
std::string block_ = "Unknown";
if (system_.compare("GPS") == 0)
@ -602,7 +602,7 @@ std::string Gnss_Satellite::what_block(const std::string& system_, unsigned int
}
void Gnss_Satellite::set_block(const std::string& system_, unsigned int PRN_)
void Gnss_Satellite::set_block(const std::string& system_, uint32_t PRN_)
{
block = what_block(system_, PRN_);
}

View File

@ -32,9 +32,10 @@
#ifndef GNSS_SDR_GNSS_SATELLITE_H_
#define GNSS_SDR_GNSS_SATELLITE_H_
#include <cstdint>
#include <map>
#include <string>
#include <set>
#include <map>
/*!
@ -47,27 +48,27 @@ class Gnss_Satellite
{
public:
Gnss_Satellite(); //!< Default Constructor.
Gnss_Satellite(const std::string& system_, unsigned int PRN_); //!< Concrete GNSS satellite Constructor.
Gnss_Satellite(const std::string& system_, uint32_t PRN_); //!< Concrete GNSS satellite Constructor.
~Gnss_Satellite(); //!< Default Destructor.
void update_PRN(unsigned int PRN); //!< Updates the PRN Number when information is decoded, only applies to GLONASS GNAV messages
unsigned int get_PRN() const; //!< Gets satellite's PRN
signed int get_rf_link() const; //!< Gets the satellite's rf link
void update_PRN(uint32_t PRN); //!< Updates the PRN Number when information is decoded, only applies to GLONASS GNAV messages
uint32_t get_PRN() const; //!< Gets satellite's PRN
int32_t get_rf_link() const; //!< Gets the satellite's rf link
std::string get_system() const; //!< Gets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Beidou"}
std::string get_system_short() const; //!< Gets the satellite system {"G", "R", "SBAS", "E", "C"}
std::string get_block() const; //!< Gets the satellite block. If GPS, returns {"IIA", "IIR", "IIR-M", "IIF"}
std::string what_block(const std::string& system_, unsigned int PRN_); //!< Gets the block of a given satellite
std::string what_block(const std::string& system_, uint32_t PRN_); //!< Gets the block of a given satellite
friend bool operator==(const Gnss_Satellite&, const Gnss_Satellite&); //!< operator== for comparison
friend std::ostream& operator<<(std::ostream&, const Gnss_Satellite&); //!< operator<< for pretty printing
//Gnss_Satellite& operator=(const Gnss_Satellite &);
private:
unsigned int PRN;
uint32_t PRN;
std::string system;
std::map<std::string, std::string> satelliteSystem;
std::string block;
signed int rf_link;
int32_t rf_link;
void set_system(const std::string& system); // Sets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Beidou"}.
void set_PRN(unsigned int PRN); // Sets satellite's PRN
void set_block(const std::string& system_, unsigned int PRN_);
void set_PRN(uint32_t PRN); // Sets satellite's PRN
void set_block(const std::string& system_, uint32_t PRN_);
std::set<std::string> system_set; // = {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"};
void reset();
};

View File

@ -36,11 +36,13 @@ Gnss_Signal::Gnss_Signal()
this->signal = "";
}
Gnss_Signal::Gnss_Signal(const std::string& signal_)
{
this->signal = signal_;
}
Gnss_Signal::Gnss_Signal(const Gnss_Satellite& satellite_, const std::string& signal_)
{
this->satellite = satellite_;

View File

@ -52,7 +52,7 @@ public:
Gnss_Signal(const std::string& signal_);
Gnss_Signal(const Gnss_Satellite& satellite_, const std::string& signal_);
~Gnss_Signal();
std::string get_signal_str() const; //!< Get the satellite signal {"1C" for GPS L1 C/A, "2S" for GPS L2C (M), "L5" for GPS L5, "1G" for GLONASS L1 C/A, "1B" for Galileo E1B, "5X" for Galileo E5a.
std::string get_signal_str() const; //!< Get the satellite signal {"1C" for GPS L1 C/A, "2S" for GPS L2C (M), "L5" for GPS L5, "1G" for GLONASS L1 C/A, "1B" for Galileo E1B, "5X" for Galileo E5a.
Gnss_Satellite get_satellite() const; //!< Get the Gnss_Satellite associated to the signal
friend bool operator==(const Gnss_Signal&, const Gnss_Signal&); //!< operator== for comparison
friend std::ostream& operator<<(std::ostream&, const Gnss_Signal&); //!< operator<< for pretty printing

View File

@ -34,7 +34,7 @@
Gps_Acq_Assist::Gps_Acq_Assist()
{
i_satellite_PRN = 0;
i_satellite_PRN = 0U;
d_TOW = 0.0;
d_Doppler0 = 0.0;
d_Doppler1 = 0.0;

View File

@ -32,6 +32,7 @@
#ifndef GNSS_SDR_GPS_ACQ_ASSIST_H_
#define GNSS_SDR_GPS_ACQ_ASSIST_H_
#include <cstdint>
/*!
* \brief This class is a storage for the GPS GSM RRLL acquisition assistance data as described in
@ -44,17 +45,17 @@
class Gps_Acq_Assist
{
public:
unsigned int i_satellite_PRN; //!< SV PRN NUMBER
double d_TOW; //!< Time Of Week assigned to the acquisition data
double d_Doppler0; //!< Doppler (0 order term) [Hz]
double d_Doppler1; //!< Doppler (1 order term) [Hz]
double dopplerUncertainty; //!< Doppler Uncertainty [Hz]
double Code_Phase; //!< Code phase [chips]
double Code_Phase_int; //!< Integer Code Phase [1 C/A code period]
double GPS_Bit_Number; //!< GPS Bit Number
double Code_Phase_window; //!< Code Phase search window [chips]
double Azimuth; //!< Satellite Azimuth [deg]
double Elevation; //!< Satellite Elevation [deg]
uint32_t i_satellite_PRN; //!< SV PRN NUMBER
double d_TOW; //!< Time Of Week assigned to the acquisition data
double d_Doppler0; //!< Doppler (0 order term) [Hz]
double d_Doppler1; //!< Doppler (1 order term) [Hz]
double dopplerUncertainty; //!< Doppler Uncertainty [Hz]
double Code_Phase; //!< Code phase [chips]
double Code_Phase_int; //!< Integer Code Phase [1 C/A code period]
double GPS_Bit_Number; //!< GPS Bit Number
double Code_Phase_window; //!< Code Phase search window [chips]
double Azimuth; //!< Satellite Azimuth [deg]
double Elevation; //!< Satellite Elevation [deg]
/*!
* Default constructor

View File

@ -34,7 +34,7 @@
Gps_Almanac::Gps_Almanac()
{
i_satellite_PRN = 0;
i_satellite_PRN = 0U;
d_Delta_i = 0.0;
d_Toa = 0.0;
d_M_0 = 0.0;

View File

@ -32,6 +32,7 @@
#ifndef GNSS_SDR_GPS_ALMANAC_H_
#define GNSS_SDR_GPS_ALMANAC_H_
#include <cstdint>
/*!
* \brief This class is a storage for the GPS SV ALMANAC data as described in IS-GPS-200E
@ -41,7 +42,7 @@
class Gps_Almanac
{
public:
unsigned int i_satellite_PRN; //!< SV PRN NUMBER
uint32_t i_satellite_PRN; //!< SV PRN NUMBER
double d_Delta_i;
double d_Toa; //!< Almanac data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s]
double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles]
@ -50,7 +51,7 @@ public:
double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles]
double d_OMEGA; //!< Argument of Perigee [semi-cicles]
double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s]
int i_SV_health; // SV Health
int32_t i_SV_health; // SV Health
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]

View File

@ -35,34 +35,34 @@
Gps_CNAV_Ephemeris::Gps_CNAV_Ephemeris()
{
i_satellite_PRN = 0;
i_satellite_PRN = 0U;
d_Toe1 = -1;
d_Toe2 = -1;
d_Toe1 = -1.0;
d_Toe2 = -1.0;
d_TOW = 0;
d_Crs = 0;
d_M_0 = 0;
d_Cuc = 0;
d_e_eccentricity = 0;
d_Cus = 0;
d_TOW = 0.0;
d_Crs = 0.0;
d_M_0 = 0.0;
d_Cuc = 0.0;
d_e_eccentricity = 0.0;
d_Cus = 0.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;
d_Toc = 0.0;
d_Cic = 0.0;
d_OMEGA0 = 0.0;
d_Cis = 0.0;
d_i_0 = 0.0;
d_Crc = 0.0;
d_OMEGA = 0.0;
d_IDOT = 0.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_TGD = 0.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]
d_A_f0 = 0.0; // Coefficient 0 of code phase offset model [s]
d_A_f1 = 0.0; // Coefficient 1 of code phase offset model [s/s]
d_A_f2 = 0.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.
@ -95,6 +95,7 @@ Gps_CNAV_Ephemeris::Gps_CNAV_Ephemeris()
b_l2c_phasing_flag = false;
}
double Gps_CNAV_Ephemeris::check_t(double time)
{
double corrTime;
@ -162,7 +163,7 @@ double Gps_CNAV_Ephemeris::sv_clock_relativistic_term(double transmitTime)
E = M;
// --- Iteratively compute eccentric anomaly ----------------------------
for (int ii = 1; ii < 20; ii++)
for (int32_t ii = 1; ii < 20; ii++)
{
E_old = E;
E = M + d_e_eccentricity * sin(E);
@ -232,7 +233,7 @@ double Gps_CNAV_Ephemeris::satellitePosition(double transmitTime)
E = M;
// --- Iteratively compute eccentric anomaly ----------------------------
for (int ii = 1; ii < 20; ii++)
for (int32_t ii = 1; ii < 20; ii++)
{
E_old = E;
E = M + d_e_eccentricity * sin(E);

View File

@ -48,12 +48,12 @@ private:
double check_t(double time);
public:
unsigned int i_satellite_PRN; // SV PRN NUMBER
uint32_t 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)
// Message Types 10 and 11 Parameters (1 of 2)
int32_t i_GPS_week; //!< GPS week number, aka WN [week]
int32_t i_URA; //!< ED Accuracy Index
int32_t 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
@ -75,7 +75,7 @@ public:
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
// 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]
@ -85,8 +85,7 @@ public:
double d_URA1; //!<NED Accuracy Change Index
double d_URA2; //!< NED Accuracy Change Rate Index
//Group Delay Differential Parameters
// 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;
@ -95,8 +94,6 @@ public:
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.
@ -131,7 +128,7 @@ public:
/*!
* \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.
*/
inline void serialize(Archive& archive, const unsigned int version)
inline void serialize(Archive& archive, const uint32_t version)
{
using boost::serialization::make_nvp;
if (version)

View File

@ -42,18 +42,18 @@ void Gps_CNAV_Navigation_Message::reset()
b_flag_utc_valid = false;
// satellite positions
d_satpos_X = 0;
d_satpos_Y = 0;
d_satpos_Z = 0;
d_satpos_X = 0.0;
d_satpos_Y = 0.0;
d_satpos_Z = 0.0;
// info
i_channel_ID = 0;
i_satellite_PRN = 0;
i_satellite_PRN = 0U;
// Satellite velocity
d_satvel_X = 0;
d_satvel_Y = 0;
d_satvel_Z = 0;
d_satvel_X = 0.0;
d_satvel_Y = 0.0;
d_satvel_Z = 0.0;
d_TOW = 0.0;
}
@ -63,7 +63,7 @@ Gps_CNAV_Navigation_Message::Gps_CNAV_Navigation_Message()
{
reset();
Gnss_Satellite gnss_satellite_ = Gnss_Satellite();
for (unsigned int prn_ = 1; prn_ < 33; prn_++)
for (uint32_t prn_ = 1; prn_ < 33; prn_++)
{
satelliteBlock[prn_] = gnss_satellite_.what_block("GPS", prn_);
}
@ -72,7 +72,7 @@ Gps_CNAV_Navigation_Message::Gps_CNAV_Navigation_Message()
}
bool Gps_CNAV_Navigation_Message::read_navigation_bool(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter)
bool Gps_CNAV_Navigation_Message::read_navigation_bool(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter)
{
bool value;
@ -88,15 +88,15 @@ bool Gps_CNAV_Navigation_Message::read_navigation_bool(std::bitset<GPS_CNAV_DATA
}
uint64_t Gps_CNAV_Navigation_Message::read_navigation_unsigned(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter)
uint64_t Gps_CNAV_Navigation_Message::read_navigation_unsigned(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter)
{
uint64_t value = 0;
int num_of_slices = parameter.size();
for (int i = 0; i < num_of_slices; i++)
int32_t num_of_slices = parameter.size();
for (int32_t i = 0; i < num_of_slices; i++)
{
for (int j = 0; j < parameter[i].second; j++)
for (int32_t j = 0; j < parameter[i].second; j++)
{
value <<= 1; //shift left
value <<= 1; // shift left
if (bits[GPS_CNAV_DATA_PAGE_BITS - parameter[i].first - j] == 1)
{
value += 1; // insert the bit
@ -107,30 +107,30 @@ uint64_t Gps_CNAV_Navigation_Message::read_navigation_unsigned(std::bitset<GPS_C
}
int64_t Gps_CNAV_Navigation_Message::read_navigation_signed(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter)
int64_t Gps_CNAV_Navigation_Message::read_navigation_signed(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter)
{
int64_t value = 0;
int num_of_slices = parameter.size();
int32_t num_of_slices = parameter.size();
// Discriminate between 64 bits and 32 bits compiler
int long_int_size_bytes = sizeof(int64_t);
int32_t long_int_size_bytes = sizeof(long int);
if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system
{
// read the MSB and perform the sign extension
if (bits[GPS_CNAV_DATA_PAGE_BITS - parameter[0].first] == 1)
{
value ^= 0xFFFFFFFFFFFFFFFF; //64 bits variable
value ^= 0xFFFFFFFFFFFFFFFF; // 64 bits variable
}
else
{
value &= 0;
}
for (int i = 0; i < num_of_slices; i++)
for (int32_t i = 0; i < num_of_slices; i++)
{
for (int j = 0; j < parameter[i].second; j++)
for (int32_t j = 0; j < parameter[i].second; j++)
{
value <<= 1; //shift left
value &= 0xFFFFFFFFFFFFFFFE; //reset the corresponding bit (for the 64 bits variable)
value <<= 1; // shift left
value &= 0xFFFFFFFFFFFFFFFE; // reset the corresponding bit (for the 64 bits variable)
if (bits[GPS_CNAV_DATA_PAGE_BITS - parameter[i].first - j] == 1)
{
value += 1; // insert the bit
@ -150,12 +150,12 @@ int64_t Gps_CNAV_Navigation_Message::read_navigation_signed(std::bitset<GPS_CNAV
value &= 0;
}
for (int i = 0; i < num_of_slices; i++)
for (int32_t i = 0; i < num_of_slices; i++)
{
for (int j = 0; j < parameter[i].second; j++)
for (int32_t j = 0; j < parameter[i].second; j++)
{
value <<= 1; //shift left
value &= 0xFFFFFFFE; //reset the corresponding bit
value <<= 1; // shift left
value &= 0xFFFFFFFE; // reset the corresponding bit
if (bits[GPS_CNAV_DATA_PAGE_BITS - parameter[i].first - j] == 1)
{
value += 1; // insert the bit
@ -169,13 +169,12 @@ int64_t Gps_CNAV_Navigation_Message::read_navigation_signed(std::bitset<GPS_CNAV
void Gps_CNAV_Navigation_Message::decode_page(std::bitset<GPS_CNAV_DATA_PAGE_BITS> data_bits)
{
int PRN;
int page_type;
int32_t PRN;
int32_t page_type;
bool alert_flag;
// common to all messages
PRN = static_cast<int>(read_navigation_unsigned(data_bits, CNAV_PRN));
PRN = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_PRN));
ephemeris_record.i_satellite_PRN = PRN;
d_TOW = static_cast<double>(read_navigation_unsigned(data_bits, CNAV_TOW));
@ -185,13 +184,13 @@ void Gps_CNAV_Navigation_Message::decode_page(std::bitset<GPS_CNAV_DATA_PAGE_BIT
alert_flag = static_cast<bool>(read_navigation_bool(data_bits, CNAV_ALERT_FLAG));
ephemeris_record.b_alert_flag = alert_flag;
page_type = static_cast<int>(read_navigation_unsigned(data_bits, CNAV_MSG_TYPE));
page_type = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_MSG_TYPE));
switch (page_type)
{
case 10: // Ephemeris 1/2
ephemeris_record.i_GPS_week = static_cast<int>(read_navigation_unsigned(data_bits, CNAV_WN));
ephemeris_record.i_signal_health = static_cast<int>(read_navigation_unsigned(data_bits, CNAV_HEALTH));
ephemeris_record.i_GPS_week = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_WN));
ephemeris_record.i_signal_health = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_HEALTH));
ephemeris_record.d_Top = static_cast<double>(read_navigation_unsigned(data_bits, CNAV_TOP1));
ephemeris_record.d_Top *= CNAV_TOP1_LSB;
ephemeris_record.d_URA0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_URA));
@ -256,7 +255,7 @@ void Gps_CNAV_Navigation_Message::decode_page(std::bitset<GPS_CNAV_DATA_PAGE_BIT
ephemeris_record.d_A_f2 = static_cast<double>(read_navigation_signed(data_bits, CNAV_AF2));
ephemeris_record.d_A_f2 *= CNAV_AF2_LSB;
//group delays
//Check if the grup delay values are not available. See IS-GPS-200, Table 30-IV.
// Check if the grup delay values are not available. See IS-GPS-200, Table 30-IV.
//Bit string "1000000000000" is -4096 in 2 complement
ephemeris_record.d_TGD = static_cast<double>(read_navigation_signed(data_bits, CNAV_TGD));
if (ephemeris_record.d_TGD < -4095.9)
@ -330,7 +329,6 @@ void Gps_CNAV_Navigation_Message::decode_page(std::bitset<GPS_CNAV_DATA_PAGE_BIT
utc_model_record.d_A2 = static_cast<double>(read_navigation_signed(data_bits, CNAV_A2));
utc_model_record.d_A2 = utc_model_record.d_A2 * CNAV_A2_LSB;
utc_model_record.d_DeltaT_LS = static_cast<double>(read_navigation_signed(data_bits, CNAV_DELTA_TLS));
utc_model_record.d_DeltaT_LS = utc_model_record.d_DeltaT_LS * CNAV_DELTA_TLS_LSB;
@ -356,13 +354,13 @@ void Gps_CNAV_Navigation_Message::decode_page(std::bitset<GPS_CNAV_DATA_PAGE_BIT
}
bool Gps_CNAV_Navigation_Message::have_new_ephemeris() //Check if we have a new ephemeris stored in the galileo navigation class
bool Gps_CNAV_Navigation_Message::have_new_ephemeris() // Check if we have a new ephemeris stored in the galileo navigation class
{
if (b_flag_ephemeris_1 == true and b_flag_ephemeris_2 == true)
{
if (ephemeris_record.d_Toe1 == ephemeris_record.d_Toe2) // and ephemeris_record.d_Toe1==ephemeris_record.d_Toc)
{
//if all ephemeris pages have the same TOE, then they belong to the same block
// if all ephemeris pages have the same TOE, then they belong to the same block
// std::cout << "Ephemeris (1, 2) have been received and belong to the same batch" << std::endl;
b_flag_ephemeris_1 = false; // clear the flag
b_flag_ephemeris_2 = false; // clear the flag
@ -386,7 +384,7 @@ Gps_CNAV_Ephemeris Gps_CNAV_Navigation_Message::get_ephemeris()
}
bool Gps_CNAV_Navigation_Message::have_new_iono() //Check if we have a new iono data stored in the galileo navigation class
bool Gps_CNAV_Navigation_Message::have_new_iono() // Check if we have a new iono data stored in the galileo navigation class
{
if (b_flag_iono_valid == true)
{
@ -406,7 +404,7 @@ Gps_CNAV_Iono Gps_CNAV_Navigation_Message::get_iono()
}
bool Gps_CNAV_Navigation_Message::have_new_utc_model() //Check if we have a new iono data stored in the galileo navigation class
bool Gps_CNAV_Navigation_Message::have_new_utc_model() // Check if we have a new iono data stored in the galileo navigation class
{
if (b_flag_utc_valid == true)
{
@ -419,6 +417,7 @@ bool Gps_CNAV_Navigation_Message::have_new_utc_model() //Check if we have a new
}
}
Gps_CNAV_Utc_Model Gps_CNAV_Navigation_Message::get_utc_model()
{
return utc_model_record;

View File

@ -56,9 +56,9 @@
class Gps_CNAV_Navigation_Message
{
private:
uint64_t read_navigation_unsigned(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter);
int64_t read_navigation_signed(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter);
bool read_navigation_bool(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter);
uint64_t read_navigation_unsigned(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter);
int64_t read_navigation_signed(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter);
bool read_navigation_bool(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter);
Gps_CNAV_Ephemeris ephemeris_record;
Gps_CNAV_Iono iono_record;
@ -71,7 +71,7 @@ public:
bool b_flag_iono_valid; //!< If set, it indicates that the ionospheric parameters are filled and are not yet read by the get_iono
bool b_flag_utc_valid; //!< If set, it indicates that the utc parameters are filled and are not yet read by the get_utc_model
std::map<int, std::string> satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus
std::map<int32_t, std::string> satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus
// 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.
@ -79,8 +79,8 @@ public:
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 identification info
int i_channel_ID;
unsigned int i_satellite_PRN;
int32_t i_channel_ID;
uint32_t i_satellite_PRN;
// Satellite velocity
double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m]
@ -91,14 +91,17 @@ public:
void reset();
void decode_page(std::bitset<GPS_CNAV_DATA_PAGE_BITS> data_bits);
/*!
* \brief Obtain a GPS SV Ephemeris class filled with current SV data
*/
Gps_CNAV_Ephemeris get_ephemeris();
/*!
* \brief Check if we have a new iono record stored in the GPS ephemeris class
*/
bool have_new_iono();
/*!
* \brief Obtain a GPS ionospheric correction parameters class filled with current SV data
*/

View File

@ -34,35 +34,36 @@
Gps_CNAV_Utc_Model::Gps_CNAV_Utc_Model()
{
valid = false;
d_A2 = 0;
d_A1 = 0;
d_A0 = 0;
d_t_OT = 0;
d_A2 = 0.0;
d_A1 = 0.0;
d_A0 = 0.0;
d_t_OT = 0.0;
i_WN_T = 0;
d_DeltaT_LS = 0;
d_DeltaT_LS = 0.0;
i_WN_LSF = 0;
i_DN = 0;
d_DeltaT_LSF = 0;
d_DeltaT_LSF = 0.0;
}
double Gps_CNAV_Utc_Model::utc_time(double gpstime_corrected, int i_GPS_week)
double Gps_CNAV_Utc_Model::utc_time(double gpstime_corrected, int32_t i_GPS_week)
{
double t_utc;
double t_utc_daytime;
double Delta_t_UTC = d_DeltaT_LS + d_A0 + d_A1 * (gpstime_corrected - d_t_OT + 604800 * static_cast<double>(i_GPS_week - i_WN_T));
// Determine if the effectivity time of the leap second event is in the past
int weeksToLeapSecondEvent = i_WN_LSF - i_GPS_week;
int32_t weeksToLeapSecondEvent = i_WN_LSF - i_GPS_week;
if (weeksToLeapSecondEvent >= 0) // is not in the past
{
//Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s
int secondOfLeapSecondEvent = i_DN * 24 * 60 * 60;
// Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s
int32_t secondOfLeapSecondEvent = i_DN * 24 * 60 * 60;
if (weeksToLeapSecondEvent > 0)
{
t_utc_daytime = fmod(gpstime_corrected - Delta_t_UTC, 86400);
}
else //we are in the same week than the leap second event
else // we are in the same week than the leap second event
{
if (std::abs(gpstime_corrected - secondOfLeapSecondEvent) > 21600)
{
@ -83,9 +84,9 @@ double Gps_CNAV_Utc_Model::utc_time(double gpstime_corrected, int i_GPS_week)
* proper accommodation of the leap second event with a possible week number
* transition is provided by the following expression for UTC:
*/
int W = fmod(gpstime_corrected - Delta_t_UTC - 43200, 86400) + 43200;
int32_t W = fmod(gpstime_corrected - Delta_t_UTC - 43200, 86400) + 43200;
t_utc_daytime = fmod(W, 86400 + d_DeltaT_LSF - d_DeltaT_LS);
//implement something to handle a leap second event!
// implement something to handle a leap second event!
}
if ((gpstime_corrected - secondOfLeapSecondEvent) > 21600)
{

View File

@ -34,7 +34,7 @@
#include <boost/assign.hpp>
#include <boost/serialization/nvp.hpp>
#include <cstdint>
/*!
* \brief This class is a storage for the GPS UTC MODEL data as described in in IS-GPS-200H
@ -50,10 +50,10 @@ public:
double d_A1; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200H) [s/s]
double d_A0; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200H) [s]
double d_t_OT; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200H) [s]
int i_WN_T; //!< UTC reference week number [weeks]
int32_t i_WN_T; //!< UTC reference week number [weeks]
double d_DeltaT_LS; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac.
int i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks]
int i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days]
int32_t i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks]
int32_t i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days]
double d_DeltaT_LSF; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s]
/*!
@ -65,13 +65,13 @@ public:
* \brief Computes the Coordinated Universal Time (UTC) and
* returns it in [s] (IS-GPS-200E, 20.3.3.5.2.4 + 30.3.3.6.2)
*/
double utc_time(double gpstime_corrected, int i_GPS_week);
double utc_time(double gpstime_corrected, int32_t i_GPS_week);
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.
*/
inline void serialize(Archive& archive, const unsigned int version)
inline void serialize(Archive& archive, const uint32_t version)
{
using boost::serialization::make_nvp;
if (version)

View File

@ -37,43 +37,43 @@
Gps_Ephemeris::Gps_Ephemeris()
{
i_satellite_PRN = 0;
d_TOW = 0;
d_Crs = 0;
d_Delta_n = 0;
d_M_0 = 0;
d_Cuc = 0;
d_e_eccentricity = 0;
d_Cus = 0;
d_sqrt_A = 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_OMEGA_DOT = 0;
d_IDOT = 0;
i_satellite_PRN = 0U;
d_TOW = 0.0;
d_Crs = 0.0;
d_Delta_n = 0.0;
d_M_0 = 0.0;
d_Cuc = 0.0;
d_e_eccentricity = 0.0;
d_Cus = 0.0;
d_sqrt_A = 0.0;
d_Toe = 0.0;
d_Toc = 0.0;
d_Cic = 0.0;
d_OMEGA0 = 0.0;
d_Cis = 0.0;
d_i_0 = 0.0;
d_Crc = 0.0;
d_OMEGA = 0.0;
d_OMEGA_DOT = 0.0;
d_IDOT = 0.0;
i_code_on_L2 = 0;
i_GPS_week = 0;
b_L2_P_data_flag = false;
i_SV_accuracy = 0;
i_SV_health = 0;
d_IODE_SF2 = 0;
d_IODE_SF3 = 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_IODC = 0; // Issue of Data, Clock
i_AODO = 0; // Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
d_IODE_SF2 = 0.0;
d_IODE_SF3 = 0.0;
d_TGD = 0.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_IODC = 0.0; // Issue of Data, Clock
i_AODO = 0; // Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
b_fit_interval_flag = false; // indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours.
d_spare1 = 0;
d_spare2 = 0;
d_spare1 = 0.0;
d_spare2 = 0.0;
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]
d_A_f0 = 0.0; // Coefficient 0 of code phase offset model [s]
d_A_f1 = 0.0; // Coefficient 1 of code phase offset model [s/s]
d_A_f2 = 0.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.
@ -81,7 +81,7 @@ Gps_Ephemeris::Gps_Ephemeris()
auto gnss_sat = Gnss_Satellite();
std::string _system("GPS");
for (unsigned int i = 1; i < 33; i++)
for (uint32_t i = 1; i < 33; i++)
{
satelliteBlock[i] = gnss_sat.what_block(_system, i);
}
@ -120,7 +120,7 @@ double Gps_Ephemeris::sv_clock_drift(double transmitTime)
// double dt;
// dt = check_t(transmitTime - d_Toc);
//
// for (int i = 0; i < 2; i++)
// for (int32_t i = 0; i < 2; i++)
// {
// dt -= d_A_f0 + d_A_f1 * dt + d_A_f2 * (dt * dt);
// }
@ -169,7 +169,7 @@ double Gps_Ephemeris::sv_clock_relativistic_term(double transmitTime)
E = M;
// --- Iteratively compute eccentric anomaly ----------------------------
for (int ii = 1; ii < 20; ii++)
for (int32_t ii = 1; ii < 20; ii++)
{
E_old = E;
E = M + d_e_eccentricity * sin(E);
@ -228,7 +228,7 @@ double Gps_Ephemeris::satellitePosition(double transmitTime)
E = M;
// --- Iteratively compute eccentric anomaly ----------------------------
for (int ii = 1; ii < 20; ii++)
for (int32_t ii = 1; ii < 20; ii++)
{
E_old = E;
E = M + d_e_eccentricity * sin(E);

View File

@ -36,6 +36,7 @@
#include <boost/assign.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <cstdint>
#include <map>
#include <string>
@ -58,35 +59,35 @@ private:
double check_t(double time);
public:
unsigned int i_satellite_PRN; // SV PRN NUMBER
double d_TOW; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s]
double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m]
double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s]
double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles]
double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad]
double d_e_eccentricity; //!< Eccentricity [dimensionless]
double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad]
double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)]
double d_Toe; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s]
double d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s]
double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad]
double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles]
double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad]
double d_i_0; //!< Inclination Angle at Reference Time [semi-circles]
double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m]
double d_OMEGA; //!< Argument of Perigee [semi-cicles]
double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s]
double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s]
int i_code_on_L2; //!< If 1, P code ON in L2; if 2, C/A code ON in L2;
int i_GPS_week; //!< GPS week number, aka WN [week]
bool b_L2_P_data_flag; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel
int i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200E)
int i_SV_health;
uint32_t i_satellite_PRN; // SV PRN NUMBER
double d_TOW; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s]
double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m]
double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s]
double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles]
double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad]
double d_e_eccentricity; //!< Eccentricity [dimensionless]
double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad]
double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)]
double d_Toe; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s]
double d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s]
double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad]
double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles]
double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad]
double d_i_0; //!< Inclination Angle at Reference Time [semi-circles]
double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m]
double d_OMEGA; //!< Argument of Perigee [semi-cicles]
double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s]
double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s]
int32_t i_code_on_L2; //!< If 1, P code ON in L2; if 2, C/A code ON in L2;
int32_t i_GPS_week; //!< GPS week number, aka WN [week]
bool b_L2_P_data_flag; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel
int32_t i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200E)
int32_t i_SV_health;
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_IODC; //!< Issue of Data, Clock
double d_IODE_SF2; //!< Issue of Data, Ephemeris (IODE), subframe 2
double d_IODE_SF3; //!< Issue of Data, Ephemeris(IODE), subframe 3
int i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
int32_t i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
bool b_fit_interval_flag; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours.
double d_spare1;
@ -133,7 +134,7 @@ public:
/*!
* \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.
*/
inline void serialize(Archive& archive, const unsigned int version)
inline void serialize(Archive& archive, const uint32_t version)
{
using boost::serialization::make_nvp;
if (version)

View File

@ -40,64 +40,64 @@ void Gps_Navigation_Message::reset()
{
b_valid_ephemeris_set_flag = false;
d_TOW = 0.0;
d_TOW_SF1 = 0;
d_TOW_SF2 = 0;
d_TOW_SF3 = 0;
d_TOW_SF4 = 0;
d_TOW_SF5 = 0;
d_IODE_SF2 = 0;
d_IODE_SF3 = 0;
d_Crs = 0;
d_Delta_n = 0;
d_M_0 = 0;
d_Cuc = 0;
d_e_eccentricity = 0;
d_Cus = 0;
d_sqrt_A = 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_OMEGA_DOT = 0;
d_IDOT = 0;
d_TOW_SF1 = 0.0;
d_TOW_SF2 = 0.0;
d_TOW_SF3 = 0.0;
d_TOW_SF4 = 0.0;
d_TOW_SF5 = 0.0;
d_IODE_SF2 = 0.0;
d_IODE_SF3 = 0.0;
d_Crs = 0.0;
d_Delta_n = 0.0;
d_M_0 = 0.0;
d_Cuc = 0.0;
d_e_eccentricity = 0.0;
d_Cus = 0.0;
d_sqrt_A = 0.0;
d_Toe = 0.0;
d_Toc = 0.0;
d_Cic = 0.0;
d_OMEGA0 = 0.0;
d_Cis = 0.0;
d_i_0 = 0.0;
d_Crc = 0.0;
d_OMEGA = 0.0;
d_OMEGA_DOT = 0.0;
d_IDOT = 0.0;
i_code_on_L2 = 0;
i_GPS_week = 0;
b_L2_P_data_flag = false;
i_SV_accuracy = 0;
i_SV_health = 0;
d_TGD = 0;
d_TGD = 0.0;
d_IODC = -1.0;
i_AODO = 0;
b_fit_interval_flag = false;
d_spare1 = 0;
d_spare2 = 0;
d_spare1 = 0.0;
d_spare2 = 0.0;
d_A_f0 = 0;
d_A_f1 = 0;
d_A_f2 = 0;
d_A_f0 = 0.0;
d_A_f1 = 0.0;
d_A_f2 = 0.0;
//clock terms
//d_master_clock=0;
d_dtr = 0;
d_satClkCorr = 0;
d_satClkDrift = 0;
d_dtr = 0.0;
d_satClkCorr = 0.0;
d_satClkDrift = 0.0;
// satellite positions
d_satpos_X = 0;
d_satpos_Y = 0;
d_satpos_Z = 0;
d_satpos_X = 0.0;
d_satpos_Y = 0.0;
d_satpos_Z = 0.0;
// info
i_channel_ID = 0;
i_satellite_PRN = 0;
i_satellite_PRN = 0U;
// time synchro
d_subframe_timestamp_ms = 0;
d_subframe_timestamp_ms = 0.0;
// flags
b_alert_flag = false;
@ -107,39 +107,39 @@ void Gps_Navigation_Message::reset()
// Ionosphere and UTC
flag_iono_valid = false;
flag_utc_model_valid = false;
d_alpha0 = 0;
d_alpha1 = 0;
d_alpha2 = 0;
d_alpha3 = 0;
d_beta0 = 0;
d_beta1 = 0;
d_beta2 = 0;
d_beta3 = 0;
d_A1 = 0;
d_A0 = 0;
d_t_OT = 0;
d_alpha0 = 0.0;
d_alpha1 = 0.0;
d_alpha2 = 0.0;
d_alpha3 = 0.0;
d_beta0 = 0.0;
d_beta1 = 0.0;
d_beta2 = 0.0;
d_beta3 = 0.0;
d_A1 = 0.0;
d_A0 = 0.0;
d_t_OT = 0.0;
i_WN_T = 0;
d_DeltaT_LS = 0;
d_DeltaT_LS = 0.0;
i_WN_LSF = 0;
i_DN = 0;
d_DeltaT_LSF = 0;
d_DeltaT_LSF = 0.0;
//Almanac
d_Toa = 0;
// Almanac
d_Toa = 0.0;
i_WN_A = 0;
for (int i = 1; i < 32; i++)
for (int32_t i = 1; i < 32; i++)
{
almanacHealth[i] = 0;
}
// Satellite velocity
d_satvel_X = 0;
d_satvel_Y = 0;
d_satvel_Z = 0;
d_satvel_X = 0.0;
d_satvel_Y = 0.0;
d_satvel_Z = 0.0;
auto gnss_sat = Gnss_Satellite();
std::string _system("GPS");
for (unsigned int i = 1; i < 33; i++)
for (uint32_t i = 1; i < 33; i++)
{
satelliteBlock[i] = gnss_sat.what_block(_system, i);
}
@ -152,7 +152,7 @@ Gps_Navigation_Message::Gps_Navigation_Message()
}
void Gps_Navigation_Message::print_gps_word_bytes(unsigned int GPS_word)
void Gps_Navigation_Message::print_gps_word_bytes(uint32_t GPS_word)
{
std::cout << " Word =";
std::cout << std::bitset<32>(GPS_word);
@ -160,7 +160,7 @@ void Gps_Navigation_Message::print_gps_word_bytes(unsigned int GPS_word)
}
bool Gps_Navigation_Message::read_navigation_bool(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter)
bool Gps_Navigation_Message::read_navigation_bool(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter)
{
bool value;
@ -176,13 +176,13 @@ bool Gps_Navigation_Message::read_navigation_bool(std::bitset<GPS_SUBFRAME_BITS>
}
uint64_t Gps_Navigation_Message::read_navigation_unsigned(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter)
uint64_t Gps_Navigation_Message::read_navigation_unsigned(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter)
{
uint64_t value = 0;
int num_of_slices = parameter.size();
for (int i = 0; i < num_of_slices; i++)
uint64_t value = 0ULL;
int32_t num_of_slices = parameter.size();
for (int32_t i = 0; i < num_of_slices; i++)
{
for (int j = 0; j < parameter[i].second; j++)
for (int32_t j = 0; j < parameter[i].second; j++)
{
value <<= 1; //shift left
if (bits[GPS_SUBFRAME_BITS - parameter[i].first - j] == 1)
@ -195,30 +195,30 @@ uint64_t Gps_Navigation_Message::read_navigation_unsigned(std::bitset<GPS_SUBFRA
}
int64_t Gps_Navigation_Message::read_navigation_signed(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter)
int64_t Gps_Navigation_Message::read_navigation_signed(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter)
{
int64_t value = 0;
int num_of_slices = parameter.size();
int64_t value = 0ULL;
int32_t num_of_slices = parameter.size();
// Discriminate between 64 bits and 32 bits compiler
int long_int_size_bytes = sizeof(int64_t);
int32_t long_int_size_bytes = sizeof(long int);
if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system
{
// read the MSB and perform the sign extension
if (bits[GPS_SUBFRAME_BITS - parameter[0].first] == 1)
{
value ^= 0xFFFFFFFFFFFFFFFF; //64 bits variable
value ^= 0xFFFFFFFFFFFFFFFF; // 64 bits variable
}
else
{
value &= 0;
}
for (int i = 0; i < num_of_slices; i++)
for (int32_t i = 0; i < num_of_slices; i++)
{
for (int j = 0; j < parameter[i].second; j++)
for (int32_t j = 0; j < parameter[i].second; j++)
{
value <<= 1; //shift left
value &= 0xFFFFFFFFFFFFFFFE; //reset the corresponding bit (for the 64 bits variable)
value <<= 1; // shift left
value &= 0xFFFFFFFFFFFFFFFE; // reset the corresponding bit (for the 64 bits variable)
if (bits[GPS_SUBFRAME_BITS - parameter[i].first - j] == 1)
{
value += 1; // insert the bit
@ -238,12 +238,12 @@ int64_t Gps_Navigation_Message::read_navigation_signed(std::bitset<GPS_SUBFRAME_
value &= 0;
}
for (int i = 0; i < num_of_slices; i++)
for (int32_t i = 0; i < num_of_slices; i++)
{
for (int j = 0; j < parameter[i].second; j++)
for (int32_t j = 0; j < parameter[i].second; j++)
{
value <<= 1; //shift left
value &= 0xFFFFFFFE; //reset the corresponding bit
value <<= 1; // shift left
value &= 0xFFFFFFFE; // reset the corresponding bit
if (bits[GPS_SUBFRAME_BITS - parameter[i].first - j] == 1)
{
value += 1; // insert the bit
@ -254,28 +254,25 @@ int64_t Gps_Navigation_Message::read_navigation_signed(std::bitset<GPS_SUBFRAME_
return value;
}
int Gps_Navigation_Message::subframe_decoder(char *subframe)
int32_t Gps_Navigation_Message::subframe_decoder(char *subframe)
{
int subframe_ID = 0;
//double tmp_TOW;
unsigned int gps_word;
int32_t subframe_ID = 0;
uint32_t gps_word;
// UNPACK BYTES TO BITS AND REMOVE THE CRC REDUNDANCE
std::bitset<GPS_SUBFRAME_BITS> subframe_bits;
std::bitset<GPS_WORD_BITS + 2> word_bits;
for (int i = 0; i < 10; i++)
for (int32_t i = 0; i < 10; i++)
{
memcpy(&gps_word, &subframe[i * 4], sizeof(char) * 4);
word_bits = std::bitset<(GPS_WORD_BITS + 2)>(gps_word);
for (int j = 0; j < GPS_WORD_BITS; j++)
for (int32_t j = 0; j < GPS_WORD_BITS; j++)
{
subframe_bits[GPS_WORD_BITS * (9 - i) + j] = word_bits[j];
}
}
subframe_ID = static_cast<int>(read_navigation_unsigned(subframe_bits, SUBFRAME_ID));
subframe_ID = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, SUBFRAME_ID));
// Decode all 5 sub-frames
switch (subframe_ID)
@ -295,11 +292,11 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
i_GPS_week = static_cast<int>(read_navigation_unsigned(subframe_bits, GPS_WEEK));
i_SV_accuracy = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_ACCURACY)); // (20.3.3.3.1.3)
i_SV_health = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_HEALTH));
i_GPS_week = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, GPS_WEEK));
i_SV_accuracy = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, SV_ACCURACY)); // (20.3.3.3.1.3)
i_SV_health = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, SV_HEALTH));
b_L2_P_data_flag = read_navigation_bool(subframe_bits, L2_P_DATA_FLAG); //
i_code_on_L2 = static_cast<int>(read_navigation_unsigned(subframe_bits, CA_OR_P_ON_L2));
i_code_on_L2 = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, CA_OR_P_ON_L2));
d_TGD = static_cast<double>(read_navigation_signed(subframe_bits, T_GD));
d_TGD = d_TGD * T_GD_LSB;
d_IODC = static_cast<double>(read_navigation_unsigned(subframe_bits, IODC));
@ -311,7 +308,6 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
d_A_f1 = d_A_f1 * A_F1_LSB;
d_A_f2 = static_cast<double>(read_navigation_signed(subframe_bits, A_F2));
d_A_f2 = d_A_f2 * A_F2_LSB;
break;
case 2: //--- It is subframe 2 -------------------
@ -339,9 +335,8 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
d_Toe = static_cast<double>(read_navigation_unsigned(subframe_bits, T_OE));
d_Toe = d_Toe * T_OE_LSB;
b_fit_interval_flag = read_navigation_bool(subframe_bits, FIT_INTERVAL_FLAG);
i_AODO = static_cast<int>(read_navigation_unsigned(subframe_bits, AODO));
i_AODO = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, AODO));
i_AODO = i_AODO * AODO_LSB;
break;
case 3: // --- It is subframe 3 -------------------------------------
@ -368,20 +363,19 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
d_IODE_SF3 = static_cast<double>(read_navigation_unsigned(subframe_bits, IODE_SF3));
d_IDOT = static_cast<double>(read_navigation_signed(subframe_bits, I_DOT));
d_IDOT = d_IDOT * I_DOT_LSB;
break;
case 4: // --- It is subframe 4 ---------- Almanac, ionospheric model, UTC parameters, SV health (PRN: 25-32)
int SV_data_ID;
int SV_page;
int32_t SV_data_ID;
int32_t SV_page;
d_TOW_SF4 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW));
d_TOW_SF4 = d_TOW_SF4 * 6.0;
d_TOW = d_TOW_SF4; // Set transmission time
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
SV_data_ID = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_DATA_ID));
SV_page = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_PAGE));
SV_data_ID = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, SV_DATA_ID));
SV_page = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, SV_PAGE));
if (SV_page > 24 && SV_page < 33) // Page 4 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
{
//! \TODO read almanac
@ -420,10 +414,10 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
d_A0 = d_A0 * A_0_LSB;
d_t_OT = static_cast<double>(read_navigation_unsigned(subframe_bits, T_OT));
d_t_OT = d_t_OT * T_OT_LSB;
i_WN_T = static_cast<int>(read_navigation_unsigned(subframe_bits, WN_T));
i_WN_T = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, WN_T));
d_DeltaT_LS = static_cast<double>(read_navigation_signed(subframe_bits, DELTAT_LS));
i_WN_LSF = static_cast<int>(read_navigation_unsigned(subframe_bits, WN_LSF));
i_DN = static_cast<int>(read_navigation_unsigned(subframe_bits, DN)); // Right-justified ?
i_WN_LSF = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, WN_LSF));
i_DN = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, DN)); // Right-justified ?
d_DeltaT_LSF = static_cast<double>(read_navigation_signed(subframe_bits, DELTAT_LSF));
flag_iono_valid = true;
flag_utc_model_valid = true;
@ -437,29 +431,28 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
{
// Page 25 Anti-Spoofing, SV config and almanac health (PRN: 25-32)
//! \TODO Read Anti-Spoofing, SV config
almanacHealth[25] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV25));
almanacHealth[26] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV26));
almanacHealth[27] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV27));
almanacHealth[28] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV28));
almanacHealth[29] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV29));
almanacHealth[30] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV30));
almanacHealth[31] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV31));
almanacHealth[32] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV32));
almanacHealth[25] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV25));
almanacHealth[26] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV26));
almanacHealth[27] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV27));
almanacHealth[28] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV28));
almanacHealth[29] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV29));
almanacHealth[30] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV30));
almanacHealth[31] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV31));
almanacHealth[32] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV32));
}
break;
case 5: //--- It is subframe 5 -----------------almanac health (PRN: 1-24) and Almanac reference week number and time.
int SV_data_ID_5;
int SV_page_5;
int32_t SV_data_ID_5;
int32_t SV_page_5;
d_TOW_SF5 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW));
d_TOW_SF5 = d_TOW_SF5 * 6.0;
d_TOW = d_TOW_SF5; // Set transmission time
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
SV_data_ID_5 = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_DATA_ID));
SV_page_5 = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_PAGE));
SV_data_ID_5 = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, SV_DATA_ID));
SV_page_5 = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, SV_PAGE));
if (SV_page_5 < 25)
{
//! \TODO read almanac
@ -471,31 +464,31 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
{
d_Toa = static_cast<double>(read_navigation_unsigned(subframe_bits, T_OA));
d_Toa = d_Toa * T_OA_LSB;
i_WN_A = static_cast<int>(read_navigation_unsigned(subframe_bits, WN_A));
almanacHealth[1] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV1));
almanacHealth[2] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV2));
almanacHealth[3] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV3));
almanacHealth[4] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV4));
almanacHealth[5] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV5));
almanacHealth[6] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV6));
almanacHealth[7] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV7));
almanacHealth[8] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV8));
almanacHealth[9] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV9));
almanacHealth[10] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV10));
almanacHealth[11] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV11));
almanacHealth[12] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV12));
almanacHealth[13] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV13));
almanacHealth[14] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV14));
almanacHealth[15] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV15));
almanacHealth[16] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV16));
almanacHealth[17] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV17));
almanacHealth[18] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV18));
almanacHealth[19] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV19));
almanacHealth[20] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV20));
almanacHealth[21] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV21));
almanacHealth[22] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV22));
almanacHealth[23] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV23));
almanacHealth[24] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV24));
i_WN_A = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, WN_A));
almanacHealth[1] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV1));
almanacHealth[2] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV2));
almanacHealth[3] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV3));
almanacHealth[4] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV4));
almanacHealth[5] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV5));
almanacHealth[6] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV6));
almanacHealth[7] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV7));
almanacHealth[8] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV8));
almanacHealth[9] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV9));
almanacHealth[10] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV10));
almanacHealth[11] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV11));
almanacHealth[12] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV12));
almanacHealth[13] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV13));
almanacHealth[14] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV14));
almanacHealth[15] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV15));
almanacHealth[16] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV16));
almanacHealth[17] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV17));
almanacHealth[18] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV18));
almanacHealth[19] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV19));
almanacHealth[20] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV20));
almanacHealth[21] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV21));
almanacHealth[22] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV22));
almanacHealth[23] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV23));
almanacHealth[24] = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, HEALTH_SV24));
}
break;
@ -514,12 +507,12 @@ double Gps_Navigation_Message::utc_time(const double gpstime_corrected) const
double Delta_t_UTC = d_DeltaT_LS + d_A0 + d_A1 * (gpstime_corrected - d_t_OT + 604800 * static_cast<double>((i_GPS_week - i_WN_T)));
// Determine if the effectivity time of the leap second event is in the past
int weeksToLeapSecondEvent = i_WN_LSF - i_GPS_week;
int32_t weeksToLeapSecondEvent = i_WN_LSF - i_GPS_week;
if ((weeksToLeapSecondEvent) >= 0) // is not in the past
{
//Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s
int secondOfLeapSecondEvent = i_DN * 24 * 60 * 60;
int32_t secondOfLeapSecondEvent = i_DN * 24 * 60 * 60;
if (weeksToLeapSecondEvent > 0)
{
t_utc_daytime = fmod(gpstime_corrected - Delta_t_UTC, 86400);
@ -545,7 +538,7 @@ double Gps_Navigation_Message::utc_time(const double gpstime_corrected) const
* proper accommodation of the leap second event with a possible week number
* transition is provided by the following expression for UTC:
*/
int W = fmod(gpstime_corrected - Delta_t_UTC - 43200, 86400) + 43200;
int32_t W = fmod(gpstime_corrected - Delta_t_UTC - 43200, 86400) + 43200;
t_utc_daytime = fmod(W, 86400 + d_DeltaT_LSF - d_DeltaT_LS);
//implement something to handle a leap second event!
}

View File

@ -54,10 +54,10 @@
class Gps_Navigation_Message
{
private:
uint64_t read_navigation_unsigned(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
int64_t read_navigation_signed(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
bool read_navigation_bool(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
void print_gps_word_bytes(unsigned int GPS_word);
uint64_t read_navigation_unsigned(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter);
int64_t read_navigation_signed(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter);
bool read_navigation_bool(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int32_t, int32_t>> parameter);
void print_gps_word_bytes(uint32_t GPS_word);
public:
bool b_valid_ephemeris_set_flag; // flag indicating that this ephemeris set have passed the validation check
@ -92,16 +92,16 @@ public:
double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s]
//broadcast orbit 5
double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s]
int i_code_on_L2; //!< If 1, P code ON in L2; if 2, C/A code ON in L2;
int i_GPS_week; //!< GPS week number, aka WN [week]
int32_t i_code_on_L2; //!< If 1, P code ON in L2; if 2, C/A code ON in L2;
int32_t i_GPS_week; //!< GPS week number, aka WN [week]
bool b_L2_P_data_flag; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel
//broadcast orbit 6
int i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200E)
int i_SV_health;
int32_t i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200E)
int32_t i_SV_health;
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_IODC; //!< Issue of Data, Clock
//broadcast orbit 7
int i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
int32_t i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
bool b_fit_interval_flag; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours.
double d_spare1;
@ -113,11 +113,11 @@ public:
// Almanac
double d_Toa; //!< Almanac reference time [s]
int i_WN_A; //!< Modulo 256 of the GPS week number to which the almanac reference time (d_Toa) is referenced
std::map<int, int> almanacHealth; //!< Map that stores the health information stored in the almanac
double d_Toa; //!< Almanac reference time [s]
int32_t i_WN_A; //!< Modulo 256 of the GPS week number to which the almanac reference time (d_Toa) is referenced
std::map<int32_t, int32_t> almanacHealth; //!< Map that stores the health information stored in the almanac
std::map<int, std::string> satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus
std::map<int32_t, std::string> satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus
// Flags
@ -147,8 +147,8 @@ public:
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 identification info
int i_channel_ID;
unsigned int i_satellite_PRN;
int32_t i_channel_ID;
uint32_t i_satellite_PRN;
// time synchro
double d_subframe_timestamp_ms; //[ms]
@ -169,10 +169,10 @@ public:
double d_A1; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s/s]
double d_A0; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s]
double d_t_OT; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200E) [s]
int i_WN_T; //!< UTC reference week number [weeks]
int32_t i_WN_T; //!< UTC reference week number [weeks]
double d_DeltaT_LS; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac.
int i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks]
int i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days]
int32_t i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks]
int32_t i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days]
double d_DeltaT_LSF; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s]
// Satellite velocity
@ -202,7 +202,7 @@ public:
/*!
* \brief Decodes the GPS NAV message
*/
int subframe_decoder(char *subframe);
int32_t subframe_decoder(char *subframe);
/*!
* \brief Computes the Coordinated Universal Time (UTC) and

View File

@ -35,34 +35,35 @@
Gps_Utc_Model::Gps_Utc_Model()
{
valid = false;
d_A1 = 0;
d_A0 = 0;
d_t_OT = 0;
d_A1 = 0.0;
d_A0 = 0.0;
d_t_OT = 0.0;
i_WN_T = 0;
d_DeltaT_LS = 0;
d_DeltaT_LS = 0.0;
i_WN_LSF = 0;
i_DN = 0;
d_DeltaT_LSF = 0;
d_DeltaT_LSF = 0.0;
}
double Gps_Utc_Model::utc_time(double gpstime_corrected, int i_GPS_week)
double Gps_Utc_Model::utc_time(double gpstime_corrected, int32_t i_GPS_week)
{
double t_utc;
double t_utc_daytime;
double Delta_t_UTC = d_DeltaT_LS + d_A0 + d_A1 * (gpstime_corrected - d_t_OT + 604800 * static_cast<double>(i_GPS_week - i_WN_T));
// Determine if the effectivity time of the leap second event is in the past
int weeksToLeapSecondEvent = i_WN_LSF - i_GPS_week;
int32_t weeksToLeapSecondEvent = i_WN_LSF - i_GPS_week;
if (weeksToLeapSecondEvent >= 0) // is not in the past
{
//Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s
int secondOfLeapSecondEvent = i_DN * 24 * 60 * 60;
// Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s
int32_t secondOfLeapSecondEvent = i_DN * 24 * 60 * 60;
if (weeksToLeapSecondEvent > 0)
{
t_utc_daytime = fmod(gpstime_corrected - Delta_t_UTC, 86400);
}
else //we are in the same week than the leap second event
else // we are in the same week than the leap second event
{
if (std::abs(gpstime_corrected - secondOfLeapSecondEvent) > 21600)
{
@ -83,9 +84,9 @@ double Gps_Utc_Model::utc_time(double gpstime_corrected, int i_GPS_week)
* proper accommodation of the leap second event with a possible week number
* transition is provided by the following expression for UTC:
*/
int W = fmod(gpstime_corrected - Delta_t_UTC - 43200, 86400) + 43200;
int32_t W = fmod(gpstime_corrected - Delta_t_UTC - 43200, 86400) + 43200;
t_utc_daytime = fmod(W, 86400 + d_DeltaT_LSF - d_DeltaT_LS);
//implement something to handle a leap second event!
// implement something to handle a leap second event!
}
if ((gpstime_corrected - secondOfLeapSecondEvent) > 21600)
{

View File

@ -32,9 +32,8 @@
#ifndef GNSS_SDR_GPS_UTC_MODEL_H_
#define GNSS_SDR_GPS_UTC_MODEL_H_
#include <boost/assign.hpp>
#include <boost/serialization/nvp.hpp>
#include <cstdint>
/*!
* \brief This class is a storage for the GPS UTC MODEL data as described in IS-GPS-200E
@ -49,10 +48,10 @@ public:
double d_A1; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s/s]
double d_A0; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s]
double d_t_OT; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200E) [s]
int i_WN_T; //!< UTC reference week number [weeks]
int32_t i_WN_T; //!< UTC reference week number [weeks]
double d_DeltaT_LS; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac.
int i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks]
int i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days]
int32_t i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks]
int32_t i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days]
double d_DeltaT_LSF; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s]
/*!
@ -64,7 +63,7 @@ public:
/*
* \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.
*/
inline void serialize(Archive& archive, const unsigned int version)
inline void serialize(Archive& archive, const uint32_t version)
{
using boost::serialization::make_nvp;
if (version)
@ -85,7 +84,7 @@ public:
* \brief Computes the Coordinated Universal Time (UTC) and
* returns it in [s] (IS-GPS-200E, 20.3.3.5.2.4)
*/
double utc_time(double gpstime_corrected, int i_GPS_week);
double utc_time(double gpstime_corrected, int32_t i_GPS_week);
};
#endif