Fixposition SDK 0.0.0-heads/main-0-g6592994
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 OR-operator for SatOrb bits
272 *
273 * @param[in] a Operand 1
274 * @param[in] b Operand 2
275 *
276 * @returns a OR b
277 */
278inline SatOrb operator|(const SatOrb a, const SatOrb b)
279{
280 return static_cast<SatOrb>(static_cast<uint8_t>(a) | static_cast<uint8_t>(b));
281}
282
283/**
284 * @brief OR assignment operator for SatOrb bits
285 *
286 * @param[in] lhs Left-hand side
287 * @param[in] rhs Right-hand side
288 *
289 * @returns lhs ORed by b
290 */
291inline SatOrb& operator|=(SatOrb& lhs, const SatOrb rhs)
292{
293 lhs = static_cast<SatOrb>(static_cast<uint8_t>(lhs) | static_cast<uint8_t>(rhs));
294 return lhs;
295}
296
297/**
298 * @brief AND-operator for SatOrb bits
299 *
300 * @param[in] a Operand 1
301 * @param[in] b Operand 2
302 *
303 * @returns a AND b
304 */
305inline SatOrb operator&(const SatOrb a, const SatOrb b)
306{
307 return static_cast<SatOrb>(static_cast<uint8_t>(a) & static_cast<uint8_t>(b));
308}
309
310/**
311 * @brief Stringify satellite orbit source
312 *
313 * @param[in] orb The satellite orbit source
314 *
315 * @returns a concise and unique string for the satellite orbit source, "?" for bad values
316 */
317const char* SatOrbStr(const SatOrb orb);
318
319// ---------------------------------------------------------------------------------------------------------------------
320
321/**
322 * @brief Get frequency band for a signal
323 *
324 * @note This mapping is in some cases a bit vague and subject to interpretation or preference. See the docu of the
325 * Signal enum.
326 *
327 * @param[in] signal The signal
328 *
329 * @returns the frequency band for the signal
330 */
332
333/**
334 * @brief Get GNSS for a signal
335 *
336 * @param[in] signal The signal
337 *
338 * @returns the GNSS for the signal
339 */
341
342// ---------------------------------------------------------------------------------------------------------------------
343
344/**
345 * @brief Satellite number (within a GNSS)
346 */
347using SvNr = uint8_t;
348
349// Number of satellites per constellation, see https://igs.org/mgex/constellations/. Satellite numbers are two digits
350// satellite numbers as defined by IGS (see RINEX v3.04 section 3.5).
351// clang-format off
352static constexpr SvNr NUM_GPS = 32; //!< Number of GPS satellites (G01-G32, PRN)
353static constexpr SvNr NUM_SBAS = 39; //!< Number of SBAS satellites (S20-S59, PRN - 100)
354static constexpr SvNr NUM_GAL = 36; //!< Number of Galileo satellites (E01-E36, PRN)
355static constexpr SvNr NUM_BDS = 63; //!< Number of BeiDou satellites (C01-C63, PRN)
356static constexpr SvNr NUM_QZSS = 10; //!< Number of QZSS satellites (J01-J10, PRN - 192)
357static constexpr SvNr NUM_GLO = 32; //!< Number of GLONASS satellites (R01-R32, slot)
358static constexpr SvNr NUM_NAVIC = 14; //!< Number of NavIC satellites (I01-I14, PRN)
359static constexpr SvNr FIRST_GPS = 1; //!< First GPS satellite number
360static constexpr SvNr FIRST_SBAS = 20; //!< First SBAS satellite number
361static constexpr SvNr FIRST_GAL = 1; //!< First Galileo satellite number
362static constexpr SvNr FIRST_BDS = 1; //!< First BeiDou satellite number
363static constexpr SvNr FIRST_QZSS = 1; //!< First QZSS satellite number
364static constexpr SvNr FIRST_GLO = 1; //!< First GLONASS satellite number
365static constexpr SvNr FIRST_NAVIC = 1; //!< First NavIC satellite number
366static constexpr SvNr INAVLID_SVNR = 0; //!< Invalid satellite number (in any GNSS)
367// clang-format on
368
369// ---------------------------------------------------------------------------------------------------------------------
370
371/**
372 * @brief Satellite ("sat"), consisting of GNSS and satellite number, suitable for indexing and sorting
373 */
374struct Sat
375{ // clang-format off
376 /**
377 * @brief Default ctor: invalid satellite (INVALID_SAT)
378 */
379 Sat() = default;
380
381 /**
382 * @brief Ctor: from GNSS and satellite number
383 *
384 * @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.
385 *
386 * @param[in] gnss GNSS
387 * @param[in] svnr Satellite number
388 */
389 Sat(const Gnss gnss, const SvNr svnr) : id_ { (uint16_t)(((uint16_t)types::EnumToVal(gnss) << 8) | (uint16_t)svnr) } {}
390
391 /**
392 * @brief Ctor: from string
393 *
394 * @note Invalid strings create an INVALID_SAT
395 *
396 * @param[in] str The string ("G03", "R22", "C12", ...)
397 */
398 Sat(const char* str);
399
400 /**
401 * @brief Get GNSS
402 *
403 * @returns the GNSS
404 */
405 inline Gnss GetGnss() const { return (Gnss)((id_ >> 8) & 0xff); }
406
407 /**
408 * @brief Get satellite number
409 *
410 * @returns the satellit nuber
411 */
412 inline SvNr GetSvNr() const { return id_ & 0xff; }
413
414 /**
415 * @brief Stringify satellite
416 *
417 * @returns a unique string identifying the satellite
418 */
419 const char* GetStr() const;
420
421 uint16_t id_ = 0x0000; //!< Internal representation of Gnss+SvNr
422
423 inline bool operator< (const Sat& rhs) const { return id_ < rhs.id_; } //!< Less-than operator
424 inline bool operator==(const Sat& rhs) const { return id_ == rhs.id_; } //!< Equal operator
425 inline bool operator!=(const Sat& rhs) const { return id_ != rhs.id_; } //!< Not equal operator
426 // See also std::hash<Sat> declaration at the end of this file
427}; // clang-format on
428
429/**
430 * @brief Invalid "sat"
431 *
432 * @note This is not the only invalid combination of GNSS and satellite number!
433 */
434static constexpr Sat INVALID_SAT;
435
436// ---------------------------------------------------------------------------------------------------------------------
437
438/**
439 * @brief Satellite plus frequency band and signal ("satsig"), suitable for indexing and sorting
440 */
441struct SatSig
442{ // clang-format off
443 /**
444 * @brief Default ctor: invalid SatSig (INVALID_SATSIG)
445 */
446 SatSig() = default;
447
448 /**
449 * @brief Ctor: create SatSig
450 *
451 * @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.
452 *
453 * @param[in] gnss GNSS
454 * @param[in] svnr Satellite number
455 * @param[in] band Frequency band
456 * @param[in] signal Signal
457 */
458 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) } {}
459
460 /**
461 * @brief Ctor: create SatSig
462 *
463 * @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.
464 *
465 * @param[in] sat Satellite (GNSS + satellite number)
466 * @param[in] signal Signal (implies band)
467 */
468 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))) } {}
469
470 /**
471 * @brief Get satellite
472 *
473 * @returns the satellite
474 */
475 inline Sat GetSat() const { return { GetGnss(), GetSvNr() }; }
476
477 /**
478 * @brief Get GNSS
479 *
480 * @returns the GNSS
481 */
482 inline Gnss GetGnss() const { return (Gnss)((id_ >> 24) & 0xff); }
483
484 /**
485 * @brief Get satellite number
486 *
487 * @returns the satellite number
488 */
489 inline SvNr GetSvNr() const { return (SvNr)((id_ >> 16) & 0xff); }
490
491 /**
492 * @brief Get band
493 *
494 * @returns the band
495 */
496 inline Band GetBand() const { return (Band)((id_ >> 8) & 0xff); }
497
498 /**
499 * @brief Get signal
500 *
501 * @returns the signal
502 */
503 inline Signal GetSignal() const { return (Signal)(id_ & 0xff); }
504
505 uint32_t id_ = 0x00000000; //!< Internal representation of Gnss+SvNr+Band+Signal
506
507 inline bool operator< (const SatSig& rhs) const { return id_ < rhs.id_; } //!< Less-than operator
508 inline bool operator==(const SatSig& rhs) const { return id_ == rhs.id_; } //!< Equal operator
509 inline bool operator!=(const SatSig& rhs) const { return id_ != rhs.id_; } //!< Not equal operator
510 // See also std::hash<SatSig> declaration at the end of this file
511}; // clang-format on
512
513static constexpr SatSig INVALID_SATSIG; //!< Invalid SatSig
514
515// ---------------------------------------------------------------------------------------------------------------------
516
517/**
518 * @brief Convert UBX gnssId to GNSS
519 *
520 * @param[in] gnssId UBX gnssId
521 *
522 * @returns the GNSS
523 */
524Gnss UbxGnssIdToGnss(const uint8_t gnssId);
525
526/**
527 * @brief Convert UBX gnssId and svId to satellite
528 *
529 * @param[in] gnssId UBX gnssId
530 * @param[in] svId UBX svId
531 *
532 * @returns the satellite, INVALID_SAT for invalid gnssId/svId
533 */
534Sat UbxGnssIdSvIdToSat(const uint8_t gnssId, const uint8_t svId);
535
536/**
537 * @brief Convert UBX gnssId and sigId to signal
538 *
539 * @param[in] gnssId UBX gnssId
540 * @param[in] sigId UBX sigId
541 *
542 * @returns the signal
543 */
544Signal UbxGnssIdSigIdToSignal(const uint8_t gnssId, const uint8_t sigId);
545
546// ---------------------------------------------------------------------------------------------------------------------
547
548/**
549 * @brief Convert NMEA GGA quality to fix type
550 *
551 * @param[in] quality NMEA GGA quality
552 *
553 * @returns the fix type corresponding to the quality
554 */
556
557/**
558 * @brief Convert NMEA RMC/GNS mode to fix type
559 *
560 * @param[in] mode NMEA RMC/GNS mode
561 *
562 * @returns the fix type corresponding to the mode
563 */
565
566/**
567 * @brief Convert NMEA GLL/VTG mode to fix type
568 *
569 * @param[in] mode NMEA GLL/VTG mode
570 *
571 * @returns the fix type corresponding to the mode
572 */
574
575/**
576 * @brief Convert NMEA system ID and satellite number to satellite
577 *
578 * @param[in] systemId NMEA system ID
579 * @param[in] svId NMEA satellite ID
580 * @param[in] nmeaVersion NMEA version
581 *
582 * @returns the satellite, INVALID_SAT for invalid systemId/svId
583 */
584Sat NmeaSystemIdSvIdToSat(const parser::nmea::NmeaSystemId systemId, const uint8_t svId,
586
587/**
588 * @brief Convert NMEA signal ID to signal
589 *
590 * @param[in] signalId NMEA signal ID
591 *
592 * @returns the signal
593 */
595
596// ---------------------------------------------------------------------------------------------------------------------
597
598/**
599 * @brief Convert SBF SVID to Satellite
600 *
601 * @param[in] SVID SBF SVID
602 *
603 * @returns the satellite, INVALID_SAT for invalid SVID
604 */
605Sat SbfSvidToSat(const uint16_t SVID);
606
607/* ****************************************************************************************************************** */
608} // namespace gnss
609} // namespace common
610} // namespace fpsdk
611
612/**
613 * @brief Hasher for Sat (e.g. std::unordered_map)
614 */
615template <>
616struct std::hash<fpsdk::common::gnss::Sat>
617{
618 std::size_t operator()(const fpsdk::common::gnss::Sat& k) const
619 {
620 return k.id_;
621 } //!< operator
622};
623
624/**
625 * @brief Hasher for SatSig (e.g. std::unordered_map)
626 */
627template <>
628struct std::hash<fpsdk::common::gnss::SatSig>
629{
630 std::size_t operator()(const fpsdk::common::gnss::SatSig& k) const
631 {
632 return k.id_;
633 } //!< operator
634};
635
636/* ****************************************************************************************************************** */
637#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:356
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:364
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.
SatOrb operator|(const SatOrb a, const SatOrb b)
OR-operator for SatOrb bits.
Definition gnss.hpp:278
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:363
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:347
static constexpr SvNr FIRST_BDS
First BeiDou satellite number.
Definition gnss.hpp:362
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:357
static constexpr SatSig INVALID_SATSIG
Invalid SatSig.
Definition gnss.hpp:513
static constexpr SvNr FIRST_SBAS
First SBAS satellite number.
Definition gnss.hpp:360
static constexpr SvNr NUM_SBAS
Number of SBAS satellites (S20-S59, PRN - 100)
Definition gnss.hpp:353
const char * SigUseStr(const SigUse use)
Stringify signal use.
static constexpr SvNr NUM_GAL
Number of Galileo satellites (E01-E36, PRN)
Definition gnss.hpp:354
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:434
@ NAVIC
NavIC (IRNSS) (I)
Definition gnss.hpp:80
const char * BandStr(const Band band)
Stringify frequency band.
SatOrb operator&(const SatOrb a, const SatOrb b)
AND-operator for SatOrb bits.
Definition gnss.hpp:305
static constexpr SvNr NUM_GPS
Number of GPS satellites (G01-G32, PRN)
Definition gnss.hpp:352
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:355
static constexpr SvNr FIRST_NAVIC
First NavIC satellite number.
Definition gnss.hpp:365
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:359
static constexpr SvNr NUM_NAVIC
Number of NavIC satellites (I01-I14, PRN)
Definition gnss.hpp:358
static constexpr SvNr FIRST_GAL
First Galileo satellite number.
Definition gnss.hpp:361
FixType NmeaModeGllVtgToFixType(const parser::nmea::NmeaModeGllVtg mode)
Convert NMEA GLL/VTG mode to fix type.
SatOrb & operator|=(SatOrb &lhs, const SatOrb rhs)
OR assignment operator for SatOrb bits.
Definition gnss.hpp:291
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:366
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.
Sat SbfSvidToSat(const uint16_t SVID)
Convert SBF SVID to Satellite.
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:442
bool operator<(const SatSig &rhs) const
Less-than operator.
Definition gnss.hpp:507
SvNr GetSvNr() const
Get satellite number.
Definition gnss.hpp:489
Band GetBand() const
Get band.
Definition gnss.hpp:496
uint32_t id_
Internal representation of Gnss+SvNr+Band+Signal.
Definition gnss.hpp:505
SatSig(const Gnss gnss, const SvNr svnr, const Band band, const Signal signal)
Ctor: create SatSig.
Definition gnss.hpp:458
Signal GetSignal() const
Get signal.
Definition gnss.hpp:503
Gnss GetGnss() const
Get GNSS.
Definition gnss.hpp:482
bool operator!=(const SatSig &rhs) const
Not equal operator.
Definition gnss.hpp:509
Sat GetSat() const
Get satellite.
Definition gnss.hpp:475
SatSig(const Sat sat, const Signal signal)
Ctor: create SatSig.
Definition gnss.hpp:468
bool operator==(const SatSig &rhs) const
Equal operator.
Definition gnss.hpp:508
SatSig()=default
Default ctor: invalid SatSig (INVALID_SATSIG)
Satellite ("sat"), consisting of GNSS and satellite number, suitable for indexing and sorting.
Definition gnss.hpp:375
Sat(const Gnss gnss, const SvNr svnr)
Ctor: from GNSS and satellite number.
Definition gnss.hpp:389
Gnss GetGnss() const
Get GNSS.
Definition gnss.hpp:405
uint16_t id_
Internal representation of Gnss+SvNr.
Definition gnss.hpp:421
bool operator==(const Sat &rhs) const
Equal operator.
Definition gnss.hpp:424
Sat(const char *str)
Ctor: from string.
bool operator!=(const Sat &rhs) const
Not equal operator.
Definition gnss.hpp:425
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:423
SvNr GetSvNr() const
Get satellite number.
Definition gnss.hpp:412
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:630
std::size_t operator()(const fpsdk::common::gnss::Sat &k) const
operator
Definition gnss.hpp:618
Fixposition SDK: Common types and type helpers.
Fixposition SDK: Parser UBX routines and types.