Fixposition SDK 0.0.0-heads/main-0-g5e3c297
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_B2B, //!< [~L2] BeiDou B2b signal
124 BDS_B2A, //!< [L5] BeiDou B2a signal (B2 ap and B2 ad)
125 // QZSS
126 QZSS_L1CA, //!< [L1] QZSS L1 C/A signal
127 QZSS_L1S, //!< [L1] QZSS L1 S (SAIF) signal
128 QZSS_L2C, //!< [L2] QZSS L2 C signal (L2 CL and L2 CM)
129 QZSS_L5, //!< [L5] QZSS L5 signal (L5 I and L5 Q)
130 // GLO
131 GLO_L1OF, //!< [L1] GLONASS L1 OF signal
132 GLO_L2OF, //!< [L2] GLONASS L2 OF signal
133 // NAVIC
134 NAVIC_L5A, //!< [L5] NavIC L5 A
135}; // clang-format on
136
137/**
138 * @brief Stringify signal
139 *
140 * @param[in] signal The signal
141 * @param[in] kurz Get short string (for example, "L1CA" instead of "GPS_L1CA")
142 *
143 * @returns a concise and unique string for the signal, "?" for bad values
144 */
145const char* SignalStr(const Signal signal, const bool kurz = false);
146
147/**
148 * @brief Frequency bands
149 */
150enum class Band : uint8_t
151{
152 UNKNOWN = 0, //!< Unknown/unspecified band
153 L1, //!< L1 (E1) band (~1.5GHz)
154 E6, //!< E6 band (~1.3GHz)
155 L2, //!< L2 band (~1.2GHz)
156 L5, //!< L5 (E5) band (~1.1GHz)
157};
158
159/**
160 * @brief Stringify frequency band
161 *
162 * @param[in] band The frequency band
163 *
164 * @returns a concise and unique string for the frequency band, "?" for bad values
165 */
166const char* BandStr(const Band band);
167
168/**
169 * @brief Signal use
170 */
171enum class SigUse : uint8_t
172{
173 UNKNOWN = 0, //!< Unknown or unspecified use of the signal
174 NONE, //!< Signal not used
175 SEARCH, //!< Signal is being searched
176 ACQUIRED, //!< Signal was acquired
177 UNUSABLE, //!< Signal tracked but unused
178 CODELOCK, //!< Signal tracked and code locked
179 CARRLOCK, //!< Signal tracked and carrier locked
180};
181
182/**
183 * @brief Stringify signal use
184 *
185 * @param[in] use The signal use
186 *
187 * @returns a concise and unique string for the signal use, "?" for bad values
188 */
189const char* SigUseStr(const SigUse use);
190
191/**
192 * @brief Signal correction data availability
193 */
194enum class SigCorr : uint8_t
195{
196 UNKNOWN = 0, //!< Unknown or unspecified corrections
197 NONE, //!< No corrections available
198 SBAS, //!< SBAS (DGNSS) corrections available
199 BDS, //!< BeiDou (DGNSS) corrections available
200 RTCM2, //!< RTCM v2 (DGNSS) corrections available
201 RTCM3_OSR, //!< RTCM v3.x OSR type RTK corrections available
202 RTCM3_SSR, //!< RTCM v3.x SSR type RTK corrections available
203 QZSS_SLAS, //!< QZSS SLAS corrections available
204 SPARTN, //!< SPARTN corrections available
205};
206
207/**
208 * @brief Stringify signal correction data availability
209 *
210 * @param[in] corr The signal correction data availability
211 *
212 * @returns a concise and unique string for the signal correction data availability, "?" for bad values
213 */
214const char* SigCorrStr(const SigCorr corr);
215
216/**
217 * @brief Ionosphere corrections
218 */
219enum class SigIono : uint8_t
220{
221 UNKNOWN = 0, //!< Unknown or unspecified corrections
222 NONE, //!< No corrections
223 KLOB_GPS, //!< GPS style Klobuchar corrections
224 KLOB_BDS, //!< BeiDou style Klobuchar corrections
225 SBAS, //!< SBAS corrections
226 DUAL_FREQ, //!< Dual frequency iono-free combination
227};
228
229/**
230 * @brief Stringify ionosphere corrections
231 *
232 * @param[in] iono The ionosphere corrections
233 *
234 * @returns a concise and unique string for the ionosphere corrections, "?" for bad values
235 */
236const char* SigIonoStr(const SigIono iono);
237
238/**
239 * @brief Signal health
240 */
241enum class SigHealth : uint8_t
242{
243 UNKNOWN = 0, //!< Unknown or unspecified health
244 HEALTHY, //!< Signal is healthy
245 UNHEALTHY, //!< Signal is unhealthy
246};
247
248/**
249 * @brief Stringify signal health
250 *
251 * @param[in] health The signal health
252 *
253 * @returns a concise and unique string for the signal health, "?" for bad values
254 */
255const char* SigHealthStr(const SigHealth health);
256
257/**
258 * @brief Satellite orbit source
259 */
260enum class SatOrb : uint8_t // clang-format off
261{
262 UNKNOWN = 0x00, //!< Unknown
263 NONE = 0x01, //!< No orbit available
264 EPH = 0x02, //!< Ephemeris
265 ALM = 0x04, //!< Almanac
266 PRED = 0x08, //!< Predicted orbit
267 OTHER = 0x10, //!< Other, unspecified orbit source
268}; // clang-format on
269
270/**
271 * @brief Stringify satellite orbit source
272 *
273 * @param[in] orb The satellite orbit source
274 *
275 * @returns a concise and unique string for the satellite orbit source, "?" for bad values
276 */
277const char* SatOrbStr(const SatOrb orb);
278
279// ---------------------------------------------------------------------------------------------------------------------
280
281/**
282 * @brief Get frequency band for a signal
283 *
284 * @note This mapping is in some cases a bit vague and subject to interpretation or preference. See the docu of the
285 * Signal enum.
286 *
287 * @param[in] signal The signal
288 *
289 * @returns the frequency band for the signal
290 */
292
293/**
294 * @brief Get GNSS for a signal
295 *
296 * @param[in] signal The signal
297 *
298 * @returns the GNSS for the signal
299 */
301
302// ---------------------------------------------------------------------------------------------------------------------
303
304/**
305 * @brief Satellite number (within a GNSS)
306 */
307using SvNr = uint8_t;
308
309// Number of satellites per constellation, see https://igs.org/mgex/constellations/. Satellite numbers are two digits
310// satellite numbers as defined by IGS (see RINEX v3.04 section 3.5).
311// clang-format off
312static constexpr SvNr NUM_GPS = 32; //!< Number of GPS satellites (G01-G32, PRN)
313static constexpr SvNr NUM_SBAS = 39; //!< Number of SBAS satellites (S20-S59, PRN - 100)
314static constexpr SvNr NUM_GAL = 36; //!< Number of Galileo satellites (E01-E36, PRN)
315static constexpr SvNr NUM_BDS = 63; //!< Number of BeiDou satellites (C01-C63, PRN)
316static constexpr SvNr NUM_QZSS = 10; //!< Number of QZSS satellites (J01-J10, PRN - 192)
317static constexpr SvNr NUM_GLO = 32; //!< Number of GLONASS satellites (R01-R32, slot)
318static constexpr SvNr NUM_NAVIC = 14; //!< Number of NavIC satellites (I01-I14, PRN)
319static constexpr SvNr FIRST_GPS = 1; //!< First GPS satellite number
320static constexpr SvNr FIRST_SBAS = 20; //!< First SBAS satellite number
321static constexpr SvNr FIRST_GAL = 1; //!< First Galileo satellite number
322static constexpr SvNr FIRST_BDS = 1; //!< First BeiDou satellite number
323static constexpr SvNr FIRST_QZSS = 1; //!< First QZSS satellite number
324static constexpr SvNr FIRST_GLO = 1; //!< First GLONASS satellite number
325static constexpr SvNr FIRST_NAVIC = 1; //!< First NavIC satellite number
326static constexpr SvNr INAVLID_SVNR = 0; //!< Invalid satellite number (in any GNSS)
327// clang-format on
328
329// ---------------------------------------------------------------------------------------------------------------------
330
331/**
332 * @brief Satellite ("sat"), consisting of GNSS and satellite number, suitable for indexing and sorting
333 */
334struct Sat
335{ // clang-format off
336 /**
337 * @brief Default ctor: invalid satellite (INVALID_SAT)
338 */
339 Sat() = default;
340
341 /**
342 * @brief Ctor: from GNSS and satellite number
343 *
344 * @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.
345 *
346 * @param[in] gnss GNSS
347 * @param[in] svnr Satellite number
348 */
349 Sat(const Gnss gnss, const SvNr svnr) : id_ { (uint16_t)(((uint16_t)types::EnumToVal(gnss) << 8) | (uint16_t)svnr) } {}
350
351 /**
352 * @brief Ctor: from string
353 *
354 * @note Invalid strings create an INVALID_SAT
355 *
356 * @param[in] str The string ("G03", "R22", "C12", ...)
357 */
358 Sat(const char* str);
359
360 /**
361 * @brief Get GNSS
362 *
363 * @returns the GNSS
364 */
365 inline Gnss GetGnss() const { return (Gnss)((id_ >> 8) & 0xff); }
366
367 /**
368 * @brief Get satellite number
369 *
370 * @returns the satellit nuber
371 */
372 inline SvNr GetSvNr() const { return id_ & 0xff; }
373
374 /**
375 * @brief Stringify satellite
376 *
377 * @returns a unique string identifying the satellite
378 */
379 const char* GetStr() const;
380
381 uint16_t id_ = 0x0000; //!< Internal representation of Gnss+SvNr
382
383 inline bool operator< (const Sat& rhs) const { return id_ < rhs.id_; } //!< Less-than operator
384 inline bool operator==(const Sat& rhs) const { return id_ == rhs.id_; } //!< Equal operator
385 inline bool operator!=(const Sat& rhs) const { return id_ != rhs.id_; } //!< Not equal operator
386 // See also std::hash<Sat> declaration at the end of this file
387}; // clang-format on
388
389/**
390 * @brief Invalid "sat"
391 *
392 * @note This is not the only invalid combination of GNSS and satellite number!
393 */
394static constexpr Sat INVALID_SAT;
395
396// ---------------------------------------------------------------------------------------------------------------------
397
398/**
399 * @brief Satellite plus frequency band and signal ("satsig"), suitable for indexing and sorting
400 */
401struct SatSig
402{ // clang-format off
403 /**
404 * @brief Default ctor: invalid SatSig (INVALID_SATSIG)
405 */
406 SatSig() = default;
407
408 /**
409 * @brief Ctor: create SatSig
410 *
411 * @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.
412 *
413 * @param[in] gnss GNSS
414 * @param[in] svnr Satellite number
415 * @param[in] band Frequency band
416 * @param[in] signal Signal
417 */
418 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) } {}
419
420 /**
421 * @brief Ctor: create SatSig
422 *
423 * @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.
424 *
425 * @param[in] sat Satellite (GNSS + satellite number)
426 * @param[in] signal Signal (implies band)
427 */
428 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))) } {}
429
430 /**
431 * @brief Get satellite
432 *
433 * @returns the satellite
434 */
435 inline Sat GetSat() const { return { GetGnss(), GetSvNr() }; }
436
437 /**
438 * @brief Get GNSS
439 *
440 * @returns the GNSS
441 */
442 inline Gnss GetGnss() const { return (Gnss)((id_ >> 24) & 0xff); }
443
444 /**
445 * @brief Get satellite number
446 *
447 * @returns the satellite number
448 */
449 inline SvNr GetSvNr() const { return (SvNr)((id_ >> 16) & 0xff); }
450
451 /**
452 * @brief Get band
453 *
454 * @returns the band
455 */
456 inline Band GetBand() const { return (Band)((id_ >> 8) & 0xff); }
457
458 /**
459 * @brief Get signal
460 *
461 * @returns the signal
462 */
463 inline Signal GetSignal() const { return (Signal)(id_ & 0xff); }
464
465 uint32_t id_ = 0x00000000; //!< Internal representation of Gnss+SvNr+Band+Signal
466
467 inline bool operator< (const SatSig& rhs) const { return id_ < rhs.id_; } //!< Less-than operator
468 inline bool operator==(const SatSig& rhs) const { return id_ == rhs.id_; } //!< Equal operator
469 inline bool operator!=(const SatSig& rhs) const { return id_ != rhs.id_; } //!< Not equal operator
470 // See also std::hash<SatSig> declaration at the end of this file
471}; // clang-format on
472
473static constexpr SatSig INVALID_SATSIG; //!< Invalid SatSig
474
475// ---------------------------------------------------------------------------------------------------------------------
476
477/**
478 * @brief Convert UBX gnssId to GNSS
479 *
480 * @param[in] gnssId UBX gnssId
481 *
482 * @returns the GNSS
483 */
484Gnss UbxGnssIdToGnss(const uint8_t gnssId);
485
486/**
487 * @brief Convert UBX gnssId and svId to satellite
488 *
489 * @param[in] gnssId UBX gnssId
490 * @param[in] svId UBX svId
491 *
492 * @returns the satellite, INVALID_SAT for invalid gnssId/svId
493 */
494Sat UbxGnssIdSvIdToSat(const uint8_t gnssId, const uint8_t svId);
495
496/**
497 * @brief Convert UBX gnssId and sigId to signal
498 *
499 * @param[in] gnssId UBX gnssId
500 * @param[in] sigId UBX sigId
501 *
502 * @returns the signal
503 */
504Signal UbxGnssIdSigIdToSignal(const uint8_t gnssId, const uint8_t sigId);
505
506// ---------------------------------------------------------------------------------------------------------------------
507
508/**
509 * @brief Convert NMEA GGA quality to fix type
510 *
511 * @param[in] quality NMEA GGA quality
512 *
513 * @returns the fix type corresponding to the quality
514 */
516
517/**
518 * @brief Convert NMEA RMC/GNS mode to fix type
519 *
520 * @param[in] mode NMEA RMC/GNS mode
521 *
522 * @returns the fix type corresponding to the mode
523 */
525
526/**
527 * @brief Convert NMEA GLL/VTG mode to fix type
528 *
529 * @param[in] mode NMEA GLL/VTG mode
530 *
531 * @returns the fix type corresponding to the mode
532 */
534
535/**
536 * @brief Convert NMEA system ID and satellite number to satellite
537 *
538 * @param[in] systemId NMEA system ID
539 * @param[in] svId NMEA satellite ID
540 * @param[in] nmeaVersion NMEA version
541 *
542 * @returns the satellite, INVALID_SAT for invalid systemId/svId
543 */
544Sat NmeaSystemIdSvIdToSat(const parser::nmea::NmeaSystemId systemId, const uint8_t svId,
546
547/**
548 * @brief Convert NMEA signal ID to signal
549 *
550 * @param[in] signalId NMEA signal ID
551 *
552 * @returns the signal
553 */
555
556/* ****************************************************************************************************************** */
557} // namespace gnss
558} // namespace common
559} // namespace fpsdk
560
561/**
562 * @brief Hasher for Sat (e.g. std::unordered_map)
563 */
564template <>
565struct std::hash<fpsdk::common::gnss::Sat>
566{
567 std::size_t operator()(const fpsdk::common::gnss::Sat& k) const
568 {
569 return k.id_;
570 } //!< operator
571};
572
573/**
574 * @brief Hasher for SatSig (e.g. std::unordered_map)
575 */
576template <>
577struct std::hash<fpsdk::common::gnss::SatSig>
578{
579 std::size_t operator()(const fpsdk::common::gnss::SatSig& k) const
580 {
581 return k.id_;
582 } //!< operator
583};
584
585/* ****************************************************************************************************************** */
586#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:316
Gnss SignalToGnss(const Signal signal)
Get GNSS for a signal.
SigUse
Signal use.
Definition gnss.hpp:172
@ CARRLOCK
Signal tracked and carrier locked.
Definition gnss.hpp:179
@ SEARCH
Signal is being searched.
Definition gnss.hpp:175
@ UNUSABLE
Signal tracked but unused.
Definition gnss.hpp:177
@ ACQUIRED
Signal was acquired.
Definition gnss.hpp:176
@ NONE
Signal not used.
Definition gnss.hpp:174
@ CODELOCK
Signal tracked and code locked.
Definition gnss.hpp:178
const char * SigHealthStr(const SigHealth health)
Stringify signal health.
static constexpr SvNr FIRST_GLO
First GLONASS satellite number.
Definition gnss.hpp:324
const char * FixTypeStr(const FixType fix_type)
Stringify GNSS fix type.
SigIono
Ionosphere corrections.
Definition gnss.hpp:220
@ KLOB_GPS
GPS style Klobuchar corrections.
Definition gnss.hpp:223
@ DUAL_FREQ
Dual frequency iono-free combination.
Definition gnss.hpp:226
@ KLOB_BDS
BeiDou style Klobuchar corrections.
Definition gnss.hpp:224
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:323
SigHealth
Signal health.
Definition gnss.hpp:242
@ UNHEALTHY
Signal is unhealthy.
Definition gnss.hpp:245
@ HEALTHY
Signal is healthy.
Definition gnss.hpp:244
const char * SigIonoStr(const SigIono iono)
Stringify ionosphere corrections.
@ QZSS_L1S
[L1] QZSS L1 S (SAIF) signal
Definition gnss.hpp:127
@ BDS_B2A
[L5] BeiDou B2a signal (B2 ap and B2 ad)
Definition gnss.hpp:124
@ GAL_E6
[E6] Galileo E6 signal (E6A, E6B, and E6C)
Definition gnss.hpp:115
@ GLO_L2OF
[L2] GLONASS L2 OF signal
Definition gnss.hpp:132
@ QZSS_L1CA
[L1] QZSS L1 C/A signal
Definition gnss.hpp:126
@ 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:129
@ 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:131
@ 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_B2B
[~L2] BeiDou B2b signal
Definition gnss.hpp:123
@ BDS_B1I
[L1] BeiDou B1I signal (B1I D1 and B1I D2)
Definition gnss.hpp:120
@ NAVIC_L5A
[L5] NavIC L5 A
Definition gnss.hpp:134
@ QZSS_L2C
[L2] QZSS L2 C signal (L2 CL and L2 CM)
Definition gnss.hpp:128
uint8_t SvNr
Satellite number (within a GNSS)
Definition gnss.hpp:307
static constexpr SvNr FIRST_BDS
First BeiDou satellite number.
Definition gnss.hpp:322
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:317
static constexpr SatSig INVALID_SATSIG
Invalid SatSig.
Definition gnss.hpp:473
static constexpr SvNr FIRST_SBAS
First SBAS satellite number.
Definition gnss.hpp:320
static constexpr SvNr NUM_SBAS
Number of SBAS satellites (S20-S59, PRN - 100)
Definition gnss.hpp:313
const char * SigUseStr(const SigUse use)
Stringify signal use.
static constexpr SvNr NUM_GAL
Number of Galileo satellites (E01-E36, PRN)
Definition gnss.hpp:314
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:261
@ OTHER
Other, unspecified orbit source.
Definition gnss.hpp:267
@ PRED
Predicted orbit.
Definition gnss.hpp:266
static constexpr Sat INVALID_SAT
Invalid "sat".
Definition gnss.hpp:394
@ 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:312
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:315
static constexpr SvNr FIRST_NAVIC
First NavIC satellite number.
Definition gnss.hpp:325
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:319
static constexpr SvNr NUM_NAVIC
Number of NavIC satellites (I01-I14, PRN)
Definition gnss.hpp:318
static constexpr SvNr FIRST_GAL
First Galileo satellite number.
Definition gnss.hpp:321
FixType NmeaModeGllVtgToFixType(const parser::nmea::NmeaModeGllVtg mode)
Convert NMEA GLL/VTG mode to fix type.
Band
Frequency bands.
Definition gnss.hpp:151
@ E6
E6 band (~1.3GHz)
Definition gnss.hpp:154
@ L5
L5 (E5) band (~1.1GHz)
Definition gnss.hpp:156
@ L2
L2 band (~1.2GHz)
Definition gnss.hpp:155
@ L1
L1 (E1) band (~1.5GHz)
Definition gnss.hpp:153
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:326
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:195
@ RTCM3_OSR
RTCM v3.x OSR type RTK corrections available.
Definition gnss.hpp:201
@ RTCM3_SSR
RTCM v3.x SSR type RTK corrections available.
Definition gnss.hpp:202
@ SPARTN
SPARTN corrections available.
Definition gnss.hpp:204
@ RTCM2
RTCM v2 (DGNSS) corrections available.
Definition gnss.hpp:200
@ QZSS_SLAS
QZSS SLAS corrections available.
Definition gnss.hpp:203
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:431
NmeaModeRmcGns
NMEA-Gx-RMC and NMEA-Gx-GNS pos mode.
Definition nmea.hpp:339
NmeaModeGllVtg
NMEA-Gx-GLL and NMEA-Gx-VTG pos mode.
Definition nmea.hpp:314
NmeaSignalId
NMEA signal IDs.
Definition nmea.hpp:456
NmeaQualityGga
NMEA-Gx-GGA quality indicator.
Definition nmea.hpp:264
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:402
bool operator<(const SatSig &rhs) const
Less-than operator.
Definition gnss.hpp:467
SvNr GetSvNr() const
Get satellite number.
Definition gnss.hpp:449
Band GetBand() const
Get band.
Definition gnss.hpp:456
uint32_t id_
Internal representation of Gnss+SvNr+Band+Signal.
Definition gnss.hpp:465
SatSig(const Gnss gnss, const SvNr svnr, const Band band, const Signal signal)
Ctor: create SatSig.
Definition gnss.hpp:418
Signal GetSignal() const
Get signal.
Definition gnss.hpp:463
Gnss GetGnss() const
Get GNSS.
Definition gnss.hpp:442
bool operator!=(const SatSig &rhs) const
Not equal operator.
Definition gnss.hpp:469
Sat GetSat() const
Get satellite.
Definition gnss.hpp:435
SatSig(const Sat sat, const Signal signal)
Ctor: create SatSig.
Definition gnss.hpp:428
bool operator==(const SatSig &rhs) const
Equal operator.
Definition gnss.hpp:468
SatSig()=default
Default ctor: invalid SatSig (INVALID_SATSIG)
Satellite ("sat"), consisting of GNSS and satellite number, suitable for indexing and sorting.
Definition gnss.hpp:335
Sat(const Gnss gnss, const SvNr svnr)
Ctor: from GNSS and satellite number.
Definition gnss.hpp:349
Gnss GetGnss() const
Get GNSS.
Definition gnss.hpp:365
uint16_t id_
Internal representation of Gnss+SvNr.
Definition gnss.hpp:381
bool operator==(const Sat &rhs) const
Equal operator.
Definition gnss.hpp:384
Sat(const char *str)
Ctor: from string.
bool operator!=(const Sat &rhs) const
Not equal operator.
Definition gnss.hpp:385
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:383
SvNr GetSvNr() const
Get satellite number.
Definition gnss.hpp:372
Constants for different versions of NMEA.
Definition nmea.hpp:554
static const NmeaVersion V411
Value for NMEA v4.11.
Definition nmea.hpp:571
std::size_t operator()(const fpsdk::common::gnss::SatSig &k) const
operator
Definition gnss.hpp:579
std::size_t operator()(const fpsdk::common::gnss::Sat &k) const
operator
Definition gnss.hpp:567
Fixposition SDK: Common types and type helpers.
Fixposition SDK: Parser UBX routines and types.