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
fpa.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: Parser FP_A routines and types
14 */
15// clang-format off
16/**
17 * @page FPSDK_COMMON_PARSER_FPA Parser FP_A routines and types
18 *
19 * **API**: fpsdk_common/parser/fpa.hpp and fpsdk::common::parser::fpa
20 *
21 * @fp_msgspec_begin{FP_A-Protocol}
22 *
23 * Messages are in this form:
24 *
25 * <code><b style="color: red;">$</b><b style="color: green;">FP</b>,<b style="color: blue;">msg_type</b>,<b style="color: blue;">msg_version</b>,<em>field<sub>3</sub></em>,<em>field<sub>4</sub></em>,…,<em>field<sub>N</sub></em><b style="color: red;">*CC</b><b style="color: red;">\\r\\n</b></code>
26 *
27 * Where:
28 *
29 * - The FP_A style framing:
30 * - <code><b style="color: red;">\$</b></code>
31 * -- Start character ("$", ASCII 36)
32 * - <code><b style="color: red;">\*CC</b></code>
33 * -- Checksum: "*" (ASCII 42) and two digit XOR value of all payload
34 * characters in captial hexadecimal notation, for example:
35 * "FPX" = <code>'F' ^ 'P' ^ 'X' = 70 ^ 80 ^ 88 = 78 = 0x4e</code> = checksum <code>4E</code>
36 * - <code><b style="color: red;">\\r\\n</b></code> -- Message termination characters (CR + LF, ASCII 13 + 10)
37 * - A Fixposition identifier:
38 * - <code><b style="color: green;">FP</b></code>
39 * -- Fixposition ASCII message identifier, "FP" (ASCII 70 + 80)
40 * - Fixposition message type and version:
41 * - <code><b style="color: blue;">msg_type</b></code> (= <code><em>field<sub>1</sub></em></code>)
42 * -- Message type, all capital letters (ASCII 65--90)
43 * - <code><b style="color: blue;">msg_version</b></code> (= <code><em>field<sub>2</sub></em></code>)
44 * -- Message version, decimal number (letters 0--9, ASCII 48--57), range 1--…
45 * - Data fields (payload)
46 * - <code><em>field<sub>3</sub></em>,<em>field<sub>4</sub></em>,…,<em>field<sub>N</sub></em></code>
47 * -- The structure of the message data is defined by the <code><b style="color: blue;">msg_type</b></code>
48 * and <code><b style="color: blue;">version</b></code>.
49 * Each field can contain all printable 7-bit ASCII characters (ASCII 32–126), excluding the
50 * reserved characters `!` (ASCII 33), `$` (ASCII 36), `*` (ASCII 42), `,` (ASCII 44),
51 * `\` (ASCII 92), `~` (ASCII 126).
52 * - Field separators
53 * - All fields (identifier, message type, message version, data fields) are separated by a `,` (comma, ASCII 44)
54 * - Null fields
55 * - Data fields can be _null_, meaning their value is absent to indicate that no data is
56 * available. The data for null fields is the empty string. For example:
57 * - Definition: <code>…,<em>field<sub>i</sub></em>,<em>field<sub>i+1</sub></em>,<em>field<sub>i+2</sub></em>,…</code>
58 * - Values: <code><em>field<sub>i</sub></em></code> = 123, <code><em>field<sub>i+1</sub></em></code> = _null_,
59 * <code><em>field<sub>i+2</sub></em></code> = 456
60 * - Payload string: <code>…,123,,456,…</code>
61 * - Data field types:
62 * - _Numeric_: Decimal integer number, one or more digits (0-9) and optional leading "-" sign
63 * - _Float (.x)_: Decimal floating point number, one or more digits (0-9) and optional leading "-" sign, with
64 * _x_ digits fractional part separated by a dot (".")
65 * - _Float (x)_: Decimal floating point number with _x_ significant digits, optional leading "-", optional fractional
66 * part separated by a dot (".")
67 * - _String_: String of allowed payload characters (but not the `,` field separator)
68 * - ...
69 * - ...
70 *
71 * @fp_msgspec_end
72 *
73 */
74// clang-format on
75#ifndef __FPSDK_COMMON_PARSER_FPA_HPP__
76#define __FPSDK_COMMON_PARSER_FPA_HPP__
77
78/* LIBC/STL */
79#include <array>
80#include <cstdint>
81#include <memory>
82#include <string>
83#include <vector>
84
85/* EXTERNAL */
86
87/* PACKAGE */
88#include "../logging.hpp"
89#include "../types.hpp"
90#include "types.hpp"
91
92namespace fpsdk {
93namespace common {
94namespace parser {
95/**
96 * @brief Parser FP_A routines and types
97 */
98namespace fpa {
99/* ****************************************************************************************************************** */
100
101static constexpr uint8_t FP_A_PREAMBLE = '$'; //!< FP_A framing preamble
102static constexpr int FP_A_FRAME_SIZE = 6; //!< FP_A frame size ("$*cc\r\n")
103
104//! FP_A message meta data
106{
107 char msg_type_[40] = { 0 }; //!< Message type (for example, "ODOMETRY"), nul-terminated string
108 int msg_version_ = 0; //!< Message version (for example, 1), < 0 if unknown
109 int payload_ix0_ = 0; //!< Index (offset) for start of payload, 0 if no payload available
110 int payload_ix1_ = 0; //!< Index (offset) for end of payload, 0 if no payload available
111};
112
113/**
114 * @brief Get FP_A message meta data
115 *
116 * @param[out] meta The meta data
117 * @param[in] msg Pointer to the FP_A message
118 * @param[in] msg_size Size of the FP_A message (>= 11)
119 *
120 * @note No check on the data provided is done. The caller must ensure that the data is a correct FP_A message.
121 *
122 * @returns true if the meta data was successfully extracted, false otherwise
123 */
124bool FpaGetMessageMeta(FpaMessageMeta& meta, const uint8_t* msg, const std::size_t msg_size);
125
126/**
127 * @brief Get FP_A message name
128 *
129 * Generates a name (string) in the form "FP_A-MESSAGEID" (for example, "FP_A-ODOMETRY").
130 *
131 * @param[out] name String to write the name to
132 * @param[in] size Size of \c name (incl. nul termination)
133 * @param[in] msg Pointer to the FP_A message
134 * @param[in] msg_size Size of the \c msg
135 *
136 * @note No check on the data provided is done. The caller must ensure that the data is a valid FP_A or FP_A message.
137 *
138 * @returns true if message name was generated, false if \c name buffer was too small
139 */
140bool FpaGetMessageName(char* name, const std::size_t size, const uint8_t* msg, const std::size_t msg_size);
141
142/**
143 * @brief Get FP_A message info
144 *
145 * This stringifies the content of some FP_A messages, for debugging.
146 *
147 * @param[out] info String to write the info to
148 * @param[in] size Size of \c name (incl. nul termination)
149 * @param[in] msg Pointer to the FP_A message
150 * @param[in] msg_size Size of the \c msg
151 *
152 * @note No check on the data provided is done. The caller must ensure that the data is a valid FP_A message.
153 *
154 * @returns true if message info was generated (even if info is empty), false if \c name buffer was too small
155 */
156bool FpaGetMessageInfo(char* info, const std::size_t size, const uint8_t* msg, const std::size_t msg_size);
157
158/**
159 * @brief FP_A fusion initialisation status
160 */
161enum class FpaInitStatus : int
162{ // clang-format off
163 UNSPECIFIED = '!', //!< Unspecified
164 NOT_INIT = '0', //!< Not initialised
165 LOCAL_INIT = '1', //!< Locally initialised
166 GLOBAL_INIT = '2', //!< Globally initialised
167}; // clang-format on
168
169/**
170 * @brief FP_A legacy fusion status
171 */
172enum class FpaFusionStatusLegacy : int
173{ // clang-format off
174 UNSPECIFIED = '!', //!< Unspecified
175 NONE = '0', //!< Not started
176 VISION = '1', //!< Vision only
177 VIO = '2', //!< Visual-inertial fusion
178 IMU_GNSS = '3', //!< Inertial-GNSS fusion
179 VIO_GNSS = '4' //!< Visual-inertial-GNSS fusion
180}; // clang-format on
181
182/**
183 * @brief FP_A fusion measurement status
184 */
185enum class FpaMeasStatus : int
186{ // clang-format off
187 UNSPECIFIED = '!', //!< Unspecified
188 NOT_USED = '0', //!< Not used
189 USED = '1', //!< Used
190 DEGRADED = '2', //!< Degraded
191}; // clang-format on
192
193/**
194 * @brief FP_A IMU bias status
195 */
196enum class FpaImuStatus : int
197{ // clang-format off
198 UNSPECIFIED = '!', //!< Unspecified
199 NOT_CONVERGED = '0', //!< Not converged
200 WARMSTARTED = '1', //!< Warmstarted
201 ROUGH_CONVERGED = '2', //!< Rough convergence
202 FINE_CONVERGED = '3', //!< Fine convergence
203}; // clang-format on
204
205/**
206 * @brief FP_A Legacy IMU bias status
207 */
208enum class FpaImuStatusLegacy : int
209{ // clang-format off
210 UNSPECIFIED = '!', //!< Unspecified
211 NOT_CONVERGED = '0', //!< Not converged
212 CONVERGED = '1', //!< Converged
213}; // clang-format on
214
215/**
216 * @brief FP_A IMU variance
217 */
218enum class FpaImuNoise : int
219{ // clang-format off
220 UNSPECIFIED = '!', //!< Unspecified
221 LOW_NOISE = '1', //!< Low noise
222 MEDIUM_NOISE = '2', //!< Medium noise
223 HIGH_NOISE = '3', //!< High noise
224 RESERVED4 = '4', //!< Reserved
225 RESERVED5 = '5', //!< Reserved
226 RESERVED6 = '6', //!< Reserved
227 RESERVED7 = '7', //!< Reserved
228}; // clang-format on
229
230/**
231 * @brief FP_A IMU accelerometer and gyroscope convergence
232 */
233enum class FpaImuConv : int
234{ // clang-format off
235 UNSPECIFIED = '!', //!< Unspecified
236 RESERVED0 = '0', //!< Reserved
237 WAIT_IMU_MEAS = '1', //!< Awaiting IMU measurements
238 WAIT_GLOBAL_MEAS = '2', //!< Insufficient global measurements
239 WAIT_MOTION = '3', //!< Insufficient motion
240 CONVERGING = '4', //!< Converging
241 RESERVED5 = '5', //!< Reserved
242 RESERVED6 = '6', //!< Reserved
243 IDLE = '7', //!< Idle
244}; // clang-format on
245
246/**
247 * @brief FP_A GNSS fix status
248 */
249enum class FpaGnssStatus : int
250{ // clang-format off
251 UNSPECIFIED = '!', //!< Unspecified
252 NO_FIX = '0', //!< No fix
253 SPP = '1', //!< Single-point positioning (SPP)
254 RTK_MB = '2', //!< RTK moving baseline
255 RESERVED3 = '3', //!< Reserved
256 RESERVED4 = '4', //!< Reserved
257 RTK_FLOAT = '5', //!< RTK float
258 RESERVED6 = '6', //!< Reserved
259 RESERVED7 = '7', //!< Reserved
260 RTK_FIXED = '8', //!< RTK fixed
261 RESERVED9 = '9', //!< Reserved
262}; // clang-format on
263
264/**
265 * @brief FP_A GNSS correction status
266 */
267enum class FpaCorrStatus : int
268{ // clang-format off
269 UNSPECIFIED = '!', //!< Unspecified
270 WAITING_FUSION = '0', //!< Waiting fusion
271 NO_GNSS = '1', //!< No GNSS available
272 NO_CORR = '2', //!< No corrections used
273 LIMITED_CORR = '3', //!< Limited corrections used: station data & at least one of the constellations (both bands) among the valid rover measurements
274 OLD_CORR = '4', //!< Corrections are too old (TBD)
275 GOOD_CORR = '5', //!< Sufficient corrections used: station data and corrections for ALL bands among the valid rover measurements
276 RESERVED6 = '6', //!< Reserved
277 RESERVED7 = '7', //!< Reserved
278 RESERVED8 = '8', //!< Reserved
279 RESERVED9 = '9', //!< Reserved
280}; // clang-format on
281
282/**
283 * @brief FP_A baseline status
284 */
285enum class FpaBaselineStatus : int
286{ // clang-format off
287 UNSPECIFIED = '!', //!< Unspecified
288 WAITING_FUSION = '0', //!< Waiting fusion
289 NO_FIX = '1', //!< Not available or no fix
290 FAILING = '2', //!< Failing
291 PASSING = '3', //!< Passing
292}; // clang-format on
293
294/**
295 * @brief FP_A camera status
296 */
297enum class FpaCamStatus : int
298{ // clang-format off
299 UNSPECIFIED = '!', //!< Unspecified
300 CAM_UNAVL = '0', //!< Camera not available
301 BAD_FEAT = '1', //!< Camera available, but not usable (e.g. too dark)
302 RESERVED2 = '2', //!< Reserved
303 RESERVED3 = '3', //!< Reserved
304 RESERVED4 = '4', //!< Reserved
305 GOOD = '5', //!< Camera working and available
306}; // clang-format on
307
308/**
309 * @brief FP_A wheelspeed status
310 */
311enum class FpaWsStatus : int
312{ // clang-format off
313 UNSPECIFIED = '!', //!< Unspecified
314 NOT_ENABLED = '0', //!< No wheelspeed enabled
315 MISS_MEAS = '1', //!< Missing wheelspeed measurements
316 NONE_CONVERGED = '2', //!< At least one wheelspeed enabled, no wheelspeed converged
317 ONE_CONVERGED = '3', //!< At least one wheelspeed enabled and at least one converged
318 ALL_CONVERGED = '4', //!< At least one wheelspeed enabled and all converged
319}; // clang-format on
320
321/**
322 * @brief FP_A Legacy wheelspeed status
323 */
324enum class FpaWsStatusLegacy : int
325{ // clang-format off
326 UNSPECIFIED = '!', //!< Unspecified
327 NOT_ENABLED = '-', //!< No wheelspeed enabled
328 NONE_CONVERGED = '0', //!< None converged
329 ONE_OR_MORE_CONVERGED = '1', //!< At least one converged
330}; // clang-format on
331
332/**
333 * @brief FP_A wheelspeed convergence status
334 */
335enum class FpaWsConv : int
336{ // clang-format off
337 UNSPECIFIED = '!', //!< Unspecified
338 WAIT_FUSION = '0', //!< Awaiting Fusion
339 WAIT_WS_MEAS = '1', //!< Missing wheelspeed measurements
340 WAIT_GLOBAL_MEAS = '2', //!< Insufficient global measurements
341 WAIT_MOTION = '3', //!< Insufficient motion
342 WAIT_IMU_BIAS = '4', //!< Insufficient imu bias convergence
343 CONVERGING = '5', //!< Converging
344 IDLE = '6', //!< Idle
345}; // clang-format on
346
347/**
348 * @brief FP_A markers status
349 */
350enum class FpaMarkersStatus : int
351{ // clang-format off
352 UNSPECIFIED = '!', //!< Unspecified
353 NOT_ENABLED = '0', //!< No markers available
354 NONE_CONVERGED = '1', //!< Markers available
355 ONE_CONVERGED = '2', //!< Markers available and used
356 ALL_CONVERGED = '3', //!< All markers available and used
357}; // clang-format on
358
359/**
360 * @brief FP_A markers convergence status
361 */
362enum class FpaMarkersConv : int
363{ // clang-format off
364 UNSPECIFIED = '!', //!< Unspecified
365 WAIT_FUSION = '0', //!< Awaiting Fusion
366 WAIT_MARKER_MEAS = '1', //!< Waiting marker measurements
367 WAIT_GLOBAL_MEAS = '2', //!< Insufficient global measurements
368 CONVERGING = '3', //!< Converging
369 IDLE = '4', //!< Idle
370}; // clang-format on
371
372/**
373 * @brief FP_A GNSS fix type
374 */
375enum class FpaGnssFix : int
376{ // clang-format off
377 UNSPECIFIED = '!', //!< Unspecified
378 UNKNOWN = '0', //!< Unknown
379 NOFIX = '1', //!< No fix
380 DRONLY = '2', //!< Dead-reckoning only
381 TIME = '3', //!< Time-only fix
382 S2D = '4', //!< Single 2D fix
383 S3D = '5', //!< Single 3D fix
384 S3D_DR = '6', //!< Single 3D fix with dead-reckoning
385 RTK_FLOAT = '7', //!< RTK float fix
386 RTK_FIXED = '8', //!< RTK fixed fix
387}; // clang-format on
388
389/**
390 * @brief FP_A epoch type
391 */
392enum class FpaEpoch : int
393{
394 UNSPECIFIED = 0, //!< Unspecified
395 GNSS1, //!< GNSS 1
396 GNSS2, //!< GNSS 2
397 GNSS, //!< Combined GNSS
398 FUSION, //!< Fusion
399};
400
401/**
402 * @brief Stringify epoch type
403 *
404 * @param[in] epoch The epoch type
405 *
406 * @returns the stringification of the epoch type ("FUSION", "GNSS1", etc.)
407 */
408const char* FpaEpochStr(const FpaEpoch epoch);
409
410/**
411 * @brief FP_A GNSS antenna state
412 */
413enum class FpaAntState : int
414{
415 UNSPECIFIED = 0, //!< Unspecified
416 OPEN, //!< No antenna detected (or connected via DC block)
417 OK, //!< Antenna detected and good
418 SHORT, //!< Antenna short circuit detected
419};
420
421/**
422 * @brief FP_A GNSS antenna power
423 */
424enum class FpaAntPower : int
425{
426 UNSPECIFIED = 0, //!< Unspecified
427 ON, //!< Antenna power supply is on
428 OFF, //!< Antenna power supply is off
429};
430
431/**
432 * @brief FP_A text levels
433 */
434enum class FpaTextLevel : int
435{ // clang-format off
436 UNSPECIFIED = 0, //!< Unspecified
441}; // clang-format on
442/**
443 * @brief FP_A time base
444 */
445enum class FpaTimebase : int
446{ // clang-format off
447 UNSPECIFIED = 0, //!< Unspecified
448 NONE, //!< None
449 GNSS, //!< GNSS
450 UTC, //!< UTC
451}; // clang-format on
452
453/**
454 * @brief FP_A time reference
455 */
456enum class FpaTimeref : int
457{ // clang-format off
458 UNSPECIFIED = 0, //!< Unspecified
459 UTC_NONE, //!< UTC: None (UTC params not yet known)
460 UTC_CRL, //!< UTC: Communications Research Laboratory (CRL), Japan
461 UTC_NIST, //!< UTC: National Institute of Standards and Technology (NIST)
462 UTC_USNO, //!< UTC: U.S. Naval Observatory (USNO)
463 UTC_BIPM, //!< UTC: International Bureau of Weights and Measures (BIPM)
464 UTC_EU, //!< UTC: European laboratories
465 UTC_SU, //!< UTC: Former Soviet Union (SU)
466 UTC_NTSC, //!< UTC: National Time Service Center (NTSC), China
467 GNSS_GPS, //!< GNSS: GPS
468 GNSS_GAL, //!< GNSS: Galileo
469 GNSS_BDS, //!< GNSS: BeiDou
470 GNSS_GLO, //!< GNSS: GLONASS
471 GNSS_NVC, //!< GNSS: NavIC
472 OTHER, //!< other/unknown GNSS/UTC
473}; // clang-format on
474
475/**
476 * @brief FP_A integer value
477 */
478struct FpaInt
479{
480 bool valid = false; //!< Data is valid
481 int value = 0; //!< Value
482};
483
484/**
485 * @brief FP_A float value
486 */
488{
489 bool valid = false; //!< Data is valid
490 double value = 0.0; //!< Value
491};
492
493/**
494 * @brief FP_A three float values
495 */
497{
498 bool valid = false; //!< Data is valid
499 std::array<double, 3> values = { { 0.0, 0.0, 0.0 } }; //!< Values
500};
501
502/**
503 * @brief FP_A four float values
504 */
506{
507 bool valid = false; //!< Data is valid
508 std::array<double, 4> values = { { 0.0, 0.0, 0.0, 0.0 } }; //!< Values
509};
510
511/**
512 * @brief FP_A six float values
513 */
515{
516 bool valid = false; //!< Data is valid
517 std::array<double, 6> values = { { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } }; //!< Values
518};
519
520/**
521 * @brief FP_A GPS time
522 */
524{
525 FpaInt week; //!< GPS week number, range 0-9999, or null if time not (yet) available
526 FpaFloat tow; //!< GPS time of week, range 0.000-604799.999999, or null if time not (yet) available
527
528 bool operator==(const FpaGpsTime& rhs) const; //!< Equal (epsilon = 1e-6)
529 bool operator!=(const FpaGpsTime& rhs) const; //!< Not equal (epsilon = 1e-6)
530 bool operator<(const FpaGpsTime& rhs) const; //!< Less than
531 bool operator>(const FpaGpsTime& rhs) const; //!< Greater than
532 bool operator<=(const FpaGpsTime& rhs) const; //!< Less or equal than
533 bool operator>=(const FpaGpsTime& rhs) const; //!< Greater or equal than
534};
535
536/**
537 * @brief FP_A message types
538 */
540{
541 UNSPECIFIED, //!< Unspecified
542 EOE, //!< FpaEoePayload
543 GNSSANT, //!< FpaGnssantPayload
544 GNSSCORR, //!< FpaGnsscorrPayload
545 RAWIMU, //!< FpaRawimuPayload
546 CORRIMU, //!< FpaCorrimuPayload
547 IMUBIAS, //!< FpaImubiasPayload
548 LLH, //!< FpaLlhPayload
549 ODOMETRY, //!< FpaOdometryPayload
550 ODOMENU, //!< FpaOdomenuPayload
551 ODOMSH, //!< FpaOdomshPayload
552 ODOMSTATUS, //!< FpaOdomstatusPayload
553 TEXT, //!< FpaTextPayload
554 TF, //!< FpaTfPayload
555 TP, //!< FpaTpPayload
556 VERSION, //!< FpaVersionPayload
557};
558
559/**
560 * @brief FP_A payload base class
561 */
563{
564 bool valid_ = false; //!< Payload successfully decoded (true), or not (yet) decoded (false)
566 virtual ~FpaPayload() = default; //!< Virtual dtor for polymorphism
567
568 /**
569 * @brief Set data from message
570 *
571 * @param[in] msg Pointer to the FP_A message
572 * @param[in] msg_size Size of the FP_A message (>= 11)
573 *
574 * @returns true if message payload was correct and all data could be extracted (fields are now valid), or false
575 * otherwise (fields are now invalid)
576 */
577 virtual bool SetFromMsg(const uint8_t* msg, const std::size_t msg_size) = 0;
578
579 /**
580 * @brief Set data from message
581 *
582 * @param[in] buf The FP_A message data
583 *
584 * @returns true if message payload was correct and all data could be extracted (fields are now valid), or false
585 * otherwise (fields are now invalid)
586 */
587 inline bool SetFromBuf(const std::vector<uint8_t>& buf)
588 {
589 return SetFromMsg(buf.data(), buf.size());
590 }
591};
592
593/**
594 * @brief FP_A-EOE (version 1) message payload
595 */
597{
599 FpaEpoch epoch = FpaEpoch::UNSPECIFIED; //!< Indicates which epoch ended ("FUSION", "GNSS", "GNSS1", "GNSS2")
600
601 bool SetFromMsg(const uint8_t* msg, const std::size_t msg_size) final;
602
603 static constexpr const char* MSG_NAME = "FP_A-EOE"; //!< Message name
604};
605
606/**
607 * @brief FP_A-GNSSANT (version 1) message payload
608 */
610{ // clang-format off
614 FpaInt gnss1_age; //!< Time since gnss1_state or gnss1_power information last changed, 0-604800
617 FpaInt gnss2_age; //!< Time since gnss2_state or gnss2_power information last changed, 0-604800
618 // clang-format on
619
620 bool SetFromMsg(const uint8_t* msg, const std::size_t msg_size) final;
621
622 static constexpr const char* MSG_NAME = "FP_A-GNSSANT"; //!< Message name
623};
624
625/**
626 * @brief FP_A-GNSSCORR (version 1) message payload
627 */
629{ // clang-format off
631 FpaGnssFix gnss1_fix = FpaGnssFix::UNSPECIFIED; //!< Fix status of GNSS1
632 FpaInt gnss1_nsig_l1; //!< Number of L1 signals with correction data tracked by GNSS1 receiver, range 0-100
633 FpaInt gnss1_nsig_l2; //!< Number of L2 signals with correction data tracked by GNSS1 receiver, range 0-100
634 FpaGnssFix gnss2_fix = FpaGnssFix::UNSPECIFIED; //!< Fix status of GNSS2 receiver
635 FpaInt gnss2_nsig_l1; //!< Number of L1 signals with correction data tracked by GNSS2 receiver, range 0-100
636 FpaInt gnss2_nsig_l2; //!< Number of L2 signals with correction data tracked by GNSS2 receiver, range 0-100
637 FpaFloat corr_latency; //!< Average correction data latency (10s window), range 0.0-99.9
638 FpaFloat corr_update_rate; //!< Average correction update rate (10s window), range 0.0-0.0
639 FpaFloat corr_data_rate; //!< Average correction data rate (10s window), range 0.0-50.0
640 FpaFloat corr_msg_rate; //!< Average correction message rate (10s window), range 0-50
641 FpaInt sta_id; //!< Correction station ID, range 0--4095
642 FpaFloat3 sta_llh; //!< Correction station latitude/longitude/height [deg, deg, m]
643 FpaInt sta_dist; //!< Correction station baseline length (approximate 3d distance), range 0-100000
644 // clang-format on
645
646 bool SetFromMsg(const uint8_t* msg, const std::size_t msg_size) final;
647
648 static constexpr const char* MSG_NAME = "FP_A-GNSSCORR"; //!< Message name
649};
650
651/**
652 * @brief FP_A-...IMU (versions 1 and 2) messages payload
653 */
655{
656 //! Data from which FP_A-...IMU is stored
657 enum class Which
658 {
659 UNSPECIFIED, //!< Unspecified
660 RAWIMU, //!< Data is from FP_A-RAWIMU
661 CORRIMU, //!< Data is from FP_A-CORRIMU
662 };
663 Which which = Which::UNSPECIFIED; //!< Indicates from which message the data is
664 // clang-format off
666 FpaFloat3 acc; //!< Raw acceleration in output frame, X/Y/Z components
667 FpaFloat3 rot; //!< Raw angular velocity in output frame, X/Y/Z components
668 bool bias_comp = false; //!< Signal is bias compensated (true) or not (false), always false for RAWIMU, may be true for CORRIMU
669 FpaImuStatus imu_status = FpaImuStatus::UNSPECIFIED; //!< IMU bias status (only available for version 2 messages)
670 // clang-format on
671};
672
673/**
674 * @brief FP_A-RAWIMU (version 1) message payload
675 */
677{
678 bool SetFromMsg(const uint8_t* msg, const std::size_t msg_size) final;
679
680 static constexpr const char* MSG_NAME = "FP_A-RAWIMU"; //!< Message name
681};
682
683/**
684 * @brief FP_A-CORRIMU (version 1) message payload
685 */
687{
688 bool SetFromMsg(const uint8_t* msg, const std::size_t msg_size) final;
689
690 static constexpr const char* MSG_NAME = "FP_A-CORRIMU"; //!< Message name
691};
692
693/**
694 * @brief FP_A-IMUBIAS (version 1) message payload
695 */
697{ // clang-format off
699 FpaMeasStatus fusion_imu; //!< Fusion measurement status: IMU
700 FpaImuStatus imu_status; //!< IMU bias status
701 FpaImuNoise imu_noise; //!< IMU variance status
702 FpaImuConv imu_conv; //!< IMU convergence status
703 FpaFloat3 bias_acc; //!< Accelerometer bias, X/Y/Z components
704 FpaFloat3 bias_gyr; //!< Gyroscope bias, X/Y/Z components
705 FpaFloat3 bias_cov_acc; //!< Accelerometer bias covariance, X/Y/Z components
706 FpaFloat3 bias_cov_gyr; //!< Gyroscope bias covariance, X/Y/Z components
707 // clang-format on
708
709 bool SetFromMsg(const uint8_t* msg, const std::size_t msg_size) final;
710
711 static constexpr const char* MSG_NAME = "FP_A-IMUBIAS"; //!< Message name
712};
713
714/**
715 * @brief FP_A-LLH (version 1) message payload
716 */
718{ // clang-format off
720 FpaFloat3 llh; //!< Latitude/longitude/height [deg, deg, m]
721 FpaFloat6 cov_enu; //!< Position covariance in ENU, EE/NN/UU/EN/NU/EU components [m^2]
722 // clang-format on
723
724 bool SetFromMsg(const uint8_t* msg, const std::size_t msg_size) final;
725
726 static constexpr const char* MSG_NAME = "FP_A-LLH"; //!< Message name
727};
728
729/**
730 * @brief FP_A-ODOM... (version 1) messages payload
731 */
733{
734 //! Data from which FP_A-...IMU is stored
735 enum class Which
736 {
737 UNSPECIFIED, //!< Unspecified
738 ODOMETRY, //!< Data is from FP_A-ODOMETRY
739 ODOMENU, //!< Data is from FP_A-ODOMENU
740 ODOMSH, //!< Data is from FP_A-ODOMSH
741 };
742 // clang-format off
743 Which which = Which::UNSPECIFIED; //!< Indicates from which message the data is
745 FpaFloat3 pos; //!< Position, X/Y/Z components
746 FpaFloat4 orientation; //!< Quaternion, W/X/Y/Z components
747 FpaFloat3 vel; //!< Velocity, X/Y/Z components
748 FpaFloat3 rot; //!< Bias corrected angular velocity, X/Y/Z components
749 FpaFloat3 acc; //!< Bias corrected acceleration, X/Y/Z components
752 FpaGnssFix gnss1_fix; //!< Fix status of GNSS1 receiver
753 FpaGnssFix gnss2_fix; //!< Fix status of GNSS2 receiver
754 FpaWsStatusLegacy wheelspeed_status; //!< Wheelspeed status
755 FpaFloat6 pos_cov; //!< Position covariance, XX/YY/ZZ/XY/YZ/XZ components
756 FpaFloat6 orientation_cov; //!< Orientation covariance, XX/YY/ZZ/XY/YZ/XZ components
757 FpaFloat6 vel_cov; //!< Velocity covariance, XX/YY/ZZ/XY/YZ/XZ components
758 char version[100] = { 0 }; //!< Software version string
759 // clang-format on
760
761 virtual bool SetFromMsg(const uint8_t* msg, const std::size_t msg_size) = 0;
762};
763
764/**
765 * @brief FP_A-ODOMETRY (version 2) messages payload (ECEF)
766 */
768{
769 bool SetFromMsg(const uint8_t* msg, const std::size_t msg_size) final;
770
771 static constexpr const char* MSG_NAME = "FP_A-ODOMETRY"; //!< Message name
772};
773
774/**
775 * @brief FP_A-ODOMENU (version 1) messages payload (ENU0)
776 */
778{
779 bool SetFromMsg(const uint8_t* msg, const std::size_t msg_size) final;
780
781 static constexpr const char* MSG_NAME = "FP_A-ODOMENU"; //!< Message name
782};
783
784/**
785 * @brief FP_A-ODOMSH (version 1) messages payload (ECEF)
786 */
788{
789 bool SetFromMsg(const uint8_t* msg, const std::size_t msg_size) final;
790
791 static constexpr const char* MSG_NAME = "FP_A-ODOMSH"; //!< Message name
792};
793
794/**
795 * @brief FP_A-ODOMSTATUS (version 1) messages payload
796 */
798{ // clang-format off
800 FpaInitStatus init_status; //!< Fusion init status
801 FpaMeasStatus fusion_imu; //!< Fusion measurement status: IMU
802 FpaMeasStatus fusion_gnss1; //!< Fusion measurement status: GNSS 1
803 FpaMeasStatus fusion_gnss2; //!< Fusion measurement status: GNSS 2
804 FpaMeasStatus fusion_corr; //!< Fusion measurement status: GNSS corrections
805 FpaMeasStatus fusion_cam1; //!< Fusion measurement status: camera
806 FpaMeasStatus fusion_ws; //!< Fusion measurement status: wheelspeed
807 FpaMeasStatus fusion_markers; //!< Fusion measurement status: markers
808 FpaImuStatus imu_status; //!< IMU bias status
809 FpaImuNoise imu_noise; //!< IMU variance status
810 FpaImuConv imu_conv; //!< IMU convergence status
811 FpaGnssStatus gnss1_status; //!< GNSS 1 status
812 FpaGnssStatus gnss2_status; //!< GNSS 2 status
813 FpaBaselineStatus baseline_status; //!< Baseline status
814 FpaCorrStatus corr_status; //!< GNSS correction status
815 FpaCamStatus cam1_status; //!< Camera 1 status
816 FpaWsStatus ws_status; //!< Wheelspeed status
817 FpaWsConv ws_conv; //!< Wheelspeed convergence status
819 FpaMarkersConv markers_conv; //!< Marker convergence status
820 // clang-format on
821
822 bool SetFromMsg(const uint8_t* msg, const std::size_t msg_size) final;
823
824 static constexpr const char* MSG_NAME = "FP_A-ODOMSTATUS"; //!< Message name
825};
826
827/**
828 * @brief FP_A-TEXT (version 1) message payload
829 */
831{ // clang-format off
832 FpaTextLevel level; //!< Level
833 char text[MAX_FP_A_SIZE] = { 0 }; //!< Text (nul-terminated string)
834 // clang-format on
835
836 bool SetFromMsg(const uint8_t* msg, const std::size_t msg_size) final;
837
838 static constexpr const char* MSG_NAME = "FP_A-TEXT"; //!< Message name
839};
840
841/**
842 * @brief FP_A-TF (version 2) message payload
843 */
845{ // clang-format off
847 char frame_a[10] = { 0 }; //!< Target frame (nul-terminated string)
848 char frame_b[10] = { 0 }; //!< Initial frame (nul-terminated string)
849 FpaFloat3 translation; //!< Translation, X/Y/Z components
850 FpaFloat4 orientation; //!< Rotation in quaternion, W/X/Y/Z components
851 // clang-format on
852
853 bool SetFromMsg(const uint8_t* msg, const std::size_t msg_size) final;
854
855 static constexpr const char* MSG_NAME = "FP_A-TF"; //!< Message name
856};
857
858/**
859 * @brief FP_A-TP (versions 1 and 2) message payload
860 */
862{ // clang-format off
863 char tp_name[10] = { 0 }; //!< Timepulse name (nul-terminated string)
866 FpaInt tp_week; //!< Timepulse week number (only since version 2 of the message)
867 FpaInt tp_tow_sec; //!< Timepulse time seconds of week, integer second part (0--604799)
868 FpaFloat tp_tow_psec; //!< Timepulse time seconds of week, sub-second part (0.000000000000--0.999999999999)
869 FpaInt gps_leaps; //!< GPS leapseconds
870 // clang-format on
871
872 bool SetFromMsg(const uint8_t* msg, const std::size_t msg_size) final;
873
874 static constexpr const char* MSG_NAME = "FP_A-TP"; //!< Message name
875};
876
877/**
878 * @brief FP_A-VERSION (version 1) message payload
879 */
881{ // clang-format off
882 char sw_version[100] = { 0 }; //!< Software version string
883 char hw_name[100] = { 0 }; //!< Hardware name
884 char hw_ver[100] = { 0 }; //!< Hardware version string
885 char hw_uid[100] = { 0 }; //!< Hardware UID
886 char product_model[100] = { 0 }; //!< Product model
887 // clang-format on
888
889 bool SetFromMsg(const uint8_t* msg, const std::size_t msg_size) final;
890
891 static constexpr const char* MSG_NAME = "FP_A-VERSION"; //!< Message name
892};
893
894// ---------------------------------------------------------------------------------------------------------------------
895
896//! Pointer to FP_A payload
897using FpaPayloadPtr = std::unique_ptr<FpaPayload>;
898
899/**
900 * @brief Decode FP_A message
901 *
902 * @param[in] msg Pointer to the FP_A message
903 * @param[in] msg_size Size of the FP_A message (>= 11)
904 *
905 * @returns an instance of the decoded payload on success, nullptr otherwise (bad or unknown message)
906 */
907FpaPayloadPtr FpaDecodeMessage(const uint8_t* msg, const std::size_t msg_size);
908
909/**
910 * @brief Decode FP_A message
911 *
912 * @param[in] msg The FP_A message data
913 *
914 * @returns an instance of the decoded payload on success, nullptr otherwise (bad or unknown message)
915 */
916inline FpaPayloadPtr FpaDecodeMessage(const std::vector<uint8_t>& msg)
917{
918 return FpaDecodeMessage(msg.data(), msg.size());
919}
920
921/* ****************************************************************************************************************** */
922} // namespace fpa
923} // namespace parser
924} // namespace common
925} // namespace fpsdk
926#endif // __FPSDK_COMMON_PARSER_FPA_HPP__
Fixposition SDK: Logging.
@ WARNING
[4/warning] Warnings (for libs and apps)
Definition logging.hpp:202
@ INFO
[6/info] Interesting stuff, the default level (for apps)
Definition logging.hpp:204
@ ERROR
[3/err] Errors (for apps)
Definition logging.hpp:201
@ DEBUG
[7/debug] Debugging (for libs and apps)
Definition logging.hpp:205
Parser FP_A routines and types.
Definition fpa.hpp:98
FpaEpoch
FP_A epoch type.
Definition fpa.hpp:393
FpaGnssStatus
FP_A GNSS fix status.
Definition fpa.hpp:250
@ SPP
Single-point positioning (SPP)
Definition fpa.hpp:253
FpaCorrStatus
FP_A GNSS correction status.
Definition fpa.hpp:268
@ OLD_CORR
Corrections are too old (TBD)
Definition fpa.hpp:274
@ GOOD_CORR
Sufficient corrections used: station data and corrections for ALL bands among the valid rover measure...
Definition fpa.hpp:275
@ LIMITED_CORR
Limited corrections used: station data & at least one of the constellations (both bands) among the va...
Definition fpa.hpp:273
FpaTimeref
FP_A time reference.
Definition fpa.hpp:457
@ OTHER
other/unknown GNSS/UTC
Definition fpa.hpp:472
@ UTC_NTSC
UTC: National Time Service Center (NTSC), China.
Definition fpa.hpp:466
@ UTC_EU
UTC: European laboratories.
Definition fpa.hpp:464
@ UTC_NONE
UTC: None (UTC params not yet known)
Definition fpa.hpp:459
@ UTC_USNO
UTC: U.S. Naval Observatory (USNO)
Definition fpa.hpp:462
@ UTC_CRL
UTC: Communications Research Laboratory (CRL), Japan.
Definition fpa.hpp:460
@ UTC_BIPM
UTC: International Bureau of Weights and Measures (BIPM)
Definition fpa.hpp:463
@ UTC_SU
UTC: Former Soviet Union (SU)
Definition fpa.hpp:465
@ UTC_NIST
UTC: National Institute of Standards and Technology (NIST)
Definition fpa.hpp:461
const char * FpaEpochStr(const FpaEpoch epoch)
Stringify epoch type.
FpaTextLevel
FP_A text levels.
Definition fpa.hpp:435
FpaAntPower
FP_A GNSS antenna power.
Definition fpa.hpp:425
@ OFF
Antenna power supply is off.
Definition fpa.hpp:428
@ ON
Antenna power supply is on.
Definition fpa.hpp:427
static constexpr int FP_A_FRAME_SIZE
FP_A frame size ("$*cc\r\n")
Definition fpa.hpp:102
FpaMeasStatus
FP_A fusion measurement status.
Definition fpa.hpp:186
FpaBaselineStatus
FP_A baseline status.
Definition fpa.hpp:286
bool FpaGetMessageMeta(FpaMessageMeta &meta, const uint8_t *msg, const std::size_t msg_size)
Get FP_A message meta data.
FpaWsStatus
FP_A wheelspeed status.
Definition fpa.hpp:312
@ MISS_MEAS
Missing wheelspeed measurements.
Definition fpa.hpp:315
@ ALL_CONVERGED
At least one wheelspeed enabled and all converged.
Definition fpa.hpp:318
@ NONE_CONVERGED
At least one wheelspeed enabled, no wheelspeed converged.
Definition fpa.hpp:316
@ ONE_CONVERGED
At least one wheelspeed enabled and at least one converged.
Definition fpa.hpp:317
@ NOT_ENABLED
No wheelspeed enabled.
Definition fpa.hpp:314
FpaPayloadPtr FpaDecodeMessage(const uint8_t *msg, const std::size_t msg_size)
Decode FP_A message.
FpaGnssFix
FP_A GNSS fix type.
Definition fpa.hpp:376
@ DRONLY
Dead-reckoning only.
Definition fpa.hpp:380
@ S3D_DR
Single 3D fix with dead-reckoning.
Definition fpa.hpp:384
static constexpr uint8_t FP_A_PREAMBLE
FP_A framing preamble.
Definition fpa.hpp:101
FpaFusionStatusLegacy
FP_A legacy fusion status.
Definition fpa.hpp:173
@ VIO_GNSS
Visual-inertial-GNSS fusion.
Definition fpa.hpp:179
FpaMarkersConv
FP_A markers convergence status.
Definition fpa.hpp:363
@ WAIT_MARKER_MEAS
Waiting marker measurements.
Definition fpa.hpp:366
FpaImuNoise
FP_A IMU variance.
Definition fpa.hpp:219
FpaCamStatus
FP_A camera status.
Definition fpa.hpp:298
@ GOOD
Camera working and available.
Definition fpa.hpp:305
@ CAM_UNAVL
Camera not available.
Definition fpa.hpp:300
@ BAD_FEAT
Camera available, but not usable (e.g. too dark)
Definition fpa.hpp:301
FpaWsConv
FP_A wheelspeed convergence status.
Definition fpa.hpp:336
@ WAIT_IMU_BIAS
Insufficient imu bias convergence.
Definition fpa.hpp:342
@ WAIT_WS_MEAS
Missing wheelspeed measurements.
Definition fpa.hpp:339
FpaMarkersStatus
FP_A markers status.
Definition fpa.hpp:351
FpaImuStatus
FP_A IMU bias status.
Definition fpa.hpp:197
@ ROUGH_CONVERGED
Rough convergence.
Definition fpa.hpp:201
FpaInitStatus
FP_A fusion initialisation status.
Definition fpa.hpp:162
@ GLOBAL_INIT
Globally initialised.
Definition fpa.hpp:166
@ LOCAL_INIT
Locally initialised.
Definition fpa.hpp:165
FpaImuStatusLegacy
FP_A Legacy IMU bias status.
Definition fpa.hpp:209
bool FpaGetMessageInfo(char *info, const std::size_t size, const uint8_t *msg, const std::size_t msg_size)
Get FP_A message info.
FpaAntState
FP_A GNSS antenna state.
Definition fpa.hpp:414
@ SHORT
Antenna short circuit detected.
Definition fpa.hpp:418
@ OPEN
No antenna detected (or connected via DC block)
Definition fpa.hpp:416
@ OK
Antenna detected and good.
Definition fpa.hpp:417
FpaTimebase
FP_A time base.
Definition fpa.hpp:446
bool FpaGetMessageName(char *name, const std::size_t size, const uint8_t *msg, const std::size_t msg_size)
Get FP_A message name.
FpaMessageType
FP_A message types.
Definition fpa.hpp:540
@ ODOMSTATUS
FpaOdomstatusPayload.
Definition fpa.hpp:552
std::unique_ptr< FpaPayload > FpaPayloadPtr
Pointer to FP_A payload.
Definition fpa.hpp:897
FpaImuConv
FP_A IMU accelerometer and gyroscope convergence.
Definition fpa.hpp:234
@ WAIT_IMU_MEAS
Awaiting IMU measurements.
Definition fpa.hpp:237
@ WAIT_GLOBAL_MEAS
Insufficient global measurements.
Definition fpa.hpp:238
@ WAIT_MOTION
Insufficient motion.
Definition fpa.hpp:239
FpaWsStatusLegacy
FP_A Legacy wheelspeed status.
Definition fpa.hpp:325
@ ONE_OR_MORE_CONVERGED
At least one converged.
Definition fpa.hpp:329
static constexpr std::size_t MAX_FP_A_SIZE
Maximum FP_A message size (must be the same as MAX_NMEA_SIZE)
Definition types.hpp:170
constexpr std::underlying_type< T >::type EnumToVal(T enum_val)
Convert enum class constant to the underlying integral type value.
Definition types.hpp:47
Fixposition SDK: Common library.
Definition doc.hpp:21
Fixposition SDK.
Fixposition SDK: Parser.
FP_A-CORRIMU (version 1) message payload.
Definition fpa.hpp:687
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size) final
Set data from message.
static constexpr const char * MSG_NAME
Message name.
Definition fpa.hpp:690
FP_A-EOE (version 1) message payload.
Definition fpa.hpp:597
static constexpr const char * MSG_NAME
Message name.
Definition fpa.hpp:603
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size) final
Set data from message.
FpaEpoch epoch
Indicates which epoch ended ("FUSION", "GNSS", "GNSS1", "GNSS2")
Definition fpa.hpp:599
FP_A three float values.
Definition fpa.hpp:497
std::array< double, 3 > values
Values.
Definition fpa.hpp:499
FP_A four float values.
Definition fpa.hpp:506
std::array< double, 4 > values
Values.
Definition fpa.hpp:508
FP_A six float values.
Definition fpa.hpp:515
std::array< double, 6 > values
Values.
Definition fpa.hpp:517
FP_A-GNSSANT (version 1) message payload.
Definition fpa.hpp:610
FpaAntPower gnss1_power
GNSS1 antenna power.
Definition fpa.hpp:613
static constexpr const char * MSG_NAME
Message name.
Definition fpa.hpp:622
FpaAntPower gnss2_power
GNSS2 antenna power.
Definition fpa.hpp:616
FpaAntState gnss2_state
GNSS2 antenna state.
Definition fpa.hpp:615
FpaInt gnss1_age
Time since gnss1_state or gnss1_power information last changed, 0-604800.
Definition fpa.hpp:614
FpaAntState gnss1_state
GNSS1 antenna state.
Definition fpa.hpp:612
FpaInt gnss2_age
Time since gnss2_state or gnss2_power information last changed, 0-604800.
Definition fpa.hpp:617
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size) final
Set data from message.
FP_A-GNSSCORR (version 1) message payload.
Definition fpa.hpp:629
FpaGnssFix gnss1_fix
Fix status of GNSS1.
Definition fpa.hpp:631
static constexpr const char * MSG_NAME
Message name.
Definition fpa.hpp:648
FpaInt gnss2_nsig_l1
Number of L1 signals with correction data tracked by GNSS2 receiver, range 0-100.
Definition fpa.hpp:635
FpaFloat corr_latency
Average correction data latency (10s window), range 0.0-99.9.
Definition fpa.hpp:637
FpaInt gnss1_nsig_l1
Number of L1 signals with correction data tracked by GNSS1 receiver, range 0-100.
Definition fpa.hpp:632
FpaInt sta_dist
Correction station baseline length (approximate 3d distance), range 0-100000.
Definition fpa.hpp:643
FpaInt gnss2_nsig_l2
Number of L2 signals with correction data tracked by GNSS2 receiver, range 0-100.
Definition fpa.hpp:636
FpaInt gnss1_nsig_l2
Number of L2 signals with correction data tracked by GNSS1 receiver, range 0-100.
Definition fpa.hpp:633
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size) final
Set data from message.
FpaInt sta_id
Correction station ID, range 0–4095.
Definition fpa.hpp:641
FpaFloat corr_msg_rate
Average correction message rate (10s window), range 0-50.
Definition fpa.hpp:640
FpaFloat3 sta_llh
Correction station latitude/longitude/height [deg, deg, m].
Definition fpa.hpp:642
FpaFloat corr_update_rate
Average correction update rate (10s window), range 0.0-0.0.
Definition fpa.hpp:638
FpaGnssFix gnss2_fix
Fix status of GNSS2 receiver.
Definition fpa.hpp:634
FpaFloat corr_data_rate
Average correction data rate (10s window), range 0.0-50.0.
Definition fpa.hpp:639
FpaInt week
GPS week number, range 0-9999, or null if time not (yet) available.
Definition fpa.hpp:525
bool operator!=(const FpaGpsTime &rhs) const
Not equal (epsilon = 1e-6)
bool operator>=(const FpaGpsTime &rhs) const
Greater or equal than.
bool operator==(const FpaGpsTime &rhs) const
Equal (epsilon = 1e-6)
bool operator<=(const FpaGpsTime &rhs) const
Less or equal than.
bool operator<(const FpaGpsTime &rhs) const
Less than.
bool operator>(const FpaGpsTime &rhs) const
Greater than.
FpaFloat tow
GPS time of week, range 0.000-604799.999999, or null if time not (yet) available.
Definition fpa.hpp:526
FP_A-...IMU (versions 1 and 2) messages payload.
Definition fpa.hpp:655
FpaImuStatus imu_status
IMU bias status (only available for version 2 messages)
Definition fpa.hpp:669
Which which
Indicates from which message the data is.
Definition fpa.hpp:663
bool bias_comp
Signal is bias compensated (true) or not (false), always false for RAWIMU, may be true for CORRIMU.
Definition fpa.hpp:668
FpaFloat3 acc
Raw acceleration in output frame, X/Y/Z components.
Definition fpa.hpp:666
FpaFloat3 rot
Raw angular velocity in output frame, X/Y/Z components.
Definition fpa.hpp:667
Which
Data from which FP_A-...IMU is stored.
Definition fpa.hpp:658
@ CORRIMU
Data is from FP_A-CORRIMU.
Definition fpa.hpp:661
FP_A-IMUBIAS (version 1) message payload.
Definition fpa.hpp:697
FpaImuStatus imu_status
IMU bias status.
Definition fpa.hpp:700
FpaMeasStatus fusion_imu
Fusion measurement status: IMU.
Definition fpa.hpp:699
FpaFloat3 bias_cov_acc
Accelerometer bias covariance, X/Y/Z components.
Definition fpa.hpp:705
FpaFloat3 bias_cov_gyr
Gyroscope bias covariance, X/Y/Z components.
Definition fpa.hpp:706
FpaFloat3 bias_gyr
Gyroscope bias, X/Y/Z components.
Definition fpa.hpp:704
FpaImuConv imu_conv
IMU convergence status.
Definition fpa.hpp:702
FpaImuNoise imu_noise
IMU variance status.
Definition fpa.hpp:701
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size) final
Set data from message.
FpaFloat3 bias_acc
Accelerometer bias, X/Y/Z components.
Definition fpa.hpp:703
static constexpr const char * MSG_NAME
Message name.
Definition fpa.hpp:711
FP_A integer value.
Definition fpa.hpp:479
bool valid
Data is valid.
Definition fpa.hpp:480
FP_A-LLH (version 1) message payload.
Definition fpa.hpp:718
FpaFloat3 llh
Latitude/longitude/height [deg, deg, m].
Definition fpa.hpp:720
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size) final
Set data from message.
static constexpr const char * MSG_NAME
Message name.
Definition fpa.hpp:726
FpaFloat6 cov_enu
Position covariance in ENU, EE/NN/UU/EN/NU/EU components [m^2].
Definition fpa.hpp:721
char msg_type_[40]
Message type (for example, "ODOMETRY"), nul-terminated string.
Definition fpa.hpp:107
int msg_version_
Message version (for example, 1), < 0 if unknown.
Definition fpa.hpp:108
int payload_ix1_
Index (offset) for end of payload, 0 if no payload available.
Definition fpa.hpp:110
int payload_ix0_
Index (offset) for start of payload, 0 if no payload available.
Definition fpa.hpp:109
FP_A-ODOM... (version 1) messages payload.
Definition fpa.hpp:733
Which
Data from which FP_A-...IMU is stored.
Definition fpa.hpp:736
@ ODOMETRY
Data is from FP_A-ODOMETRY.
Definition fpa.hpp:738
@ ODOMENU
Data is from FP_A-ODOMENU.
Definition fpa.hpp:739
FpaFusionStatusLegacy fusion_status
Fustion status.
Definition fpa.hpp:750
FpaWsStatusLegacy wheelspeed_status
Wheelspeed status.
Definition fpa.hpp:754
Which which
Indicates from which message the data is.
Definition fpa.hpp:743
virtual bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size)=0
Set data from message.
FpaGnssFix gnss2_fix
Fix status of GNSS2 receiver.
Definition fpa.hpp:753
FpaFloat6 vel_cov
Velocity covariance, XX/YY/ZZ/XY/YZ/XZ components.
Definition fpa.hpp:757
FpaGnssFix gnss1_fix
Fix status of GNSS1 receiver.
Definition fpa.hpp:752
FpaFloat3 vel
Velocity, X/Y/Z components.
Definition fpa.hpp:747
FpaImuStatusLegacy imu_bias_status
IMU bias status.
Definition fpa.hpp:751
FpaFloat6 orientation_cov
Orientation covariance, XX/YY/ZZ/XY/YZ/XZ components.
Definition fpa.hpp:756
char version[100]
Software version string.
Definition fpa.hpp:758
FpaFloat3 acc
Bias corrected acceleration, X/Y/Z components.
Definition fpa.hpp:749
FpaFloat3 pos
Position, X/Y/Z components.
Definition fpa.hpp:745
FpaFloat6 pos_cov
Position covariance, XX/YY/ZZ/XY/YZ/XZ components.
Definition fpa.hpp:755
FpaFloat3 rot
Bias corrected angular velocity, X/Y/Z components.
Definition fpa.hpp:748
FpaFloat4 orientation
Quaternion, W/X/Y/Z components.
Definition fpa.hpp:746
FP_A-ODOMENU (version 1) messages payload (ENU0)
Definition fpa.hpp:778
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size) final
Set data from message.
static constexpr const char * MSG_NAME
Message name.
Definition fpa.hpp:781
FP_A-ODOMETRY (version 2) messages payload (ECEF)
Definition fpa.hpp:768
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size) final
Set data from message.
static constexpr const char * MSG_NAME
Message name.
Definition fpa.hpp:771
FP_A-ODOMSH (version 1) messages payload (ECEF)
Definition fpa.hpp:788
static constexpr const char * MSG_NAME
Message name.
Definition fpa.hpp:791
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size) final
Set data from message.
FP_A-ODOMSTATUS (version 1) messages payload.
Definition fpa.hpp:798
FpaWsStatus ws_status
Wheelspeed status.
Definition fpa.hpp:816
FpaMarkersConv markers_conv
Marker convergence status.
Definition fpa.hpp:819
FpaImuConv imu_conv
IMU convergence status.
Definition fpa.hpp:810
FpaMarkersStatus markers_status
Marker status.
Definition fpa.hpp:818
FpaGnssStatus gnss1_status
GNSS 1 status.
Definition fpa.hpp:811
FpaMeasStatus fusion_gnss1
Fusion measurement status: GNSS 1.
Definition fpa.hpp:802
FpaMeasStatus fusion_gnss2
Fusion measurement status: GNSS 2.
Definition fpa.hpp:803
static constexpr const char * MSG_NAME
Message name.
Definition fpa.hpp:824
FpaImuNoise imu_noise
IMU variance status.
Definition fpa.hpp:809
FpaBaselineStatus baseline_status
Baseline status.
Definition fpa.hpp:813
FpaInitStatus init_status
Fusion init status.
Definition fpa.hpp:800
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size) final
Set data from message.
FpaMeasStatus fusion_imu
Fusion measurement status: IMU.
Definition fpa.hpp:801
FpaWsConv ws_conv
Wheelspeed convergence status.
Definition fpa.hpp:817
FpaMeasStatus fusion_cam1
Fusion measurement status: camera.
Definition fpa.hpp:805
FpaCamStatus cam1_status
Camera 1 status.
Definition fpa.hpp:815
FpaMeasStatus fusion_ws
Fusion measurement status: wheelspeed.
Definition fpa.hpp:806
FpaCorrStatus corr_status
GNSS correction status.
Definition fpa.hpp:814
FpaMeasStatus fusion_markers
Fusion measurement status: markers.
Definition fpa.hpp:807
FpaImuStatus imu_status
IMU bias status.
Definition fpa.hpp:808
FpaGnssStatus gnss2_status
GNSS 2 status.
Definition fpa.hpp:812
FpaMeasStatus fusion_corr
Fusion measurement status: GNSS corrections.
Definition fpa.hpp:804
FP_A payload base class.
Definition fpa.hpp:563
bool SetFromBuf(const std::vector< uint8_t > &buf)
Set data from message.
Definition fpa.hpp:587
bool valid_
Payload successfully decoded (true), or not (yet) decoded (false)
Definition fpa.hpp:564
virtual ~FpaPayload()=default
Virtual dtor for polymorphism.
virtual bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size)=0
Set data from message.
FpaMessageType msg_type_
Message (payload) type.
Definition fpa.hpp:565
FP_A-RAWIMU (version 1) message payload.
Definition fpa.hpp:677
static constexpr const char * MSG_NAME
Message name.
Definition fpa.hpp:680
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size) final
Set data from message.
FP_A-TEXT (version 1) message payload.
Definition fpa.hpp:831
char text[MAX_FP_A_SIZE]
Text (nul-terminated string)
Definition fpa.hpp:833
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size) final
Set data from message.
static constexpr const char * MSG_NAME
Message name.
Definition fpa.hpp:838
FP_A-TF (version 2) message payload.
Definition fpa.hpp:845
static constexpr const char * MSG_NAME
Message name.
Definition fpa.hpp:855
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size) final
Set data from message.
char frame_b[10]
Initial frame (nul-terminated string)
Definition fpa.hpp:848
FpaFloat4 orientation
Rotation in quaternion, W/X/Y/Z components.
Definition fpa.hpp:850
char frame_a[10]
Target frame (nul-terminated string)
Definition fpa.hpp:847
FpaFloat3 translation
Translation, X/Y/Z components.
Definition fpa.hpp:849
FP_A-TP (versions 1 and 2) message payload.
Definition fpa.hpp:862
FpaInt tp_tow_sec
Timepulse time seconds of week, integer second part (0–604799)
Definition fpa.hpp:867
FpaTimebase timebase
Time base.
Definition fpa.hpp:864
FpaInt tp_week
Timepulse week number (only since version 2 of the message)
Definition fpa.hpp:866
static constexpr const char * MSG_NAME
Message name.
Definition fpa.hpp:874
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size) final
Set data from message.
FpaTimeref timeref
Time reference.
Definition fpa.hpp:865
FpaFloat tp_tow_psec
Timepulse time seconds of week, sub-second part (0.000000000000–0.999999999999)
Definition fpa.hpp:868
FpaInt gps_leaps
GPS leapseconds.
Definition fpa.hpp:869
char tp_name[10]
Timepulse name (nul-terminated string)
Definition fpa.hpp:863
FP_A-VERSION (version 1) message payload.
Definition fpa.hpp:881
char sw_version[100]
Software version string.
Definition fpa.hpp:882
char hw_ver[100]
Hardware version string.
Definition fpa.hpp:884
static constexpr const char * MSG_NAME
Message name.
Definition fpa.hpp:891
bool SetFromMsg(const uint8_t *msg, const std::size_t msg_size) final
Set data from message.
char product_model[100]
Product model.
Definition fpa.hpp:886
Fixposition SDK: Common types and type helpers.