11 #include <gtest/gtest.h> 26 const char* test_cmd =
27 "$GPGGA,101830.00,3649.76162994,N,00224.53709052,W,2,08,1.1,9.3,M," 31 EXPECT_TRUE(parse_ret) <<
"Failed parse of: " << test_cmd << endl;
35 EXPECT_TRUE(msg !=
nullptr);
45 const char* test_cmd =
"$GPGGA,,,,,,0,,,,M,,M,,*6";
48 EXPECT_FALSE(parse_ret);
54 const char* test_cmd =
55 "$GPRMC,161229.487,A,3723.2475,N,12158.3416,W,0.13,309.62,120598, ,*10";
58 EXPECT_TRUE(parse_ret) <<
"Failed parse of: " << test_cmd << endl;
63 EXPECT_TRUE(msg !=
nullptr);
71 const char* test_cmd =
"$GPGLL,3723.2475,N,12158.3416,W,161229.487,A,A*41";
74 EXPECT_TRUE(parse_ret) <<
"Failed parse of: " << test_cmd << endl;
79 EXPECT_TRUE(msg !=
nullptr);
87 const char* test_cmd =
"$GPVTG,054.7,T,034.4,M,005.5,N,010.2,K*48";
90 EXPECT_TRUE(parse_ret) <<
"Failed parse of: " << test_cmd << endl;
95 EXPECT_TRUE(msg !=
nullptr);
105 const char* test_cmd =
"$GPZDA,181813,14,10,2003,00,00*4F";
108 EXPECT_TRUE(parse_ret) <<
"Failed parse of: " << test_cmd << endl;
113 EXPECT_TRUE(msg !=
nullptr);
double longitude_degrees
The measured longitude, in degrees (East:+ , West:-)
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:-)
A class capable of reading GPS/GNSS/GNSS+IMU receiver data, from a serial port or from any input stre...
MSG_CLASS * getMsgByClassPtr()
Like CObservationGPS::getMsgByClass() but returns a nullptr pointer if message is not found...
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
double latitude_degrees
The measured latitude, in degrees (North:+ , South:-)
TEST(CGPSInterface, parse_NMEA_GGA)
content_t fields
Message content, accesible by individual fields.
Contains classes for various device interfaces.
content_t fields
Message content, accesible by individual fields.
UTC_time UTCTime
The GPS sensor measured timestamp (in UTC time)
double altitude_meters
The measured altitude, in meters (A).
content_t fields
Message content, accesible by individual fields.
double longitude_degrees
The measured longitude, in degrees (East:+ , West:-)
This namespace contains representation of robot actions and observations.
static bool parse_NMEA(const std::string &cmd_line, mrpt::obs::CObservationGPS &out_obs, const bool verbose=false)
Parses one line of NMEA data from a GPS receiver, and writes the recognized fields (if any) into an o...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
content_t fields
Message content, accesible by individual fields.
double latitude_degrees
The measured latitude, in degrees (North:+ , South:-)
double ground_speed_knots
This class stores messages from GNSS or GNSS+IMU devices, from consumer-grade inexpensive GPS receive...
uint16_t date_year
2000-...
double true_track
Degrees.