0.4.1
Loading...
Searching...
No Matches
EmlidTypes.hpp
Go to the documentation of this file.
1// This file is part of INSTINCT, the INS Toolkit for Integrated
2// Navigation Concepts and Training by the Institute of Navigation of
3// the University of Stuttgart, Germany.
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9/// @file EmlidTypes.hpp
10/// @brief Type Definitions for Emlid messages for Emlid Reach M2 ER Protocol
11/// @author T. Topp (topp@ins.uni-stuttgart.de)
12/// @date 2020-06-23
13
14#pragma once
15
16#include <string>
17#include <array>
18#include <optional>
19#include <bitset>
20#include <vector>
21#include <cstdint>
22
24{
25/// @brief Error detection modes available
26enum ErrorDetectionMode : uint8_t
27{
28 ERRORDETECTIONMODE_NONE, ///< No error detection is used
29 ERRORDETECTIONMODE_CHECKSUM, ///< 16-bit checksum is used
30};
31
32/// @brief The available ERB Message IDs
33enum ErbMessageID : uint8_t
34{
35 ERB_MessageId_NONE = 0x00, ///< No Message Class specified
36 ERB_MessageId_VER = 0x01, ///< Version of protocol
37 ERB_MessageId_POS = 0x02, ///< Geodetic position solution
38 ERB_MessageId_STAT = 0x03, ///< Receiver navigation status
39 ERB_MessageId_DPOS = 0x04, ///< Dilution of precision
40 ERB_MessageId_VEL = 0x05, ///< Velocity solution in NED
41 ERB_MessageId_SVI = 0x06, ///< Space vehicle information
42 ERB_MessageId_RTK = 0x07, ///< RTK information
43};
44
45/// @brief Version of Protocol
46///
47/// This message contains version of the ERB protocol.
48/// It comprises 3 numbers: high level of version,
49/// medium level of version and low level of version. Full version of protocol looks as follows:
50/// [High level].[Medium level].[Low level]
51/// For example 1.2.3, where:
52/// 1 - high level of version (verH)
53/// 2 - medium level of version (verM)
54/// 3 - low level of version (verL)
55struct ErbVer
56{
57 uint32_t iTOW = 0; ///< GPS time of week of the navigation epoch [ms]. See the description of iTOW for details.
58 uint8_t verH = 0; ///< High level of version
59 uint8_t verM = 0; ///< Medium level of version
60 uint8_t verL = 0; ///< Low level of version
61};
62
63/// @brief Geodetic Position Solution
64///
65/// This message outputs the geodetic coordinates: longitude, latitude, altitude and information about
66/// accuracy estimate.
67struct ErbPos
68{
69 uint32_t iTOW = 0; ///< GPS time of week of the navigation epoch [ms]. See the description of iTOW for details.
70 double lon = 0.0; ///< Longitude [deg]
71 double lat = 0.0; ///< Latitude [deg]
72 double height = 0.0; ///< Height above ellipsoid [m]
73 double hMSL = 0.0; ///< Height above mean sea level [m]
74 uint32_t hAcc = 0; ///< Horizontal accuracy estimate [mm]
75 uint32_t vAcc = 0; ///< Vertical accuracy estimate [mm]
76};
77
78/// @brief Receiver Navigation Status
79/// This message contains status of Fix, its type and also the number of used satellites
80struct ErbStat
81{
82 uint32_t iTOW = 0; ///< GPS time of week of the navigation epoch [ms]. See the description of iTOW for details.
83 uint16_t weekGPS = 0; ///< GPS week number of the navigation epoch [weeks]
84 uint8_t fixType = 0; ///< GPSfix type: 0x00 - no Fix, 0x01 - Single, 0x02 - Float, 0x03 - RTK Fix
85 uint8_t fixStatus = 0; ///< Navigation Fix Status. If position and velocity are valid 0x01, else 0x00
86 uint8_t numSV = 0; ///< Number of used SVs
87};
88
89/// @brief Dilution of Precision
90/// This message outputs dimensionless values of DOP. These values are scaled by factor 100.
91struct ErbDops
92{
93 uint32_t iTOW = 0; ///< GPS time of week of the navigation epoch [ms]. See the description of iTOW for details.
94 uint16_t dopGeo = 0; ///< Geometric DOP [*0.01]
95 uint16_t dopPos = 0; ///< Position DOP [*0.01]
96 uint16_t dopVer = 0; ///< Vertical DOP [*0.01]
97 uint16_t dopHor = 0; ///< Horizontal DOP [*0.01]
98};
99
100/// @brief Velocity Solution in NED
101/// See important comments concerning validity of position given in section Navigation Output Filters.
102struct ErbVel
103{
104 uint32_t iTOW = 0; ///< GPS time of week of the navigation epoch [ms]. See the description of iTOW for details.
105 int32_t velN = 0; ///< North velocity component [cm/s]
106 int32_t velE = 0; ///< East velocity component [cm/s]
107 int32_t velD = 0; ///< Down velocity component [cm/s]
108 uint32_t speed = 0; ///< Speed (3-D)
109 uint32_t gSpeed = 0; ///< Ground speed (2-D)
110 int32_t heading = 0; ///< Heading of motion 2-D [deg/// 1e-5]
111 uint32_t sAcc = 0; ///< Speed accuracy Estimation [cm/s]
112};
113
114/// @brief Space Vehicle Information
115/// This message output information about observation satellites.
116struct ErbSvi
117{
118 uint32_t iTOW = 0; ///< GPS time of week of the navigation epoch [ms]. See the description of iTOW for details.
119 uint8_t nSV = 0; ///< Number of Satellites
120 uint8_t idSV = 0; ///< Satellite identifier (see Satellite Numbering)
121 uint8_t typeSV = 0; ///< GNSS identifier 0-GPS, 1-GLONASS, 2-Galileo, 3-QZSS, 4-Beidou, 5-LEO, 6-SBAS
122 int32_t carPh = 0; ///< Carrier phase [cycle/// 1e-2]
123 int32_t psRan = 0; ///< Pseudo range residual [m]
124 int32_t freqD = 0; ///< Doppler frequency [Hz/// 1e-3]
125 uint16_t snr = 0; ///< Signal strength [dBhz/// 0.25]
126 uint16_t azim = 0; ///< Azimuth in degrees [deg/// 1e-1]
127 uint16_t elev = 0; ///< Elevation in degrees [deg/// 1e-1]
128};
129
130/// @brief RTK Information
131/// This message output information about RTK
132struct ErbRtk
133{
134 uint8_t numSV = 0; ///< Number of satellites used for RTK calculation
135 uint16_t age = 0; ///< Age of differential [s/// 1e-2] (0 when no corrections, 0xFFFF indicates overflow)
136 int32_t baselineN = 0; ///< Distance between base and rover along the north axis [mm]
137 int32_t baselineE = 0; ///< Distance between base and rover along the east axis [mm]
138 int32_t baselineD = 0; ///< Distance between base and rover along the down axis [mm]
139 uint16_t arRatio = 0; ///< AR Ratio [*1e-1]
140 uint16_t weekGPS = 0; ///< GPS Week Number of last baseline [weeks]
141 uint32_t timeGPS = 0; ///< GPS Time of Week of last baseline [ms]
142};
143
144/// @brief Get the ERB Msg ID From String object
145///
146/// @param[in] idName String of the ERB Class
147/// @return The ERB ID
148[[nodiscard]] ErbMessageID getMsgIdFromString(const std::string& idName);
149
150} // namespace NAV::vendor::emlid
ErbMessageID
The available ERB Message IDs.
@ ERB_MessageId_RTK
RTK information.
@ ERB_MessageId_POS
Geodetic position solution.
@ ERB_MessageId_NONE
No Message Class specified.
@ ERB_MessageId_VEL
Velocity solution in NED.
@ ERB_MessageId_STAT
Receiver navigation status.
@ ERB_MessageId_VER
Version of protocol.
@ ERB_MessageId_SVI
Space vehicle information.
@ ERB_MessageId_DPOS
Dilution of precision.
ErbMessageID getMsgIdFromString(const std::string &idName)
Get the ERB Msg ID From String object.
ErrorDetectionMode
Error detection modes available.
@ ERRORDETECTIONMODE_CHECKSUM
16-bit checksum is used
@ ERRORDETECTIONMODE_NONE
No error detection is used.
Dilution of Precision This message outputs dimensionless values of DOP. These values are scaled by fa...
uint16_t dopVer
Vertical DOP [*0.01].
uint16_t dopPos
Position DOP [*0.01].
uint16_t dopHor
Horizontal DOP [*0.01].
uint32_t iTOW
GPS time of week of the navigation epoch [ms]. See the description of iTOW for details.
uint16_t dopGeo
Geometric DOP [*0.01].
Geodetic Position Solution.
uint32_t iTOW
GPS time of week of the navigation epoch [ms]. See the description of iTOW for details.
double height
Height above ellipsoid [m].
uint32_t vAcc
Vertical accuracy estimate [mm].
double lat
Latitude [deg].
double lon
Longitude [deg].
uint32_t hAcc
Horizontal accuracy estimate [mm].
double hMSL
Height above mean sea level [m].
RTK Information This message output information about RTK.
int32_t baselineN
Distance between base and rover along the north axis [mm].
uint16_t age
Age of differential [s/// 1e-2] (0 when no corrections, 0xFFFF indicates overflow)
uint16_t arRatio
AR Ratio [*1e-1].
int32_t baselineD
Distance between base and rover along the down axis [mm].
uint16_t weekGPS
GPS Week Number of last baseline [weeks].
int32_t baselineE
Distance between base and rover along the east axis [mm].
uint32_t timeGPS
GPS Time of Week of last baseline [ms].
uint8_t numSV
Number of satellites used for RTK calculation.
Receiver Navigation Status This message contains status of Fix, its type and also the number of used ...
uint8_t numSV
Number of used SVs.
uint16_t weekGPS
GPS week number of the navigation epoch [weeks].
uint8_t fixType
GPSfix type: 0x00 - no Fix, 0x01 - Single, 0x02 - Float, 0x03 - RTK Fix.
uint8_t fixStatus
Navigation Fix Status. If position and velocity are valid 0x01, else 0x00.
uint32_t iTOW
GPS time of week of the navigation epoch [ms]. See the description of iTOW for details.
Space Vehicle Information This message output information about observation satellites.
int32_t carPh
Carrier phase [cycle/// 1e-2].
uint16_t azim
Azimuth in degrees [deg/// 1e-1].
int32_t psRan
Pseudo range residual [m].
int32_t freqD
Doppler frequency [Hz/// 1e-3].
uint8_t typeSV
GNSS identifier 0-GPS, 1-GLONASS, 2-Galileo, 3-QZSS, 4-Beidou, 5-LEO, 6-SBAS.
uint8_t nSV
Number of Satellites.
uint8_t idSV
Satellite identifier (see Satellite Numbering)
uint32_t iTOW
GPS time of week of the navigation epoch [ms]. See the description of iTOW for details.
uint16_t snr
Signal strength [dBhz/// 0.25].
uint16_t elev
Elevation in degrees [deg/// 1e-1].
Velocity Solution in NED See important comments concerning validity of position given in section Navi...
int32_t velN
North velocity component [cm/s].
int32_t heading
Heading of motion 2-D [deg/// 1e-5].
uint32_t sAcc
Speed accuracy Estimation [cm/s].
int32_t velD
Down velocity component [cm/s].
uint32_t gSpeed
Ground speed (2-D)
uint32_t iTOW
GPS time of week of the navigation epoch [ms]. See the description of iTOW for details.
uint32_t speed
Speed (3-D)
int32_t velE
East velocity component [cm/s].
Version of Protocol.
uint8_t verL
Low level of version.
uint8_t verM
Medium level of version.
uint32_t iTOW
GPS time of week of the navigation epoch [ms]. See the description of iTOW for details.
uint8_t verH
High level of version.