Main MRPT website > C++ reference for MRPT 1.4.0
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-2016, 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
12
13namespace mrpt {
14namespace obs {
15namespace 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
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
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
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;
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
154 uint16_t date_year; //!< 2000-...
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
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition CStream.h:39
#define GNSS_MESSAGE_BINARY_BLOCK(DATA_PTR, DATA_LEN)
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
Definition datetime.h:30
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
Definition mrpt_macros.h:28
gnss_message_type_t
List of all known GNSS message types.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
unsigned long uint32_t
Definition pstdint.h:216
unsigned int uint16_t
Definition pstdint.h:170
unsigned char uint8_t
Definition pstdint.h:143
signed char int8_t
Definition pstdint.h:158
double latitude_degrees
The measured latitude, in degrees (North:+ , South:-)
uint8_t fix_quality
NMEA standard values: 0 = invalid, 1 = GPS fix (SPS), 2 = DGPS fix, 3 = PPS fix, 4 = Real Time Kinema...
bool thereis_HDOP
This states whether to take into account the value in the HDOP field.
double orthometric_altitude
The measured orthometric altitude, in meters (A)+(B).
uint32_t satellitesUsed
The number of satelites used to compute this estimation.
double corrected_orthometric_altitude
The corrected (only for TopCon mmGPS) orthometric altitude, in meters mmGPS(A+B).
float HDOP
The HDOP (Horizontal Dilution of Precision) as returned by the sensor.
double altitude_meters
The measured altitude, in meters (A).
double longitude_degrees
The measured longitude, in degrees (East:+ , West:-)
UTC_time UTCTime
The GPS sensor measured timestamp (in UTC time)
double geoidal_distance
Undulation: Difference between the measured altitude and the geoid, in meters (B).
TGEODETICCOORDS getOrthoAsStruct() const
Return the geodetic coords as a mrpt::topography::TGeodeticCoords structure (requires linking against...
TGEODETICCOORDS getAsStruct() const
Return the geodetic coords as a mrpt::topography::TGeodeticCoords structure (requires linking against...
void dumpToStream(mrpt::utils::CStream &out) const MRPT_OVERRIDE
Dumps the contents of the observation in a human-readable form to a given output stream.
bool getAllFieldDescriptions(std::ostream &o) const MRPT_OVERRIDE
Dumps a header for getAllFieldValues()
bool getAllFieldValues(std::ostream &o) const MRPT_OVERRIDE
Dumps a line with the sequence of all field values (without a line feed at the end).
content_t fields
Message content, accesible by individual fields.
TGEODETICCOORDS getCorrectedOrthoAsStruct() const
Return the corrected geodetic coords as a mrpt::topography::TGeodeticCoords structure (requires linki...
double latitude_degrees
The measured latitude, in degrees (North:+ , South:-)
double longitude_degrees
The measured longitude, in degrees (East:+ , West:-)
int8_t validity_char
This will be: 'A'=OK or 'V'=void.
UTC_time UTCTime
The GPS sensor measured timestamp (in UTC time)
bool getAllFieldValues(std::ostream &o) const MRPT_OVERRIDE
Dumps a line with the sequence of all field values (without a line feed at the end).
content_t fields
Message content, accesible by individual fields.
bool getAllFieldDescriptions(std::ostream &o) const MRPT_OVERRIDE
Dumps a header for getAllFieldValues()
void dumpToStream(mrpt::utils::CStream &out) const MRPT_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)
int8_t validity_char
This will be: 'A'=OK or 'V'=void.
double magnetic_dir
Magnetic variation direction (East:+, West:-)
char positioning_mode
'A': Autonomous, 'D': Differential, 'N': Not valid, 'E': Estimated, 'M': Manual
double latitude_degrees
The measured latitude, in degrees (North:+ , South:-)
double longitude_degrees
The measured longitude, in degrees (East:+ , West:-)
UTC_time UTCTime
The GPS sensor measured timestamp (in UTC time)
void dumpToStream(mrpt::utils::CStream &out) const MRPT_OVERRIDE
Dumps the contents of the observation in a human-readable form to a given output stream.
bool getAllFieldDescriptions(std::ostream &o) const MRPT_OVERRIDE
Dumps a header for getAllFieldValues()
mrpt::system::TTimeStamp getDateAsTimestamp() const
Build an MRPT timestamp with the year/month/day of this observation.
content_t fields
Message content, accesible by individual fields.
bool getAllFieldValues(std::ostream &o) const MRPT_OVERRIDE
Dumps a line with the sequence of all field values (without a line feed at the end).
void dumpToStream(mrpt::utils::CStream &out) const MRPT_OVERRIDE
Dumps the contents of the observation in a human-readable form to a given output stream.
bool getAllFieldValues(std::ostream &o) const MRPT_OVERRIDE
Dumps a line with the sequence of all field values (without a line feed at the end).
bool getAllFieldDescriptions(std::ostream &o) const MRPT_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)
void dumpToStream(mrpt::utils::CStream &out) const MRPT_OVERRIDE
Dumps the contents of the observation in a human-readable form to a given output stream.
content_t fields
Message content, accesible by individual fields.
mrpt::system::TTimeStamp getDateTimeAsTimestamp() const
Build an MRPT UTC timestamp with the year/month/day + hour/minute/sec of this observation.
mrpt::system::TTimeStamp getDateAsTimestamp() const
Build an MRPT timestamp with the year/month/day of this observation.
bool getAllFieldValues(std::ostream &o) const MRPT_OVERRIDE
Dumps a line with the sequence of all field values (without a line feed at the end).
bool getAllFieldDescriptions(std::ostream &o) const MRPT_OVERRIDE
Dumps a header for getAllFieldValues()
UTC (Coordinated Universal Time) time-stamp structure for GPS messages.
Pure virtual base for all message types.



Page generated by Doxygen 1.9.7 for MRPT 1.4.0 SVN: at Tue Jun 27 15:23:24 UTC 2023