MRPT  2.0.4
gnss_messages_ascii_nmea.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include "gnss_messages_common.h"
12 
13 namespace mrpt::obs::gnss
14 {
15 // Pragma to ensure we can safely serialize some of these structures
16 #pragma pack(push, 1)
17 
18 /** NMEA datum: GGA. \sa mrpt::obs::CObservationGPS */
20 {
22  /** Static msg type (member expected by templates) */
23  enum
24  {
26  };
28  struct content_t
29  {
30  /** The GPS sensor measured timestamp (in UTC time) */
32  /** The measured latitude, in degrees (North:+ , South:-) */
33  double latitude_degrees{0};
34  /** The measured longitude, in degrees (East:+ , West:-) */
35  double longitude_degrees{0};
36  /** NMEA standard values: 0 = invalid, 1 = GPS fix (SPS), 2 = DGPS fix,
37  * 3 = PPS fix, 4 = Real Time Kinematic, 5 = Float RTK, 6 = estimated
38  * (dead reckoning) (2.3 feature), 7 = Manual input mode, 8 = Simulation
39  * mode */
40  uint8_t fix_quality{0};
41  /** The measured altitude, in meters (A). */
42  double altitude_meters{0};
43  /** Undulation: Difference between the measured altitude and the geoid,
44  * in meters (B). */
45  double geoidal_distance{};
46  /** The measured orthometric altitude, in meters (A)+(B). */
48  /** The corrected (only for TopCon mmGPS) orthometric altitude, in
49  * meters mmGPS(A+B). */
51  /** The number of satelites used to compute this estimation. */
52  uint32_t satellitesUsed{0};
53  /** This states whether to take into account the value in the HDOP
54  * field. */
55  bool thereis_HDOP{false};
56  /** The HDOP (Horizontal Dilution of Precision) as returned by the
57  * sensor. */
58  float HDOP{0};
59 
60  content_t();
61  };
62  /** Message content, accesible by individual fields */
64 
65  void dumpToStream(std::ostream& out) const override; // See docs in base
66 
67  /** Return the geodetic coords as a mrpt::topography::TGeodeticCoords
68  * structure (requires linking against mrpt-topography)
69  * Call as: getAsStruct<TGeodeticCoords>(); */
70  template <class TGEODETICCOORDS>
71  inline TGEODETICCOORDS getOrthoAsStruct() const
72  {
73  return TGEODETICCOORDS(
76  }
77  /** Return the corrected geodetic coords as a
78  * mrpt::topography::TGeodeticCoords structure (requires linking against
79  * mrpt-topography)
80  * Call as: getAsStruct<TGeodeticCoords>(); */
81  template <class TGEODETICCOORDS>
82  inline TGEODETICCOORDS getCorrectedOrthoAsStruct() const
83  {
84  return TGEODETICCOORDS(
87  }
88  /** Return the geodetic coords as a mrpt::topography::TGeodeticCoords
89  * structure (requires linking against mrpt-topography)
90  * Call as: getAsStruct<TGeodeticCoords>(); */
91  template <class TGEODETICCOORDS>
92  inline TGEODETICCOORDS getAsStruct() const
93  {
94  return TGEODETICCOORDS(
97  }
98 
99  bool getAllFieldDescriptions(std::ostream& o) const override;
100  bool getAllFieldValues(std::ostream& o) const override;
101 };
102 
103 /** NMEA datum: GLL. \sa mrpt::obs::CObservationGPS */
105 {
107  /** Static msg type (member expected by templates) */
108  enum
109  {
111  };
113  struct content_t
114  {
115  /** The GPS sensor measured timestamp (in UTC time) */
117  /** The measured latitude, in degrees (North:+ , South:-) */
118  double latitude_degrees{0};
119  /** The measured longitude, in degrees (East:+ , West:-) */
120  double longitude_degrees{0};
121  /** This will be: 'A'=OK or 'V'=void */
122  int8_t validity_char{'V'};
123  content_t();
124  };
125  /** Message content, accesible by individual fields */
127  void dumpToStream(std::ostream& out) const override; // See docs in base
128  bool getAllFieldDescriptions(std::ostream& o) const override;
129  bool getAllFieldValues(std::ostream& o) const override;
130 };
131 
132 /** NMEA datum: RMC. \sa mrpt::obs::CObservationGPS */
134 {
136  /** Static msg type (member expected by templates) */
137  enum
138  {
140  };
142  struct content_t
143  {
144  /** The GPS sensor measured timestamp (in UTC time) */
146  /** This will be: 'A'=OK or 'V'=void */
147  int8_t validity_char{'V'};
148  /** The measured latitude, in degrees (North:+ , South:-) */
149  double latitude_degrees{0};
150  /** The measured longitude, in degrees (East:+ , West:-) */
151  double longitude_degrees{0};
152  /** Measured speed (in knots) */
153  double speed_knots{0};
154  /** Measured speed direction (in degrees) */
155  double direction_degrees{0};
156  /** Date: day (1-31), month (1-12), two-digits year (00-99) */
157  uint8_t date_day{0}, date_month{0}, date_year{0};
158  /** Magnetic variation direction (East:+, West:-) */
159  double magnetic_dir{};
160  /** 'A': Autonomous, 'D': Differential, 'N': Not valid, 'E': Estimated,
161  * 'M': Manual */
162  char positioning_mode{'N'};
163  content_t();
164  };
165  /** Message content, accesible by individual fields */
167 
168  /** Build an MRPT timestamp with the year/month/day of this observation. */
170 
171  void dumpToStream(std::ostream& out) const override; // See docs in base
172  bool getAllFieldDescriptions(std::ostream& o) const override;
173  bool getAllFieldValues(std::ostream& o) const override;
174 };
175 
176 /** NMEA datum: VTG. \sa mrpt::obs::CObservationGPS */
178 {
180  /** Static msg type (member expected by templates) */
181  enum
182  {
184  };
186  struct content_t
187  {
188  /** Degrees */
191  content_t();
192  };
193  /** Message content, accesible by individual fields */
195  void dumpToStream(std::ostream& out) const override; // See docs in base
196  bool getAllFieldDescriptions(std::ostream& o) const override;
197  bool getAllFieldValues(std::ostream& o) const override;
198 };
199 
200 /** NMEA datum: GSA. \sa mrpt::obs::CObservationGPS */
202 {
204  /** Static msg type (member expected by templates) */
205  enum
206  {
208  };
210  struct content_t
211  {
212  char auto_selection_fix = 'M';
213  char fix_2D_3D = '1'; //!< 1: no fix, 2: 2D fix, 3: 3D fix
214  char PRNs[12][2]; //!< Satellite IDs used
215  double PDOP = 0, HDOP = 0, VDOP = 0;
216  content_t();
217  };
218  /** Message content, accesible by individual fields */
220 
221  void dumpToStream(std::ostream& out) const override; // See docs in base
222  bool getAllFieldDescriptions(std::ostream& o) const override;
223  bool getAllFieldValues(std::ostream& o) const override;
224 };
225 
226 /** NMEA datum: ZDA. \sa mrpt::obs::CObservationGPS */
228 {
230  /** Static msg type (member expected by templates) */
231  enum
232  {
234  };
236  struct content_t
237  {
238  /** The GPS sensor measured timestamp (in UTC time) */
240  /** 1-31 */
241  uint8_t date_day{};
242  /** 1-12 */
243  uint8_t date_month{};
244  /** 2000-... */
245  uint16_t date_year{};
246  content_t();
247  };
248  /** Message content, accesible by individual fields */
250 
251  /** Build an MRPT UTC timestamp with the year/month/day + hour/minute/sec of
252  * this observation. */
254  /** Build an MRPT timestamp with the year/month/day of this observation. */
256 
257  void dumpToStream(std::ostream& out) const override; // See docs in base
258  bool getAllFieldDescriptions(std::ostream& o) const override;
259  bool getAllFieldValues(std::ostream& o) const override;
260 };
261 #pragma pack(pop) // End of pack = 1
262 } // namespace mrpt::obs::gnss
void dumpToStream(std::ostream &out) const override
Dumps the contents of the observation in a human-readable form to a given output stream.
double longitude_degrees
The measured longitude, in degrees (East:+ , West:-)
uint8_t fix_quality
NMEA standard values: 0 = invalid, 1 = GPS fix (SPS), 2 = DGPS fix, 3 = PPS fix, 4 = Real Time Kinema...
content_t fields
Message content, accesible by individual fields.
bool getAllFieldValues(std::ostream &o) const override
double latitude_degrees
The measured latitude, in degrees (North:+ , South:-)
double longitude_degrees
The measured longitude, in degrees (East:+ , West:-)
bool getAllFieldValues(std::ostream &o) const override
double latitude_degrees
The measured latitude, in degrees (North:+ , South:-)
UTC (Coordinated Universal Time) time-stamp structure for GPS messages.
gnss_message_type_t
List of all known GNSS message types.
content_t fields
Message content, accesible by individual fields.
content_t fields
Message content, accesible by individual fields.
uint32_t satellitesUsed
The number of satelites used to compute this estimation.
char fix_2D_3D
1: no fix, 2: 2D fix, 3: 3D fix
bool getAllFieldDescriptions(std::ostream &o) const override
content_t fields
Message content, accesible by individual fields.
UTC_time UTCTime
The GPS sensor measured timestamp (in UTC time)
int8_t validity_char
This will be: &#39;A&#39;=OK or &#39;V&#39;=void.
UTC_time UTCTime
The GPS sensor measured timestamp (in UTC time)
double orthometric_altitude
The measured orthometric altitude, in meters (A)+(B).
bool getAllFieldValues(std::ostream &o) const override
bool getAllFieldDescriptions(std::ostream &o) const override
mrpt::Clock::time_point TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
Definition: datetime.h:40
double altitude_meters
The measured altitude, in meters (A).
bool thereis_HDOP
This states whether to take into account the value in the HDOP field.
UTC_time UTCTime
The GPS sensor measured timestamp (in UTC time)
double corrected_orthometric_altitude
The corrected (only for TopCon mmGPS) orthometric altitude, in meters mmGPS(A+B). ...
TGEODETICCOORDS getCorrectedOrthoAsStruct() const
Return the corrected geodetic coords as a mrpt::topography::TGeodeticCoords structure (requires linki...
#define GNSS_MESSAGE_BINARY_BLOCK(DATA_PTR, DATA_LEN)
mrpt::system::TTimeStamp getDateAsTimestamp() const
Build an MRPT timestamp with the year/month/day of this observation.
bool getAllFieldDescriptions(std::ostream &o) const override
uint8_t date_day
Date: day (1-31), month (1-12), two-digits year (00-99)
content_t fields
Message content, accesible by individual fields.
float HDOP
The HDOP (Horizontal Dilution of Precision) as returned by the sensor.
void dumpToStream(std::ostream &out) const override
Dumps the contents of the observation in a human-readable form to a given output stream.
double longitude_degrees
The measured longitude, in degrees (East:+ , West:-)
bool getAllFieldValues(std::ostream &o) const override
bool getAllFieldValues(std::ostream &o) const override
TGEODETICCOORDS getOrthoAsStruct() const
Return the geodetic coords as a mrpt::topography::TGeodeticCoords structure (requires linking against...
bool getAllFieldDescriptions(std::ostream &o) const override
GNSS (GPS) data structures, mainly for use within mrpt::obs::CObservationGPS.
void dumpToStream(std::ostream &out) const override
Dumps the contents of the observation in a human-readable form to a given output stream.
double geoidal_distance
Undulation: Difference between the measured altitude and the geoid, in meters (B).
double magnetic_dir
Magnetic variation direction (East:+, West:-)
mrpt::system::TTimeStamp getDateAsTimestamp() const
Build an MRPT timestamp with the year/month/day of this observation.
mrpt::system::TTimeStamp getDateTimeAsTimestamp() const
Build an MRPT UTC timestamp with the year/month/day + hour/minute/sec of this observation.
bool getAllFieldValues(std::ostream &o) const override
bool getAllFieldDescriptions(std::ostream &o) const override
void dumpToStream(std::ostream &out) const override
Dumps the contents of the observation in a human-readable form to a given output stream.
bool getAllFieldDescriptions(std::ostream &o) const override
mrpt::vision::TStereoCalibResults out
Pure virtual base for all message types.
void dumpToStream(std::ostream &out) const override
Dumps the contents of the observation in a human-readable form to a given output stream.
double direction_degrees
Measured speed direction (in degrees)
void dumpToStream(std::ostream &out) const override
Dumps the contents of the observation in a human-readable form to a given output stream.
TGEODETICCOORDS getAsStruct() const
Return the geodetic coords as a mrpt::topography::TGeodeticCoords structure (requires linking against...
char positioning_mode
&#39;A&#39;: Autonomous, &#39;D&#39;: Differential, &#39;N&#39;: Not valid, &#39;E&#39;: Estimated, &#39;M&#39;: Manual
content_t fields
Message content, accesible by individual fields.
double latitude_degrees
The measured latitude, in degrees (North:+ , South:-)
int8_t validity_char
This will be: &#39;A&#39;=OK or &#39;V&#39;=void.
UTC_time UTCTime
The GPS sensor measured timestamp (in UTC time)



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020