Main MRPT website > C++ reference for MRPT 1.5.7
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-2017, 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 {
14 namespace obs {
15 namespace gnss {
16 
17 // Pragma to ensure we can safely serialize some of these structures
18 #pragma pack(push,1)
19 
20 /** NMEA datum: GGA. \sa mrpt::obs::CObservationGPS */
22 {
23  GNSS_MESSAGE_BINARY_BLOCK(&fields,sizeof(fields))
24  enum { msg_type = NMEA_GGA }; //!< Static msg type (member expected by templates)
26  {}
27 
29  {
30  UTC_time UTCTime; //!< The GPS sensor measured timestamp (in UTC time)
31  double latitude_degrees; //!< The measured latitude, in degrees (North:+ , South:-)
32  double longitude_degrees; //!< The measured longitude, in degrees (East:+ , West:-)
33  uint8_t fix_quality; //!< NMEA standard values: 0 = invalid, 1 = GPS fix (SPS), 2 = DGPS fix, 3 = PPS fix, 4 = Real Time Kinematic, 5 = Float RTK, 6 = estimated (dead reckoning) (2.3 feature), 7 = Manual input mode, 8 = Simulation mode */
34  double altitude_meters; //!< The measured altitude, in meters (A).
35  double geoidal_distance; //!< Undulation: Difference between the measured altitude and the geoid, in meters (B).
36  double orthometric_altitude; //!< The measured orthometric altitude, in meters (A)+(B).
37  double corrected_orthometric_altitude; //!< The corrected (only for TopCon mmGPS) orthometric altitude, in meters mmGPS(A+B).
38  uint32_t satellitesUsed; //!< The number of satelites used to compute this estimation.
39  bool thereis_HDOP; //!< This states whether to take into account the value in the HDOP field.
40  float HDOP; //!< The HDOP (Horizontal Dilution of Precision) as returned by the sensor.
41 
42  content_t();
43  };
44  content_t fields; //!< Message content, accesible by individual fields
45 
46  void dumpToStream( mrpt::utils::CStream &out ) const MRPT_OVERRIDE; // See docs in base
47 
48  /** Return the geodetic coords as a mrpt::topography::TGeodeticCoords structure (requires linking against mrpt-topography)
49  * Call as: getAsStruct<TGeodeticCoords>(); */
50  template <class TGEODETICCOORDS>
51  inline TGEODETICCOORDS getOrthoAsStruct() const {
52  return TGEODETICCOORDS(fields.latitude_degrees,fields.longitude_degrees,fields.orthometric_altitude);
53  }
54  /** Return the corrected geodetic coords as a mrpt::topography::TGeodeticCoords structure (requires linking against mrpt-topography)
55  * Call as: getAsStruct<TGeodeticCoords>(); */
56  template <class TGEODETICCOORDS>
57  inline TGEODETICCOORDS getCorrectedOrthoAsStruct() const {
58  return TGEODETICCOORDS(fields.latitude_degrees,fields.longitude_degrees,fields.corrected_orthometric_altitude);
59  }
60  /** Return the geodetic coords as a mrpt::topography::TGeodeticCoords structure (requires linking against mrpt-topography)
61  * Call as: getAsStruct<TGeodeticCoords>(); */
62  template <class TGEODETICCOORDS>
63  inline TGEODETICCOORDS getAsStruct() const {
64  return TGEODETICCOORDS(fields.latitude_degrees,fields.longitude_degrees,fields.altitude_meters);
65  }
66 
67  bool getAllFieldDescriptions( std::ostream &o ) const MRPT_OVERRIDE;
68  bool getAllFieldValues( std::ostream &o ) const MRPT_OVERRIDE;
69 };
70 
71 /** NMEA datum: GLL. \sa mrpt::obs::CObservationGPS */
73 {
74  GNSS_MESSAGE_BINARY_BLOCK(&fields,sizeof(fields))
75  enum { msg_type = NMEA_GLL }; //!< Static msg type (member expected by templates)
77  {}
79  {
80  UTC_time UTCTime; //!< The GPS sensor measured timestamp (in UTC time)
81  double latitude_degrees; //!< The measured latitude, in degrees (North:+ , South:-)
82  double longitude_degrees; //!< The measured longitude, in degrees (East:+ , West:-)
83  int8_t validity_char; //!< This will be: 'A'=OK or 'V'=void
84  content_t();
85  };
86  content_t fields; //!< Message content, accesible by individual fields
87  void dumpToStream( mrpt::utils::CStream &out ) const MRPT_OVERRIDE; // See docs in base
88  bool getAllFieldDescriptions( std::ostream &o ) const MRPT_OVERRIDE;
89  bool getAllFieldValues( std::ostream &o ) const MRPT_OVERRIDE;
90 };
91 
92 /** NMEA datum: RMC. \sa mrpt::obs::CObservationGPS */
94 {
95  GNSS_MESSAGE_BINARY_BLOCK(&fields,sizeof(fields))
96  enum { msg_type = NMEA_RMC }; //!< Static msg type (member expected by templates)
98  {}
99 
101  {
102  UTC_time UTCTime; //!< The GPS sensor measured timestamp (in UTC time)
103  int8_t validity_char; //!< This will be: 'A'=OK or 'V'=void
104  double latitude_degrees; //!< The measured latitude, in degrees (North:+ , South:-)
105  double longitude_degrees; //!< The measured longitude, in degrees (East:+ , West:-)
106  double speed_knots; //!< Measured speed (in knots)
107  double direction_degrees; //!< Measured speed direction (in degrees)
108  uint8_t date_day, date_month,date_year; //!< Date: day (1-31), month (1-12), two-digits year (00-99)
109  double magnetic_dir; //!< Magnetic variation direction (East:+, West:-)
110  char positioning_mode; //!< 'A': Autonomous, 'D': Differential, 'N': Not valid, 'E': Estimated, 'M': Manual
111  content_t();
112  };
113  content_t fields; //!< Message content, accesible by individual fields
114 
115  mrpt::system::TTimeStamp getDateAsTimestamp() const; //!< Build an MRPT timestamp with the year/month/day of this observation.
116 
117  void dumpToStream( mrpt::utils::CStream &out ) const MRPT_OVERRIDE; // See docs in base
118  bool getAllFieldDescriptions( std::ostream &o ) const MRPT_OVERRIDE;
119  bool getAllFieldValues( std::ostream &o ) const MRPT_OVERRIDE;
120 };
121 
122 /** NMEA datum: VTG. \sa mrpt::obs::CObservationGPS */
124 {
125  GNSS_MESSAGE_BINARY_BLOCK(&fields,sizeof(fields))
126  enum { msg_type = NMEA_VTG }; //!< Static msg type (member expected by templates)
128  {}
130  {
131  double true_track, magnetic_track; //!< Degrees
132  double ground_speed_knots, ground_speed_kmh;
133  content_t();
134  };
135  content_t fields; //!< Message content, accesible by individual fields
136  void dumpToStream( mrpt::utils::CStream &out ) const MRPT_OVERRIDE; // See docs in base
137  bool getAllFieldDescriptions( std::ostream &o ) const MRPT_OVERRIDE;
138  bool getAllFieldValues( std::ostream &o ) const MRPT_OVERRIDE;
139 };
140 
141 /** NMEA datum: ZDA. \sa mrpt::obs::CObservationGPS */
143 {
144  GNSS_MESSAGE_BINARY_BLOCK(&fields,sizeof(fields))
145  enum { msg_type = NMEA_ZDA }; //!< Static msg type (member expected by templates)
147  {}
148 
150  {
151  UTC_time UTCTime; //!< The GPS sensor measured timestamp (in UTC time)
152  uint8_t date_day; //!< 1-31
153  uint8_t date_month; //!< 1-12
154  uint16_t date_year; //!< 2000-...
155  content_t();
156  };
157  content_t fields; //!< Message content, accesible by individual fields
158 
159  mrpt::system::TTimeStamp getDateTimeAsTimestamp() const; //!< Build an MRPT UTC timestamp with the year/month/day + hour/minute/sec of this observation.
160  mrpt::system::TTimeStamp getDateAsTimestamp() const; //!< Build an MRPT timestamp with the year/month/day of this observation.
161 
162  void dumpToStream( mrpt::utils::CStream &out ) const MRPT_OVERRIDE; // See docs in base
163  bool getAllFieldDescriptions( std::ostream &o ) const MRPT_OVERRIDE;
164  bool getAllFieldValues( std::ostream &o ) const MRPT_OVERRIDE;
165 };
166 #pragma pack(pop) // End of pack = 1
167 } } } // End of namespaces
168 
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
Definition: datetime.h:30
double longitude_degrees
The measured longitude, in degrees (East:+ , West:-)
bool getAllFieldDescriptions(std::ostream &o) const MRPT_OVERRIDE
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.
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:46
double latitude_degrees
The measured latitude, in degrees (North:+ , South:-)
UTC (Coordinated Universal Time) time-stamp structure for GPS messages.
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
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.
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:42
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:43
double altitude_meters
The measured altitude, in meters (A).
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:38
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)
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:-)
TGEODETICCOORDS getOrthoAsStruct() const
Return the geodetic coords as a mrpt::topography::TGeodeticCoords structure (requires linking against...
uint8_t date_year
Date: day (1-31), month (1-12), two-digits year (00-99)
double geoidal_distance
Undulation: Difference between the measured altitude and the geoid, in meters (B).
double magnetic_dir
Magnetic variation direction (East:+, West:-)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Pure virtual base for all message types.
double direction_degrees
Measured speed direction (in degrees)
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.
bool getAllFieldValues(std::ostream &o) const MRPT_OVERRIDE
unsigned __int32 uint32_t
Definition: rptypes.h:49
UTC_time UTCTime
The GPS sensor measured timestamp (in UTC time)



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019