Fixposition SDK 0.0.0-heads/main-0-g408dc89
Collection of c++ libraries and apps for use with Fixposition products on Linux
Loading...
Searching...
No Matches
gnss.hpp
Go to the documentation of this file.
1/**
2 * \verbatim
3 * ___ ___
4 * \ \ / /
5 * \ \/ / Copyright (c) Fixposition AG (www.fixposition.com) and contributors
6 * / /\ \ License: see the LICENSE file
7 * /__/ \__\
8 *
9 * Based on work by flipflip (https://github.com/phkehl)
10 * \endverbatim
11 *
12 * @file
13 * @brief Fixposition SDK: GNSS types and utilities
14 *
15 * @page FPSDK_COMMON_GNSS GNSS types and utilities
16 *
17 * **API**: fpsdk_common/gnss.hpp and fpsdk::common::gnss
18 *
19 */
20#ifndef __FPSDK_COMMON_GNSS_HPP__
21#define __FPSDK_COMMON_GNSS_HPP__
22
23/* LIBC/STL */
24#include <cstdint>
25
26/* EXTERNAL */
27
28/* PACKAGE */
29#include "parser/nmea.hpp"
30#include "parser/ubx.hpp"
31#include "types.hpp"
32
33namespace fpsdk {
34namespace common {
35/**
36 * @brief GNSS types and utilities
37 */
38namespace gnss {
39/* ****************************************************************************************************************** */
40
41/**
42 * @brief GNSS fix types
43 */
44enum class FixType : uint8_t
45{ // clang-format off
46 UNKNOWN = 0, //!< Unknown fix
47 NOFIX = 1, //!< No fix
48 DRONLY = 2, //!< Dead-reckoning only fix
49 TIME = 3, //!< Time only fix
50 SPP_2D = 4, //!< 2D fix
51 SPP_3D = 5, //!< 3D fix
52 SPP_3D_DR = 6, //!< 3D + dead-reckoning fix
53 RTK_FLOAT = 7, //!< RTK float fix (implies 3D fix)
54 RTK_FIXED = 8, //!< RTK fixed fix (implies 3D fix)
55 RTK_FLOAT_DR = 9, //!< RTK float fix + dead-reckoning (implies RTK_FLOAT fix)
56 RTK_FIXED_DR = 10, //!< RTK fixed fix + dead-reckoning (implies RTK_FIXED fix)
57}; // clang-format on
58
59/**
60 * @brief Stringify GNSS fix type
61 *
62 * @param[in] fix_type The fix type
63 *
64 * @returns a concise and unique string for the fix types, "?" for bad values
65 */
66const char* FixTypeStr(const FixType fix_type);
67
68/**
69 * @brief GNSS
70 */
71enum class Gnss : uint8_t
72{
73 UNKNOWN = 0, //!< Unknown/unspecified GNSS
74 GPS, //!< GPS (G)
75 SBAS, //!< SBAS (S)
76 GAL, //!< Galileo (E)
77 BDS, //!< BeiDou (C)
78 QZSS, //!< QZSS (J)
79 GLO, //!< GLONASS (R)
80 NAVIC, //!< NavIC (IRNSS) (I)
81};
82
83/**
84 * @brief Stringify GNSS
85 *
86 * @param[in] gnss The GNSS
87 *
88 * @returns a concise and unique string for the GNSS ("GPS", "GAL", etc.), "?" for bad values
89 */
90const char* GnssStr(const Gnss gnss);
91
92/**
93 * @brief Get GNSS char
94 *
95 * @param[in] gnss The GNSS
96 *
97 * @returns the character for the GNSS ('G', 'E', etc.), '?' for bad values
98 */
99char GnssChar(const Gnss gnss);
100
101/**
102 * @brief Signals
103 */
104enum class Signal : uint8_t
105{ // clang-format off
106 UNKNOWN = 0, //!< Unknown/unspecified signal
107 // GPS
108 GPS_L1CA, //!< [L1] GPS L1 C/A signal
109 GPS_L2C, //!< [L2] GPS L2 C signal (L2 CL and L2 CM)
110 GPS_L5, //!< [L5] GPS L5 signal (L5 I and L5 Q)
111 // SBAS
112 SBAS_L1CA, //!< [L1] SBAS L1 C/A signal
113 // GAL
114 GAL_E1, //!< [L1] Galileo E1 signal (E1 C and E1 B)
115 GAL_E6, //!< [E6] Galileo E6 signal (E6A, E6B, and E6C)
116 GAL_E5B, //!< [L2] Galileo E5b signal (E5 bI and E5 bQ)
117 GAL_E5A, //!< [L5] Galileo E5a signal (E5 aI and E5 aQ)
118 // BDS
119 BDS_B1C, //!< [L1] BeiDou B1c signal (B1 Cp and B1 Cd)
120 BDS_B1I, //!< [L1] BeiDou B1I signal (B1I D1 and B1I D2)
121 BDS_B3I, //!< [E6] BeiDou B3I signal (B3I D1 and B3I D2)
122 BDS_B2I, //!< [L2] BeiDou B2I signal (B2I D1 and B2I D2)
123 BDS_B2A, //!< [L5] BeiDou B2a signal (B2 ap and B2 ad)
124 // QZSS
125 QZSS_L1CA, //!< [L1] QZSS L1 C/A signal
126 QZSS_L1S, //!< [L1] QZSS L1 S (SAIF) signal
127 QZSS_L2C, //!< [L2] QZSS L2 C signal (L2 CL and L2 CM)
128 QZSS_L5, //!< [L5] QZSS L5 signal (L5 I and L5 Q)
129 // GLO
130 GLO_L1OF, //!< [L1] GLONASS L1 OF signal
131 GLO_L2OF, //!< [L2] GLONASS L2 OF signal
132 // NAVIC
133 NAVIC_L5A, //!< [L5] NavIC L5 A
134}; // clang-format on
135
136/**
137 * @brief Stringify signal
138 *
139 * @param[in] signal The signal
140 * @param[in] kurz Get short string (for example, "L1CA" instead of "GPS_L1CA")
141 *
142 * @returns a concise and unique string for the signal, "?" for bad values
143 */
144const char* SignalStr(const Signal signal, const bool kurz = false);
145
146/**
147 * @brief Frequency bands
148 */
149enum class Band : uint8_t
150{
151 UNKNOWN = 0, //!< Unknown/unspecified band
152 L1, //!< L1 (E1) band (~1.5GHz)
153 E6, //!< E6 band (~1.3GHz)
154 L2, //!< L2 band (~1.2GHz)
155 L5, //!< L5 (E5) band (~1.1GHz)
156};
157
158/**
159 * @brief Stringify frequency band
160 *
161 * @param[in] band The frequency band
162 *
163 * @returns a concise and unique string for the frequency band, "?" for bad values
164 */
165const char* BandStr(const Band band);
166
167/**
168 * @brief Signal use
169 */
170enum class SigUse : uint8_t
171{
172 UNKNOWN = 0, //!< Unknown or unspecified use of the signal
173 NONE, //!< Signal not used
174 SEARCH, //!< Signal is being searched
175 ACQUIRED, //!< Signal was acquired
176 UNUSABLE, //!< Signal tracked but unused
177 CODELOCK, //!< Signal tracked and code locked
178 CARRLOCK, //!< Signal tracked and carrier locked
179};
180
181/**
182 * @brief Stringify signal use
183 *
184 * @param[in] use The signal use
185 *
186 * @returns a concise and unique string for the signal use, "?" for bad values
187 */
188const char* SigUseStr(const SigUse use);
189
190/**
191 * @brief Signal correction data availability
192 */
193enum class SigCorr : uint8_t
194{
195 UNKNOWN = 0, //!< Unknown or unspecified corrections
196 NONE, //!< No corrections available
197 SBAS, //!< SBAS (DGNSS) corrections available
198 BDS, //!< BeiDou (DGNSS) corrections available
199 RTCM2, //!< RTCM v2 (DGNSS) corrections available
200 RTCM3_OSR, //!< RTCM v3.x OSR type RTK corrections available
201 RTCM3_SSR, //!< RTCM v3.x SSR type RTK corrections available
202 QZSS_SLAS, //!< QZSS SLAS corrections available
203 SPARTN, //!< SPARTN corrections available
204};
205
206/**
207 * @brief Stringify signal correction data availability
208 *
209 * @param[in] corr The signal correction data availability
210 *
211 * @returns a concise and unique string for the signal correction data availability, "?" for bad values
212 */
213const char* SigCorrStr(const SigCorr corr);
214
215/**
216 * @brief Ionosphere corrections
217 */
218enum class SigIono : uint8_t
219{
220 UNKNOWN = 0, //!< Unknown or unspecified corrections
221 NONE, //!< No corrections
222 KLOB_GPS, //!< GPS style Klobuchar corrections
223 KLOB_BDS, //!< BeiDou style Klobuchar corrections
224 SBAS, //!< SBAS corrections
225 DUAL_FREQ, //!< Dual frequency iono-free combination
226};
227
228/**
229 * @brief Stringify ionosphere corrections
230 *
231 * @param[in] iono The ionosphere corrections
232 *
233 * @returns a concise and unique string for the ionosphere corrections, "?" for bad values
234 */
235const char* SigIonoStr(const SigIono iono);
236
237/**
238 * @brief Signal health
239 */
240enum class SigHealth : uint8_t
241{
242 UNKNOWN = 0, //!< Unknown or unspecified health
243 HEALTHY, //!< Signal is healthy
244 UNHEALTHY, //!< Signal is unhealthy
245};
246
247/**
248 * @brief Stringify signal health
249 *
250 * @param[in] health The signal health
251 *
252 * @returns a concise and unique string for the signal health, "?" for bad values
253 */
254const char* SigHealthStr(const SigHealth health);
255
256/**
257 * @brief Satellite orbit source
258 */
259enum class SatOrb : uint8_t // clang-format off
260{
261 UNKNOWN = 0x00, //!< Unknown
262 NONE = 0x01, //!< No orbit available
263 EPH = 0x02, //!< Ephemeris
264 ALM = 0x04, //!< Almanac
265 PRED = 0x08, //!< Predicted orbit
266 OTHER = 0x10, //!< Other, unspecified orbit source
267}; // clang-format on
268
269/**
270 * @brief Stringify satellite orbit source
271 *
272 * @param[in] orb The satellite orbit source
273 *
274 * @returns a concise and unique string for the satellite orbit source, "?" for bad values
275 */
276const char* SatOrbStr(const SatOrb orb);
277
278// ---------------------------------------------------------------------------------------------------------------------
279
280/**
281 * @brief Get frequency band for a signal
282 *
283 * @param[in] signal The signal
284 *
285 * @returns the frequency band for the signal
286 */
288
289/**
290 * @brief Get GNSS for a signal
291 *
292 * @param[in] signal The signal
293 *
294 * @returns the GNSS for the signal
295 */
297
298// ---------------------------------------------------------------------------------------------------------------------
299
300/**
301 * @brief Satellite number (within a GNSS)
302 */
303using SvNr = uint8_t;
304
305// Number of satellites per constellation, see https://igs.org/mgex/constellations/. Satellite numbers are two digits
306// satellite numbers as defined by IGS (see RINEX v3.04 section 3.5).
307// clang-format off
308static constexpr SvNr NUM_GPS = 32; //!< Number of GPS satellites (G01-G32, PRN)
309static constexpr SvNr NUM_SBAS = 39; //!< Number of SBAS satellites (S20-S59, PRN - 100)
310static constexpr SvNr NUM_GAL = 36; //!< Number of Galileo satellites (E01-E36, PRN)
311static constexpr SvNr NUM_BDS = 63; //!< Number of BeiDou satellites (C01-C63, PRN)
312static constexpr SvNr NUM_QZSS = 10; //!< Number of QZSS satellites (J01-J10, PRN - 192)
313static constexpr SvNr NUM_GLO = 32; //!< Number of GLONASS satellites (R01-R32, slot)
314static constexpr SvNr NUM_NAVIC = 14; //!< Number of NavIC satellites (I01-I14, PRN)
315static constexpr SvNr FIRST_GPS = 1; //!< First GPS satellite number
316static constexpr SvNr FIRST_SBAS = 20; //!< First SBAS satellite number
317static constexpr SvNr FIRST_GAL = 1; //!< First Galileo satellite number
318static constexpr SvNr FIRST_BDS = 1; //!< First BeiDou satellite number
319static constexpr SvNr FIRST_QZSS = 1; //!< First QZSS satellite number
320static constexpr SvNr FIRST_GLO = 1; //!< First GLONASS satellite number
321static constexpr SvNr FIRST_NAVIC = 1; //!< First NavIC satellite number
322static constexpr SvNr INAVLID_SVNR = 0; //!< Invalid satellite number (in any GNSS)
323// clang-format on
324
325// ---------------------------------------------------------------------------------------------------------------------
326
327/**
328 * @brief Satellite ("sat"), consisting of GNSS and satellite number, suitable for indexing and sorting
329 */
330struct Sat
331{ // clang-format off
332 /**
333 * @brief Default ctor: invalid satellite (INVALID_SAT)
334 */
335 Sat() = default;
336
337 /**
338 * @brief Ctor: from GNSS and satellite number
339 *
340 * @note This does not do any range checking and it's up to the user to provide a valid satellite ID for the given GNSS.
341 *
342 * @param[in] gnss GNSS
343 * @param[in] svnr Satellite number
344 */
345 Sat(const Gnss gnss, const SvNr svnr) : id_ { (uint16_t)(((uint16_t)types::EnumToVal(gnss) << 8) | (uint16_t)svnr) } {}
346
347 /**
348 * @brief Ctor: from string
349 *
350 * @note Invalid strings create an INVALID_SAT
351 *
352 * @param[in] str The string ("G03", "R22", "C12", ...)
353 */
354 Sat(const char* str);
355
356 /**
357 * @brief Get GNSS
358 *
359 * @returns the GNSS
360 */
361 inline Gnss GetGnss() const { return (Gnss)((id_ >> 8) & 0xff); }
362
363 /**
364 * @brief Get satellite number
365 *
366 * @returns the satellit nuber
367 */
368 inline SvNr GetSvNr() const { return id_ & 0xff; }
369
370 /**
371 * @brief Stringify satellite
372 *
373 * @returns a unique string identifying the satellite
374 */
375 const char* GetStr() const;
376
377 uint16_t id_ = 0x0000; //!< Internal representation of Gnss+SvNr
378
379 inline bool operator< (const Sat& rhs) const { return id_ < rhs.id_; } //!< Less-than operator
380 inline bool operator==(const Sat& rhs) const { return id_ == rhs.id_; } //!< Equal operator
381 inline bool operator!=(const Sat& rhs) const { return id_ != rhs.id_; } //!< Not equal operator
382 // See also std::hash<Sat> declaration at the end of this file
383}; // clang-format on
384
385/**
386 * @brief Invalid "sat"
387 *
388 * @note This is not the only invalid combination of GNSS and satellite number!
389 */
390static constexpr Sat INVALID_SAT;
391
392// ---------------------------------------------------------------------------------------------------------------------
393
394/**
395 * @brief Satellite plus frequency band and signal ("satsig"), suitable for indexing and sorting
396 */
397struct SatSig
398{ // clang-format off
399 /**
400 * @brief Default ctor: invalid SatSig (INVALID_SATSIG)
401 */
402 SatSig() = default;
403
404 /**
405 * @brief Ctor: create SatSig
406 *
407 * @note This does not do any range checking and it's up to the user to provide a valid satellite ID for the given GNSS.
408 *
409 * @param[in] gnss GNSS
410 * @param[in] svnr Satellite number
411 * @param[in] band Frequency band
412 * @param[in] signal Signal
413 */
414 SatSig(const Gnss gnss, const SvNr svnr, const Band band, const Signal signal) : id_ { (uint32_t)(types::EnumToVal(gnss) << 24) | (uint32_t)(svnr << 16) | (uint32_t)(types::EnumToVal(band) << 8) | (uint32_t)types::EnumToVal(signal) } {}
415
416 /**
417 * @brief Ctor: create SatSig
418 *
419 * @note This does not do any range checking and it's up to the user to provide a valid satellite ID for the given GNSS.
420 *
421 * @param[in] sat Satellite (GNSS + satellite number)
422 * @param[in] signal Signal (implies band)
423 */
424 SatSig(const Sat sat, const Signal signal) : id_ { (uint32_t)(((uint32_t)sat.id_ << 16) | ((uint32_t)types::EnumToVal(SignalToBand(signal)) << 8) | ((uint32_t)types::EnumToVal(signal))) } {}
425
426 /**
427 * @brief Get satellite
428 *
429 * @returns the satellite
430 */
431 inline Sat GetSat() const { return { GetGnss(), GetSvNr() }; }
432
433 /**
434 * @brief Get GNSS
435 *
436 * @returns the GNSS
437 */
438 inline Gnss GetGnss() const { return (Gnss)((id_ >> 24) & 0xff); }
439
440 /**
441 * @brief Get satellite number
442 *
443 * @returns the satellite number
444 */
445 inline SvNr GetSvNr() const { return (SvNr)((id_ >> 16) & 0xff); }
446
447 /**
448 * @brief Get band
449 *
450 * @returns the band
451 */
452 inline Band GetBand() const { return (Band)((id_ >> 8) & 0xff); }
453
454 /**
455 * @brief Get signal
456 *
457 * @returns the signal
458 */
459 inline Signal GetSignal() const { return (Signal)(id_ & 0xff); }
460
461 uint32_t id_ = 0x00000000; //!< Internal representation of Gnss+SvNr+Band+Signal
462
463 inline bool operator< (const SatSig& rhs) const { return id_ < rhs.id_; } //!< Less-than operator
464 inline bool operator==(const SatSig& rhs) const { return id_ == rhs.id_; } //!< Equal operator
465 inline bool operator!=(const SatSig& rhs) const { return id_ != rhs.id_; } //!< Not equal operator
466 // See also std::hash<SatSig> declaration at the end of this file
467}; // clang-format on
468
469static constexpr SatSig INVALID_SATSIG; //!< Invalid SatSig
470
471// ---------------------------------------------------------------------------------------------------------------------
472
473/**
474 * @brief Convert UBX gnssId to GNSS
475 *
476 * @param[in] gnssId UBX gnssId
477 *
478 * @returns the GNSS
479 */
480Gnss UbxGnssIdToGnss(const uint8_t gnssId);
481
482/**
483 * @brief Convert UBX gnssId and svId to satellite
484 *
485 * @param[in] gnssId UBX gnssId
486 * @param[in] svId UBX svId
487 *
488 * @returns the satellite, INVALID_SAT for invalid gnssId/svId
489 */
490Sat UbxGnssIdSvIdToSat(const uint8_t gnssId, const uint8_t svId);
491
492/**
493 * @brief Convert UBX gnssId and sigId to signal
494 *
495 * @param[in] gnssId UBX gnssId
496 * @param[in] sigId UBX sigId
497 *
498 * @returns the signal
499 */
500Signal UbxGnssIdSigIdToSignal(const uint8_t gnssId, const uint8_t sigId);
501
502// ---------------------------------------------------------------------------------------------------------------------
503
504/**
505 * @brief Convert NMEA GGA quality to fix type
506 *
507 * @param[in] quality NMEA GGA quality
508 *
509 * @returns the fix type corresponding to the quality
510 */
512
513/**
514 * @brief Convert NMEA RMC/GNS mode to fix type
515 *
516 * @param[in] mode NMEA RMC/GNS mode
517 *
518 * @returns the fix type corresponding to the mode
519 */
521
522/**
523 * @brief Convert NMEA GLL/VTG mode to fix type
524 *
525 * @param[in] mode NMEA GLL/VTG mode
526 *
527 * @returns the fix type corresponding to the mode
528 */
530
531/**
532 * @brief Convert NMEA system ID and satellite number to satellite
533 *
534 * @param[in] systemId NMEA system ID
535 * @param[in] svId NMEA satellite ID
536 * @param[in] nmeaVersion NMEA version
537 *
538 * @returns the satellite, INVALID_SAT for invalid systemId/svId
539 */
540Sat NmeaSystemIdSvIdToSat(const parser::nmea::NmeaSystemId systemId, const uint8_t svId,
542
543/**
544 * @brief Convert NMEA signal ID to signal
545 *
546 * @param[in] signalId NMEA signal ID
547 *
548 * @returns the signal
549 */
551
552/* ****************************************************************************************************************** */
553} // namespace gnss
554} // namespace common
555} // namespace fpsdk
556
557/**
558 * @brief Hasher for Sat (e.g. std::unordered_map)
559 */
560template <>
561struct std::hash<fpsdk::common::gnss::Sat>
562{
563 std::size_t operator()(const fpsdk::common::gnss::Sat& k) const
564 {
565 return k.id_;
566 } //!< operator
567};
568
569/**
570 * @brief Hasher for SatSig (e.g. std::unordered_map)
571 */
572template <>
573struct std::hash<fpsdk::common::gnss::SatSig>
574{
575 std::size_t operator()(const fpsdk::common::gnss::SatSig& k) const
576 {
577 return k.id_;
578 } //!< operator
579};
580
581/* ****************************************************************************************************************** */
582#endif // __FPSDK_COMMON_GNSS_HPP__
GNSS types and utilities.
Definition gnss.hpp:38
static constexpr SvNr NUM_QZSS
Number of QZSS satellites (J01-J10, PRN - 192)
Definition gnss.hpp:312
Gnss SignalToGnss(const Signal signal)
Get GNSS for a signal.
SigUse
Signal use.
Definition gnss.hpp:171
@ CARRLOCK
Signal tracked and carrier locked.
Definition gnss.hpp:178
@ SEARCH
Signal is being searched.
Definition gnss.hpp:174
@ UNUSABLE
Signal tracked but unused.
Definition gnss.hpp:176
@ ACQUIRED
Signal was acquired.
Definition gnss.hpp:175
@ NONE
Signal not used.
Definition gnss.hpp:173
@ CODELOCK
Signal tracked and code locked.
Definition gnss.hpp:177
const char * SigHealthStr(const SigHealth health)
Stringify signal health.
static constexpr SvNr FIRST_GLO
First GLONASS satellite number.
Definition gnss.hpp:320
const char * FixTypeStr(const FixType fix_type)
Stringify GNSS fix type.
SigIono
Ionosphere corrections.
Definition gnss.hpp:219
@ KLOB_GPS
GPS style Klobuchar corrections.
Definition gnss.hpp:222
@ DUAL_FREQ
Dual frequency iono-free combination.
Definition gnss.hpp:225
@ KLOB_BDS
BeiDou style Klobuchar corrections.
Definition gnss.hpp:223
FixType NmeaQualityGgaToFixType(const parser::nmea::NmeaQualityGga quality)
Convert NMEA GGA quality to fix type.
const char * SigCorrStr(const SigCorr corr)
Stringify signal correction data availability.
Signal NmeaSignalIdToSignal(const parser::nmea::NmeaSignalId signalId)
Convert NMEA signal ID to signal.
static constexpr SvNr FIRST_QZSS
First QZSS satellite number.
Definition gnss.hpp:319
SigHealth
Signal health.
Definition gnss.hpp:241
@ UNHEALTHY
Signal is unhealthy.
Definition gnss.hpp:244
@ HEALTHY
Signal is healthy.
Definition gnss.hpp:243
const char * SigIonoStr(const SigIono iono)
Stringify ionosphere corrections.
@ QZSS_L1S
[L1] QZSS L1 S (SAIF) signal
Definition gnss.hpp:126
@ BDS_B2A
[L5] BeiDou B2a signal (B2 ap and B2 ad)
Definition gnss.hpp:123
@ GAL_E6
[E6] Galileo E6 signal (E6A, E6B, and E6C)
Definition gnss.hpp:115
@ GLO_L2OF
[L2] GLONASS L2 OF signal
Definition gnss.hpp:131
@ QZSS_L1CA
[L1] QZSS L1 C/A signal
Definition gnss.hpp:125
@ GAL_E5A
[L5] Galileo E5a signal (E5 aI and E5 aQ)
Definition gnss.hpp:117
@ GPS_L5
[L5] GPS L5 signal (L5 I and L5 Q)
Definition gnss.hpp:110
@ QZSS_L5
[L5] QZSS L5 signal (L5 I and L5 Q)
Definition gnss.hpp:128
@ BDS_B1C
[L1] BeiDou B1c signal (B1 Cp and B1 Cd)
Definition gnss.hpp:119
@ BDS_B2I
[L2] BeiDou B2I signal (B2I D1 and B2I D2)
Definition gnss.hpp:122
@ GLO_L1OF
[L1] GLONASS L1 OF signal
Definition gnss.hpp:130
@ GAL_E1
[L1] Galileo E1 signal (E1 C and E1 B)
Definition gnss.hpp:114
@ SBAS_L1CA
[L1] SBAS L1 C/A signal
Definition gnss.hpp:112
@ GAL_E5B
[L2] Galileo E5b signal (E5 bI and E5 bQ)
Definition gnss.hpp:116
@ BDS_B3I
[E6] BeiDou B3I signal (B3I D1 and B3I D2)
Definition gnss.hpp:121
@ GPS_L1CA
[L1] GPS L1 C/A signal
Definition gnss.hpp:108
@ GPS_L2C
[L2] GPS L2 C signal (L2 CL and L2 CM)
Definition gnss.hpp:109
@ BDS_B1I
[L1] BeiDou B1I signal (B1I D1 and B1I D2)
Definition gnss.hpp:120
@ NAVIC_L5A
[L5] NavIC L5 A
Definition gnss.hpp:133
@ QZSS_L2C
[L2] QZSS L2 C signal (L2 CL and L2 CM)
Definition gnss.hpp:127
uint8_t SvNr
Satellite number (within a GNSS)
Definition gnss.hpp:303
static constexpr SvNr FIRST_BDS
First BeiDou satellite number.
Definition gnss.hpp:318
Sat UbxGnssIdSvIdToSat(const uint8_t gnssId, const uint8_t svId)
Convert UBX gnssId and svId to satellite.
static constexpr SvNr NUM_GLO
Number of GLONASS satellites (R01-R32, slot)
Definition gnss.hpp:313
static constexpr SatSig INVALID_SATSIG
Invalid SatSig.
Definition gnss.hpp:469
static constexpr SvNr FIRST_SBAS
First SBAS satellite number.
Definition gnss.hpp:316
static constexpr SvNr NUM_SBAS
Number of SBAS satellites (S20-S59, PRN - 100)
Definition gnss.hpp:309
const char * SigUseStr(const SigUse use)
Stringify signal use.
static constexpr SvNr NUM_GAL
Number of Galileo satellites (E01-E36, PRN)
Definition gnss.hpp:310
FixType
GNSS fix types.
Definition gnss.hpp:45
@ TIME
Time only fix.
Definition gnss.hpp:49
@ UNKNOWN
Unknown fix.
Definition gnss.hpp:46
@ DRONLY
Dead-reckoning only fix.
Definition gnss.hpp:48
@ SPP_3D_DR
3D + dead-reckoning fix
Definition gnss.hpp:52
@ RTK_FLOAT
RTK float fix (implies 3D fix)
Definition gnss.hpp:53
@ RTK_FIXED_DR
RTK fixed fix + dead-reckoning (implies RTK_FIXED fix)
Definition gnss.hpp:56
@ RTK_FLOAT_DR
RTK float fix + dead-reckoning (implies RTK_FLOAT fix)
Definition gnss.hpp:55
@ RTK_FIXED
RTK fixed fix (implies 3D fix)
Definition gnss.hpp:54
Gnss UbxGnssIdToGnss(const uint8_t gnssId)
Convert UBX gnssId to GNSS.
SatOrb
Satellite orbit source.
Definition gnss.hpp:260
@ OTHER
Other, unspecified orbit source.
Definition gnss.hpp:266
@ PRED
Predicted orbit.
Definition gnss.hpp:265
static constexpr Sat INVALID_SAT
Invalid "sat".
Definition gnss.hpp:390
@ NAVIC
NavIC (IRNSS) (I)
Definition gnss.hpp:80
const char * BandStr(const Band band)
Stringify frequency band.
static constexpr SvNr NUM_GPS
Number of GPS satellites (G01-G32, PRN)
Definition gnss.hpp:308
const char * SatOrbStr(const SatOrb orb)
Stringify satellite orbit source.
static constexpr SvNr NUM_BDS
Number of BeiDou satellites (C01-C63, PRN)
Definition gnss.hpp:311
static constexpr SvNr FIRST_NAVIC
First NavIC satellite number.
Definition gnss.hpp:321
Sat NmeaSystemIdSvIdToSat(const parser::nmea::NmeaSystemId systemId, const uint8_t svId, const parser::nmea::NmeaVersion nmeaVersion=parser::nmea::NmeaVersion::V411)
Convert NMEA system ID and satellite number to satellite.
const char * GnssStr(const Gnss gnss)
Stringify GNSS.
static constexpr SvNr FIRST_GPS
First GPS satellite number.
Definition gnss.hpp:315
static constexpr SvNr NUM_NAVIC
Number of NavIC satellites (I01-I14, PRN)
Definition gnss.hpp:314
static constexpr SvNr FIRST_GAL
First Galileo satellite number.
Definition gnss.hpp:317
FixType NmeaModeGllVtgToFixType(const parser::nmea::NmeaModeGllVtg mode)
Convert NMEA GLL/VTG mode to fix type.
Band
Frequency bands.
Definition gnss.hpp:150
@ E6
E6 band (~1.3GHz)
Definition gnss.hpp:153
@ L5
L5 (E5) band (~1.1GHz)
Definition gnss.hpp:155
@ L2
L2 band (~1.2GHz)
Definition gnss.hpp:154
@ L1
L1 (E1) band (~1.5GHz)
Definition gnss.hpp:152
FixType NmeaModeRmcGnsToFixType(const parser::nmea::NmeaModeRmcGns mode)
Convert NMEA RMC/GNS mode to fix type.
static constexpr SvNr INAVLID_SVNR
Invalid satellite number (in any GNSS)
Definition gnss.hpp:322
const char * SignalStr(const Signal signal, const bool kurz=false)
Stringify signal.
char GnssChar(const Gnss gnss)
Get GNSS char.
SigCorr
Signal correction data availability.
Definition gnss.hpp:194
@ RTCM3_OSR
RTCM v3.x OSR type RTK corrections available.
Definition gnss.hpp:200
@ RTCM3_SSR
RTCM v3.x SSR type RTK corrections available.
Definition gnss.hpp:201
@ SPARTN
SPARTN corrections available.
Definition gnss.hpp:203
@ RTCM2
RTCM v2 (DGNSS) corrections available.
Definition gnss.hpp:199
@ QZSS_SLAS
QZSS SLAS corrections available.
Definition gnss.hpp:202
Band SignalToBand(const Signal signal)
Get frequency band for a signal.
Signal UbxGnssIdSigIdToSignal(const uint8_t gnssId, const uint8_t sigId)
Convert UBX gnssId and sigId to signal.
NmeaSystemId
NMEA system IDs.
Definition nmea.hpp:333
NmeaModeRmcGns
NMEA-Gx-RMC and NMEA-Gx-GNS pos mode.
Definition nmea.hpp:277
NmeaModeGllVtg
NMEA-Gx-GLL and NMEA-Gx-VTG pos mode.
Definition nmea.hpp:261
NmeaSignalId
NMEA signal IDs.
Definition nmea.hpp:349
NmeaQualityGga
NMEA-Gx-GGA quality indicator.
Definition nmea.hpp:229
Common types.
Definition types.hpp:35
Fixposition SDK: Common library.
Definition doc.hpp:21
Fixposition SDK.
Fixposition SDK: Parser NMEA routines and types.
Satellite plus frequency band and signal ("satsig"), suitable for indexing and sorting.
Definition gnss.hpp:398
bool operator<(const SatSig &rhs) const
Less-than operator.
Definition gnss.hpp:463
SvNr GetSvNr() const
Get satellite number.
Definition gnss.hpp:445
Band GetBand() const
Get band.
Definition gnss.hpp:452
uint32_t id_
Internal representation of Gnss+SvNr+Band+Signal.
Definition gnss.hpp:461
SatSig(const Gnss gnss, const SvNr svnr, const Band band, const Signal signal)
Ctor: create SatSig.
Definition gnss.hpp:414
Signal GetSignal() const
Get signal.
Definition gnss.hpp:459
Gnss GetGnss() const
Get GNSS.
Definition gnss.hpp:438
bool operator!=(const SatSig &rhs) const
Not equal operator.
Definition gnss.hpp:465
Sat GetSat() const
Get satellite.
Definition gnss.hpp:431
SatSig(const Sat sat, const Signal signal)
Ctor: create SatSig.
Definition gnss.hpp:424
bool operator==(const SatSig &rhs) const
Equal operator.
Definition gnss.hpp:464
SatSig()=default
Default ctor: invalid SatSig (INVALID_SATSIG)
Satellite ("sat"), consisting of GNSS and satellite number, suitable for indexing and sorting.
Definition gnss.hpp:331
Sat(const Gnss gnss, const SvNr svnr)
Ctor: from GNSS and satellite number.
Definition gnss.hpp:345
Gnss GetGnss() const
Get GNSS.
Definition gnss.hpp:361
uint16_t id_
Internal representation of Gnss+SvNr.
Definition gnss.hpp:377
bool operator==(const Sat &rhs) const
Equal operator.
Definition gnss.hpp:380
Sat(const char *str)
Ctor: from string.
bool operator!=(const Sat &rhs) const
Not equal operator.
Definition gnss.hpp:381
Sat()=default
Default ctor: invalid satellite (INVALID_SAT)
const char * GetStr() const
Stringify satellite.
bool operator<(const Sat &rhs) const
Less-than operator.
Definition gnss.hpp:379
SvNr GetSvNr() const
Get satellite number.
Definition gnss.hpp:368
Constants for different versions of NMEA.
Definition nmea.hpp:431
static const NmeaVersion V411
Value for NMEA v4.11.
Definition nmea.hpp:448
std::size_t operator()(const fpsdk::common::gnss::SatSig &k) const
operator
Definition gnss.hpp:575
std::size_t operator()(const fpsdk::common::gnss::Sat &k) const
operator
Definition gnss.hpp:563
Fixposition SDK: Common types and type helpers.
Fixposition SDK: Parser UBX routines and types.