18#ifndef GNSS_SDR_BEIDOU_DNAV_H
19#define GNSS_SDR_BEIDOU_DNAV_H
34constexpr double D1_TOC_LSB =
TWO_P3;
35constexpr double D1_TGD1_LSB = 0.1e-9;
36constexpr double D1_TGD2_LSB = 0.1e-9;
37constexpr double D1_ALPHA0_LSB =
TWO_N30;
38constexpr double D1_ALPHA1_LSB =
TWO_N27;
39constexpr double D1_ALPHA2_LSB =
TWO_N24;
40constexpr double D1_ALPHA3_LSB =
TWO_N24;
41constexpr double D1_BETA0_LSB =
TWO_P11;
42constexpr double D1_BETA1_LSB =
TWO_P14;
43constexpr double D1_BETA2_LSB =
TWO_P16;
44constexpr double D1_BETA3_LSB =
TWO_P16;
45constexpr double D1_A2_LSB =
TWO_N66;
46constexpr double D1_A0_LSB =
TWO_N33;
47constexpr double D1_A1_LSB =
TWO_N50;
49constexpr double D1_CUC_LSB =
TWO_N31;
51constexpr double D1_E_LSB =
TWO_N33;
52constexpr double D1_CUS_LSB =
TWO_N31;
53constexpr double D1_CRC_LSB =
TWO_N6;
54constexpr double D1_CRS_LSB =
TWO_N6;
55constexpr double D1_SQRT_A_LSB =
TWO_N19;
56constexpr double D1_TOE_LSB =
TWO_P3;
58constexpr double D1_CIC_LSB =
TWO_N31;
60constexpr double D1_CIS_LSB =
TWO_N31;
65constexpr double D1_SQRT_A_ALMANAC_LSB =
TWO_N11;
66constexpr double D1_A1_ALMANAC_LSB =
TWO_N38;
67constexpr double D1_A0_ALMANAC_LSB =
TWO_N20;
68constexpr double D1_OMEGA0_ALMANAC_LSB =
PI_TWO_N23;
69constexpr double D1_E_ALMANAC_LSB =
TWO_N21;
71constexpr double D1_TOA_LSB =
TWO_P12;
72constexpr double D1_OMEGA_DOT_ALMANAC_LSB =
PI_TWO_N38;
73constexpr double D1_OMEGA_ALMANAC_LSB =
PI_TWO_N23;
74constexpr double D1_M0_ALMANAC_LSB =
PI_TWO_N23;
75constexpr double D1_A0GPS_LSB = 0.1e-9;
76constexpr double D1_A1GPS_LSB = 0.1e-9;
77constexpr double D1_A0GAL_LSB = 0.1e-9;
78constexpr double D1_A1GAL_LSB = 0.1e-9;
79constexpr double D1_A0GLO_LSB = 0.1e-9;
80constexpr double D1_A1GLO_LSB = 0.1e-9;
81constexpr double D1_A0UTC_LSB =
TWO_N30;
82constexpr double D1_A1UTC_LSB =
TWO_N50;
84constexpr int32_t BEIDOU_DNAV_PREAMBLE_LENGTH_BITS = 11;
85constexpr int32_t BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS = 11;
86constexpr int32_t BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS = 300;
89constexpr int32_t BEIDOU_DNAV_BDT2GPST_LEAP_SEC_OFFSET = 14;
91constexpr int32_t BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET = 1356;
93constexpr uint32_t BEIDOU_DNAV_SUBFRAME_SYMBOLS = 300;
94constexpr uint32_t BEIDOU_DNAV_WORDS_SUBFRAME = 10;
95constexpr uint32_t BEIDOU_DNAV_WORD_LENGTH_BITS = 30;
96constexpr char BEIDOU_DNAV_PREAMBLE[12] =
"11100010010";
101const std::vector<std::pair<int32_t, int32_t> > D1_PRE({{1, 11}});
102const std::vector<std::pair<int32_t, int32_t> > D1_FRAID({{16, 3}});
103const std::vector<std::pair<int32_t, int32_t> > D1_SOW({{19, 8}, {31, 12}});
104const std::vector<std::pair<int32_t, int32_t> > D1_PNUM({{44, 7}});
107const std::vector<std::pair<int32_t, int32_t> > D1_SAT_H1({{43, 1}});
108const std::vector<std::pair<int32_t, int32_t> > D1_AODC({{44, 5}});
109const std::vector<std::pair<int32_t, int32_t> > D1_URAI({{49, 4}});
110const std::vector<std::pair<int32_t, int32_t> > D1_WN({{61, 13}});
111const std::vector<std::pair<int32_t, int32_t> > D1_TOC({{74, 9}, {91, 8}});
112const std::vector<std::pair<int32_t, int32_t> > D1_TGD1({{99, 10}});
113const std::vector<std::pair<int32_t, int32_t> > D1_TGD2({{109, 4}, {121, 6}});
114const std::vector<std::pair<int32_t, int32_t> > D1_ALPHA0({{127, 8}});
115const std::vector<std::pair<int32_t, int32_t> > D1_ALPHA1({{135, 8}});
116const std::vector<std::pair<int32_t, int32_t> > D1_ALPHA2({{151, 8}});
117const std::vector<std::pair<int32_t, int32_t> > D1_ALPHA3({{159, 8}});
118const std::vector<std::pair<int32_t, int32_t> > D1_BETA0({{167, 6}, {181, 2}});
119const std::vector<std::pair<int32_t, int32_t> > D1_BETA1({{183, 8}});
120const std::vector<std::pair<int32_t, int32_t> > D1_BETA2({{191, 8}});
121const std::vector<std::pair<int32_t, int32_t> > D1_BETA3({{199, 4}, {211, 4}});
122const std::vector<std::pair<int32_t, int32_t> > D1_A2({{215, 11}});
123const std::vector<std::pair<int32_t, int32_t> > D1_A0({{226, 7}, {241, 17}});
124const std::vector<std::pair<int32_t, int32_t> > D1_A1({{258, 5}, {271, 17}});
125const std::vector<std::pair<int32_t, int32_t> > D1_AODE({{288, 5}});
128const std::vector<std::pair<int32_t, int32_t> > D1_DELTA_N({{43, 10}, {61, 6}});
129const std::vector<std::pair<int32_t, int32_t> > D1_CUC({{67, 16}, {91, 2}});
130const std::vector<std::pair<int32_t, int32_t> > D1_M0({{93, 20}, {121, 12}});
131const std::vector<std::pair<int32_t, int32_t> > D1_E({{133, 10}, {151, 22}});
132const std::vector<std::pair<int32_t, int32_t> > D1_CUS({{181, 18}});
133const std::vector<std::pair<int32_t, int32_t> > D1_CRC({{199, 4}, {211, 14}});
134const std::vector<std::pair<int32_t, int32_t> > D1_CRS({{225, 8}, {241, 10}});
135const std::vector<std::pair<int32_t, int32_t> > D1_SQRT_A({{251, 12}, {271, 20}});
136const std::vector<std::pair<int32_t, int32_t> > D1_TOE_SF2({{291, 2}});
139const std::vector<std::pair<int32_t, int32_t> > D1_TOE_SF3({{43, 10}, {61, 5}});
140const std::vector<std::pair<int32_t, int32_t> > D1_I0({{66, 17}, {91, 15}});
141const std::vector<std::pair<int32_t, int32_t> > D1_CIC({{106, 7}, {121, 11}});
142const std::vector<std::pair<int32_t, int32_t> > D1_OMEGA_DOT({{132, 11}, {151, 13}});
143const std::vector<std::pair<int32_t, int32_t> > D1_CIS({{164, 9}, {181, 9}});
144const std::vector<std::pair<int32_t, int32_t> > D1_IDOT({{190, 13}, {211, 1}});
145const std::vector<std::pair<int32_t, int32_t> > D1_OMEGA0({{212, 21}, {241, 11}});
146const std::vector<std::pair<int32_t, int32_t> > D1_OMEGA({{252, 11}, {271, 21}});
149const std::vector<std::pair<int32_t, int32_t> > D1_SQRT_A_ALMANAC({{51, 2}, {61, 22}});
150const std::vector<std::pair<int32_t, int32_t> > D1_A1_ALMANAC({{91, 11}});
151const std::vector<std::pair<int32_t, int32_t> > D1_A0_ALMANAC({{102, 11}});
152const std::vector<std::pair<int32_t, int32_t> > D1_OMEGA0_ALMANAC({{121, 22}, {151, 2}});
153const std::vector<std::pair<int32_t, int32_t> > D1_E_ALMANAC({{153, 17}});
154const std::vector<std::pair<int32_t, int32_t> > D1_DELTA_I({{170, 3}, {181, 13}});
155const std::vector<std::pair<int32_t, int32_t> > D1_TOA({{194, 8}});
156const std::vector<std::pair<int32_t, int32_t> > D1_OMEGA_DOT_ALMANAC({{202, 1}, {211, 16}});
157const std::vector<std::pair<int32_t, int32_t> > D1_OMEGA_ALMANAC({{227, 6}, {241, 18}});
158const std::vector<std::pair<int32_t, int32_t> > D1_M0_ALMANAC({{259, 4}, {271, 20}});
161const std::vector<std::pair<int32_t, int32_t> > D1_HEA1({{51, 2}, {61, 7}});
162const std::vector<std::pair<int32_t, int32_t> > D1_HEA2({{68, 9}});
163const std::vector<std::pair<int32_t, int32_t> > D1_HEA3({{77, 6}, {91, 3}});
164const std::vector<std::pair<int32_t, int32_t> > D1_HEA4({{94, 9}});
165const std::vector<std::pair<int32_t, int32_t> > D1_HEA5({{103, 9}});
166const std::vector<std::pair<int32_t, int32_t> > D1_HEA6({{112, 1}, {121, 8}});
167const std::vector<std::pair<int32_t, int32_t> > D1_HEA7({{129, 9}});
168const std::vector<std::pair<int32_t, int32_t> > D1_HEA8({{138, 5}, {151, 4}});
169const std::vector<std::pair<int32_t, int32_t> > D1_HEA9({{155, 9}});
170const std::vector<std::pair<int32_t, int32_t> > D1_HEA10({{164, 9}});
171const std::vector<std::pair<int32_t, int32_t> > D1_HEA11({{181, 9}});
172const std::vector<std::pair<int32_t, int32_t> > D1_HEA12({{190, 9}});
173const std::vector<std::pair<int32_t, int32_t> > D1_HEA13({{199, 4}, {211, 5}});
174const std::vector<std::pair<int32_t, int32_t> > D1_HEA14({{216, 9}});
175const std::vector<std::pair<int32_t, int32_t> > D1_HEA15({{225, 8}, {241, 1}});
176const std::vector<std::pair<int32_t, int32_t> > D1_HEA16({{242, 9}});
177const std::vector<std::pair<int32_t, int32_t> > D1_HEA17({{251, 9}});
178const std::vector<std::pair<int32_t, int32_t> > D1_HEA18({{260, 3}, {271, 6}});
179const std::vector<std::pair<int32_t, int32_t> > D1_HEA19({{277, 9}});
182const std::vector<std::pair<int32_t, int32_t> > D1_HEA20({{51, 2}, {61, 7}});
183const std::vector<std::pair<int32_t, int32_t> > D1_HEA21({{68, 9}});
184const std::vector<std::pair<int32_t, int32_t> > D1_HEA22({{77, 6}, {91, 3}});
185const std::vector<std::pair<int32_t, int32_t> > D1_HEA23({{94, 9}});
186const std::vector<std::pair<int32_t, int32_t> > D1_HEA24({{103, 9}});
187const std::vector<std::pair<int32_t, int32_t> > D1_HEA25({{112, 1}, {121, 8}});
188const std::vector<std::pair<int32_t, int32_t> > D1_HEA26({{129, 9}});
189const std::vector<std::pair<int32_t, int32_t> > D1_HEA27({{138, 5}, {151, 4}});
190const std::vector<std::pair<int32_t, int32_t> > D1_HEA28({{155, 9}});
191const std::vector<std::pair<int32_t, int32_t> > D1_HEA29({{164, 9}});
192const std::vector<std::pair<int32_t, int32_t> > D1_HEA30({{181, 9}});
193const std::vector<std::pair<int32_t, int32_t> > D1_WNA({{190, 8}});
194const std::vector<std::pair<int32_t, int32_t> > D1_TOA2({{198, 5}, {211, 3}});
197const std::vector<std::pair<int32_t, int32_t> > D1_A0GPS({{97, 14}});
198const std::vector<std::pair<int32_t, int32_t> > D1_A1GPS({{111, 2}, {121, 14}});
199const std::vector<std::pair<int32_t, int32_t> > D1_A0GAL({{135, 8}, {151, 6}});
200const std::vector<std::pair<int32_t, int32_t> > D1_A1GAL({{157, 16}});
201const std::vector<std::pair<int32_t, int32_t> > D1_A0GLO({{181, 14}});
202const std::vector<std::pair<int32_t, int32_t> > D1_A1GLO({{195, 8}, {211, 8}});
205const std::vector<std::pair<int32_t, int32_t> > D1_DELTA_T_LS({{51, 2}, {61, 6}});
206const std::vector<std::pair<int32_t, int32_t> > D1_DELTA_T_LSF({{67, 8}});
207const std::vector<std::pair<int32_t, int32_t> > D1_WN_LSF({{75, 8}});
208const std::vector<std::pair<int32_t, int32_t> > D1_A0UTC({{91, 22}, {121, 10}});
209const std::vector<std::pair<int32_t, int32_t> > D1_A1UTC({{131, 12}, {151, 12}});
210const std::vector<std::pair<int32_t, int32_t> > D1_DN({{163, 8}});
213const std::vector<std::pair<int32_t, int32_t> > D2_PRE({{1, 11}});
214const std::vector<std::pair<int32_t, int32_t> > D2_FRAID({{16, 3}});
215const std::vector<std::pair<int32_t, int32_t> > D2_SOW({{19, 8}, {31, 12}});
216const std::vector<std::pair<int32_t, int32_t> > D2_PNUM({{43, 4}});
219const std::vector<std::pair<int32_t, int32_t> > D2_SAT_H1({{47, 1}});
220const std::vector<std::pair<int32_t, int32_t> > D2_AODC({{48, 5}});
221const std::vector<std::pair<int32_t, int32_t> > D2_URAI({{61, 4}});
222const std::vector<std::pair<int32_t, int32_t> > D2_WN({{65, 13}});
223const std::vector<std::pair<int32_t, int32_t> > D2_TOC({{78, 5}, {91, 12}});
224const std::vector<std::pair<int32_t, int32_t> > D2_TGD1({{103, 10}});
225const std::vector<std::pair<int32_t, int32_t> > D2_TGD2({{121, 10}});
228const std::vector<std::pair<int32_t, int32_t> > D2_ALPHA0({{47, 6}, {61, 2}});
229const std::vector<std::pair<int32_t, int32_t> > D2_ALPHA1({{63, 8}});
230const std::vector<std::pair<int32_t, int32_t> > D2_ALPHA2({{71, 8}});
231const std::vector<std::pair<int32_t, int32_t> > D2_ALPHA3({{79, 4}, {91, 4}});
232const std::vector<std::pair<int32_t, int32_t> > D2_BETA0({{95, 8}});
233const std::vector<std::pair<int32_t, int32_t> > D2_BETA1({{103, 8}});
234const std::vector<std::pair<int32_t, int32_t> > D2_BETA2({{111, 2}, {121, 6}});
235const std::vector<std::pair<int32_t, int32_t> > D2_BETA3({{127, 8}});
238const std::vector<std::pair<int32_t, int32_t> > D2_A0({{101, 12}, {121, 12}});
239const std::vector<std::pair<int32_t, int32_t> > D2_A1_MSB({{133, 4}});
240const std::vector<std::pair<int32_t, int32_t> > D2_A1_LSB({{47, 6}, {61, 12}});
241const std::vector<std::pair<int32_t, int32_t> > D2_A1({{279, 22}});
244const std::vector<std::pair<int32_t, int32_t> > D2_A2({{73, 10}, {91, 1}});
245const std::vector<std::pair<int32_t, int32_t> > D2_AODE({{92, 5}});
246const std::vector<std::pair<int32_t, int32_t> > D2_DELTA_N({{97, 16}});
247const std::vector<std::pair<int32_t, int32_t> > D2_CUC_MSB({{121, 14}});
248const std::vector<std::pair<int32_t, int32_t> > D2_CUC_LSB({{47, 4}});
249const std::vector<std::pair<int32_t, int32_t> > D2_CUC({{283, 18}});
252const std::vector<std::pair<int32_t, int32_t> > D2_M0({{51, 2}, {61, 22}, {91, 8}});
253const std::vector<std::pair<int32_t, int32_t> > D2_CUS({{99, 14}, {121, 4}});
254const std::vector<std::pair<int32_t, int32_t> > D2_E_MSB({{125, 10}});
257const std::vector<std::pair<int32_t, int32_t> > D2_E_LSB({{47, 6}, {61, 16}});
258const std::vector<std::pair<int32_t, int32_t> > D2_SQRT_A({{77, 6}, {91, 22}, {121, 4}});
259const std::vector<std::pair<int32_t, int32_t> > D2_CIC_MSB({{125, 10}});
260const std::vector<std::pair<int32_t, int32_t> > D2_CIC_LSB({{47, 6}, {61, 2}});
261const std::vector<std::pair<int32_t, int32_t> > D2_CIC({{283, 18}});
264const std::vector<std::pair<int32_t, int32_t> > D2_CIS({{63, 18}});
265const std::vector<std::pair<int32_t, int32_t> > D2_TOE({{81, 2}, {91, 15}});
266const std::vector<std::pair<int32_t, int32_t> > D2_I0_MSB({{106, 7}, {121, 14}});
267const std::vector<std::pair<int32_t, int32_t> > D2_I0_LSB({{47, 6}, {61, 5}});
268const std::vector<std::pair<int32_t, int32_t> > D2_I0({{269, 32}});
271const std::vector<std::pair<int32_t, int32_t> > D2_CRC({{66, 17}, {91, 1}});
272const std::vector<std::pair<int32_t, int32_t> > D2_CRS({{92, 18}});
273const std::vector<std::pair<int32_t, int32_t> > D2_OMEGA_DOT_MSB({{110, 3}, {121, 16}});
274const std::vector<std::pair<int32_t, int32_t> > D2_OMEGA_DOT_LSB({{47, 5}});
275const std::vector<std::pair<int32_t, int32_t> > D2_OMEGA_DOT({{277, 24}});
278const std::vector<std::pair<int32_t, int32_t> > D2_OMEGA0({{52, 1}, {61, 22}, {91, 9}});
279const std::vector<std::pair<int32_t, int32_t> > D2_OMEGA_MSB({{100, 13}, {121, 14}});
280const std::vector<std::pair<int32_t, int32_t> > D2_OMEGA_LSB({{47, 5}});
281const std::vector<std::pair<int32_t, int32_t> > D2_OMEGA({{269, 32}});
284const std::vector<std::pair<int32_t, int32_t> > D2_IDOT({{52, 1}, {61, 13}});
Defines useful mathematical constants and their scaled versions.
constexpr double PI_TWO_N38
Pi*2^-38.
constexpr double TWO_N11
2^-11
constexpr double PI_TWO_N31
Pi*2^-31.
constexpr double TWO_P16
2^16
constexpr double PI_TWO_N43
Pi*2^-43.
constexpr double TWO_P14
2^14
constexpr double TWO_N6
2^-6
constexpr double TWO_P12
2^12
constexpr double TWO_N31
2^-31
constexpr double TWO_N19
2^-19
constexpr double TWO_N24
2^-24
constexpr int32_t BEIDOU_DNAV_SUBFRAME_DATA_BITS
Number of bits per subframe in the NAV message [bits].
constexpr double PI_TWO_N19
Pi*2^-19.
constexpr double TWO_N27
2^-27
constexpr double TWO_P11
2^11
constexpr double TWO_N20
2^-20
constexpr double TWO_P3
2^3
constexpr double TWO_N66
2^-66
constexpr double TWO_N21
2^-21
constexpr double TWO_N38
2^-38
constexpr double PI_TWO_N23
Pi*2^-23.
constexpr double TWO_N30
2^-30
constexpr double TWO_N50
2^-50
constexpr double TWO_N33
2^-33