GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
GPS_CNAV.h
Go to the documentation of this file.
1 /*!
2  * \file GPS_CNAV.h
3  * \brief Defines parameters for GPS CNAV
4  * \author Antonio Ramos, 2017. antonio.ramos(at)cttc.es
5  *
6  * -----------------------------------------------------------------------------
7  *
8  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
9  * This file is part of GNSS-SDR.
10  *
11  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
12  * SPDX-License-Identifier: GPL-3.0-or-later
13  *
14  * -----------------------------------------------------------------------------
15  */
16 
17 
18 #ifndef GNSS_SDR_GPS_CNAV_H
19 #define GNSS_SDR_GPS_CNAV_H
20 
21 #include "MATH_CONSTANTS.h"
22 #include <cstdint>
23 #include <utility> // std::pair
24 #include <vector>
25 
26 /** \addtogroup Core
27  * \{ */
28 /** \addtogroup System_Parameters
29  * \{ */
30 
31 
32 // CNAV GPS NAVIGATION MESSAGE STRUCTURE
33 // NAVIGATION MESSAGE FIELDS POSITIONS (from IS-GPS-200M Appendix III)
34 
35 constexpr int32_t GPS_CNAV_DATA_PAGE_BITS = 300;
36 
37 // common to all messages
38 const std::vector<std::pair<int32_t, int32_t> > CNAV_PRN({{9, 6}});
39 const std::vector<std::pair<int32_t, int32_t> > CNAV_MSG_TYPE({{15, 6}});
40 const std::vector<std::pair<int32_t, int32_t> > CNAV_TOW({{21, 17}}); // GPS Time Of Week in seconds
41 constexpr int32_t CNAV_TOW_LSB = 6;
42 const std::vector<std::pair<int32_t, int32_t> > CNAV_ALERT_FLAG({{38, 1}});
43 
44 // MESSAGE TYPE 10 (Ephemeris 1)
45 const std::vector<std::pair<int32_t, int32_t> > CNAV_WN({{39, 13}});
46 const std::vector<std::pair<int32_t, int32_t> > CNAV_HEALTH({{52, 3}});
47 const std::vector<std::pair<int32_t, int32_t> > CNAV_TOP1({{55, 11}});
48 constexpr int32_t CNAV_TOP1_LSB = 300;
49 const std::vector<std::pair<int32_t, int32_t> > CNAV_URA({{66, 5}});
50 
51 const std::vector<std::pair<int32_t, int32_t> > CNAV_TOE1({{71, 11}});
52 constexpr int32_t CNAV_TOE1_LSB = 300;
53 
54 const std::vector<std::pair<int32_t, int32_t> > CNAV_DELTA_A({{82, 26}}); // Relative to AREF = 26,559,710 meters
55 constexpr double CNAV_DELTA_A_LSB = TWO_N9;
56 
57 const std::vector<std::pair<int32_t, int32_t> > CNAV_A_DOT({{108, 25}});
58 constexpr double CNAV_A_DOT_LSB = TWO_N21;
59 
60 const std::vector<std::pair<int32_t, int32_t> > CNAV_DELTA_N0({{133, 17}});
61 constexpr double CNAV_DELTA_N0_LSB = TWO_N44 * GNSS_PI; // semi-circles to radians
62 const std::vector<std::pair<int32_t, int32_t> > CNAV_DELTA_N0_DOT({{150, 23}});
63 constexpr double CNAV_DELTA_N0_DOT_LSB = TWO_N57 * GNSS_PI; // semi-circles to radians
64 const std::vector<std::pair<int32_t, int32_t> > CNAV_M0({{173, 33}});
65 constexpr double CNAV_M0_LSB = TWO_N32 * GNSS_PI; // semi-circles to radians
66 const std::vector<std::pair<int32_t, int32_t> > CNAV_E_ECCENTRICITY({{206, 33}});
67 constexpr double CNAV_E_ECCENTRICITY_LSB = TWO_N34;
68 const std::vector<std::pair<int32_t, int32_t> > CNAV_OMEGA({{239, 33}});
69 constexpr double CNAV_OMEGA_LSB = TWO_N32 * GNSS_PI; // semi-circles to radians
70 const std::vector<std::pair<int32_t, int32_t> > CNAV_INTEGRITY_FLAG({{272, 1}});
71 const std::vector<std::pair<int32_t, int32_t> > CNAV_L2_PHASING_FLAG({{273, 1}});
72 
73 // MESSAGE TYPE 11 (Ephemeris 2)
74 const std::vector<std::pair<int32_t, int32_t> > CNAV_TOE2({{39, 11}});
75 constexpr int32_t CNAV_TOE2_LSB = 300;
76 const std::vector<std::pair<int32_t, int32_t> > CNAV_OMEGA0({{50, 33}});
77 constexpr double CNAV_OMEGA0_LSB = TWO_N32 * GNSS_PI; // semi-circles to radians
78 const std::vector<std::pair<int32_t, int32_t> > CNAV_I0({{83, 33}});
79 constexpr double CNAV_I0_LSB = TWO_N32 * GNSS_PI; // semi-circles to radians
80 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.
81 constexpr double CNAV_DELTA_OMEGA_DOT_LSB = TWO_N44 * GNSS_PI; // semi-circles to radians
82 const std::vector<std::pair<int32_t, int32_t> > CNAV_I0_DOT({{133, 15}});
83 constexpr double CNAV_I0_DOT_LSB = TWO_N44 * GNSS_PI; // semi-circles to radians
84 const std::vector<std::pair<int32_t, int32_t> > CNAV_CIS({{148, 16}});
85 constexpr double CNAV_CIS_LSB = TWO_N30;
86 const std::vector<std::pair<int32_t, int32_t> > CNAV_CIC({{164, 16}});
87 constexpr double CNAV_CIC_LSB = TWO_N30;
88 const std::vector<std::pair<int32_t, int32_t> > CNAV_CRS({{180, 24}});
89 constexpr double CNAV_CRS_LSB = TWO_N8;
90 const std::vector<std::pair<int32_t, int32_t> > CNAV_CRC({{204, 24}});
91 constexpr double CNAV_CRC_LSB = TWO_N8;
92 const std::vector<std::pair<int32_t, int32_t> > CNAV_CUS({{228, 21}});
93 constexpr double CNAV_CUS_LSB = TWO_N30;
94 const std::vector<std::pair<int32_t, int32_t> > CNAV_CUC({{249, 21}});
95 constexpr double CNAV_CUC_LSB = TWO_N30;
96 
97 
98 // MESSAGE TYPE 30 (CLOCK, IONO, GRUP DELAY)
99 const std::vector<std::pair<int32_t, int32_t> > CNAV_TOP2({{39, 11}});
100 constexpr int32_t CNAV_TOP2_LSB = 300;
101 const std::vector<std::pair<int32_t, int32_t> > CNAV_URA_NED0({{50, 5}});
102 const std::vector<std::pair<int32_t, int32_t> > CNAV_URA_NED1({{55, 3}});
103 const std::vector<std::pair<int32_t, int32_t> > CNAV_URA_NED2({{58, 3}});
104 const std::vector<std::pair<int32_t, int32_t> > CNAV_TOC({{61, 11}});
105 constexpr int32_t CNAV_TOC_LSB = 300;
106 const std::vector<std::pair<int, int> > CNAV_AF0({{72, 26}});
107 constexpr double CNAV_AF0_LSB = TWO_N35;
108 const std::vector<std::pair<int, int> > CNAV_AF1({{98, 20}});
109 constexpr double CNAV_AF1_LSB = TWO_N48;
110 const std::vector<std::pair<int, int> > CNAV_AF2({{118, 10}});
111 constexpr double CNAV_AF2_LSB = TWO_N60;
112 const std::vector<std::pair<int, int> > CNAV_TGD({{128, 13}});
113 constexpr double CNAV_TGD_LSB = TWO_N35;
114 const std::vector<std::pair<int32_t, int32_t> > CNAV_ISCL1({{141, 13}});
115 constexpr double CNAV_ISCL1_LSB = TWO_N35;
116 const std::vector<std::pair<int32_t, int32_t> > CNAV_ISCL2({{154, 13}});
117 constexpr double CNAV_ISCL2_LSB = TWO_N35;
118 const std::vector<std::pair<int32_t, int32_t> > CNAV_ISCL5I({{167, 13}});
119 constexpr double CNAV_ISCL5I_LSB = TWO_N35;
120 const std::vector<std::pair<int32_t, int32_t> > CNAV_ISCL5Q({{180, 13}});
121 constexpr double CNAV_ISCL5Q_LSB = TWO_N35;
122 // Ionospheric parameters
123 const std::vector<std::pair<int32_t, int32_t> > CNAV_ALPHA0({{193, 8}});
124 constexpr double CNAV_ALPHA0_LSB = TWO_N30;
125 const std::vector<std::pair<int32_t, int32_t> > CNAV_ALPHA1({{201, 8}});
126 constexpr double CNAV_ALPHA1_LSB = TWO_N27;
127 const std::vector<std::pair<int32_t, int32_t> > CNAV_ALPHA2({{209, 8}});
128 constexpr double CNAV_ALPHA2_LSB = TWO_N24;
129 const std::vector<std::pair<int32_t, int32_t> > CNAV_ALPHA3({{217, 8}});
130 constexpr double CNAV_ALPHA3_LSB = TWO_N24;
131 const std::vector<std::pair<int32_t, int32_t> > CNAV_BETA0({{225, 8}});
132 constexpr double CNAV_BETA0_LSB = TWO_P11;
133 const std::vector<std::pair<int32_t, int32_t> > CNAV_BETA1({{233, 8}});
134 constexpr double CNAV_BETA1_LSB = TWO_P14;
135 const std::vector<std::pair<int32_t, int32_t> > CNAV_BETA2({{241, 8}});
136 constexpr double CNAV_BETA2_LSB = TWO_P16;
137 const std::vector<std::pair<int32_t, int32_t> > CNAV_BETA3({{249, 8}});
138 constexpr double CNAV_BETA3_LSB = TWO_P16;
139 const std::vector<std::pair<int32_t, int32_t> > CNAV_WNOP({{257, 8}});
140 
141 
142 // MESSAGE TYPE 33 (CLOCK and UTC)
143 const std::vector<std::pair<int32_t, int32_t> > CNAV_A0({{128, 16}});
144 constexpr double CNAV_A0_LSB = TWO_N35;
145 const std::vector<std::pair<int32_t, int32_t> > CNAV_A1({{144, 13}});
146 constexpr double CNAV_A1_LSB = TWO_N51;
147 const std::vector<std::pair<int32_t, int32_t> > CNAV_A2({{157, 7}});
148 constexpr double CNAV_A2_LSB = TWO_N68;
149 const std::vector<std::pair<int32_t, int32_t> > CNAV_DELTA_TLS({{164, 8}});
150 constexpr int32_t CNAV_DELTA_TLS_LSB = 1;
151 const std::vector<std::pair<int32_t, int32_t> > CNAV_TOT({{172, 16}});
152 constexpr int32_t CNAV_TOT_LSB = TWO_P4;
153 const std::vector<std::pair<int32_t, int32_t> > CNAV_WN_OT({{188, 13}});
154 constexpr int32_t CNAV_WN_OT_LSB = 1;
155 const std::vector<std::pair<int32_t, int32_t> > CNAV_WN_LSF({{201, 13}});
156 constexpr int32_t CNAV_WN_LSF_LSB = 1;
157 const std::vector<std::pair<int32_t, int32_t> > CNAV_DN({{214, 4}});
158 constexpr int32_t CNAV_DN_LSB = 1;
159 const std::vector<std::pair<int32_t, int32_t> > CNAV_DELTA_TLSF({{218, 8}});
160 constexpr int32_t CNAV_DELTA_TLSF_LSB = 1;
161 
162 constexpr double CNAV_A_REF = 26559710.0; // [m] See IS-GPS-200M, Table 30-I.
163 constexpr double CNAV_OMEGA_DOT_REF = -2.6e-9; // [semicircles / s], see IS-GPS-200M, Table 30-I.
164 
165 // TODO: Add more frames (Almanac, etc...)
166 
167 
168 /** \} */
169 /** \} */
170 #endif // GNSS_SDR_GPS_CNAV_H
constexpr double TWO_N21
2^-21
constexpr double TWO_N57
2^-57
constexpr double TWO_N8
2^-8
constexpr double TWO_N48
2^-46
constexpr double TWO_P4
2^4
constexpr double TWO_N32
2^-32
constexpr double TWO_N68
2^-68
constexpr double TWO_P14
2^14
constexpr double TWO_N35
2^-35
Defines useful mathematical constants and their scaled versions.
constexpr double TWO_N30
2^-30
constexpr double TWO_N51
2^-51
constexpr double TWO_P16
2^16
constexpr double TWO_N34
2^-34
constexpr double TWO_N9
2^-9
constexpr double TWO_N24
2^-24
constexpr double GNSS_PI
pi constant as defined for GNSS
constexpr double TWO_P11
2^11
constexpr double TWO_N60
2^-60
constexpr double TWO_N27
2^-27
constexpr double TWO_N44
2^-44