MRPT  1.9.9
gnss_messages_ascii_nmea.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://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:-) */
34  /** The measured longitude, in degrees (East:+ , West:-) */
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 */
41  /** The measured altitude, in meters (A). */
43  /** Undulation: Difference between the measured altitude and the geoid,
44  * in meters (B). */
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. */
53  /** This states whether to take into account the value in the HDOP
54  * field. */
56  /** The HDOP (Horizontal Dilution of Precision) as returned by the
57  * sensor. */
58  float HDOP;
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:-) */
119  /** The measured longitude, in degrees (East:+ , West:-) */
121  /** This will be: 'A'=OK or 'V'=void */
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 */
148  /** The measured latitude, in degrees (North:+ , South:-) */
150  /** The measured longitude, in degrees (East:+ , West:-) */
152  /** Measured speed (in knots) */
153  double speed_knots;
154  /** Measured speed direction (in degrees) */
156  /** Date: day (1-31), month (1-12), two-digits year (00-99) */
158  /** Magnetic variation direction (East:+, West:-) */
159  double magnetic_dir;
160  /** 'A': Autonomous, 'D': Differential, 'N': Not valid, 'E': Estimated,
161  * 'M': Manual */
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: ZDA. \sa mrpt::obs::CObservationGPS */
202 {
204  /** Static msg type (member expected by templates) */
205  enum
206  {
208  };
210  struct content_t
211  {
212  /** The GPS sensor measured timestamp (in UTC time) */
214  /** 1-31 */
216  /** 1-12 */
218  /** 2000-... */
220  content_t();
221  };
222  /** Message content, accesible by individual fields */
224 
225  /** Build an MRPT UTC timestamp with the year/month/day + hour/minute/sec of
226  * this observation. */
228  /** Build an MRPT timestamp with the year/month/day of this observation. */
230 
231  void dumpToStream(std::ostream& out) const override; // See docs in base
232  bool getAllFieldDescriptions(std::ostream& o) const override;
233  bool getAllFieldValues(std::ostream& o) const override;
234 };
235 #pragma pack(pop) // End of pack = 1
236 }
237 
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
Dumps a line with the sequence of all field values (without a line feed at the end).
double latitude_degrees
The measured latitude, in degrees (North:+ , South:-)
double longitude_degrees
The measured longitude, in degrees (East:+ , West:-)
unsigned __int16 uint16_t
Definition: rptypes.h:44
bool getAllFieldValues(std::ostream &o) const override
Dumps a line with the sequence of all field values (without a line feed at the end).
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.
uint32_t satellitesUsed
The number of satelites used to compute this estimation.
bool getAllFieldDescriptions(std::ostream &o) const override
Dumps a header for getAllFieldValues()
content_t fields
Message content, accesible by individual fields.
UTC_time UTCTime
The GPS sensor measured timestamp (in UTC time)
signed char int8_t
Definition: rptypes.h:40
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).
unsigned char uint8_t
Definition: rptypes.h:41
bool getAllFieldValues(std::ostream &o) const override
Dumps a line with the sequence of all field values (without a line feed at the end).
bool getAllFieldDescriptions(std::ostream &o) const override
Dumps a header for getAllFieldValues()
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
Dumps a header for getAllFieldValues()
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.
double longitude_degrees
The measured longitude, in degrees (East:+ , West:-)
bool getAllFieldValues(std::ostream &o) const override
Dumps a line with the sequence of all field values (without a line feed at the end).
bool getAllFieldValues(std::ostream &o) const override
Dumps a line with the sequence of all field values (without a line feed at the end).
TGEODETICCOORDS getOrthoAsStruct() const
Return the geodetic coords as a mrpt::topography::TGeodeticCoords structure (requires linking against...
bool getAllFieldDescriptions(std::ostream &o) const override
Dumps a header for getAllFieldValues()
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 getAllFieldDescriptions(std::ostream &o) const override
Dumps a header for getAllFieldValues()
void dumpToStream(std::ostream &out) const override
Dumps the contents of the observation in a human-readable form to a given output stream.
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.
unsigned __int32 uint32_t
Definition: rptypes.h:47
UTC_time UTCTime
The GPS sensor measured timestamp (in UTC time)



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020