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