11 #include <gtest/gtest.h>
25 const char* test_cmd =
26 "$GPGGA,101830.00,3649.76162994,N,00224.53709052,W,2,08,1.1,9.3,M,"
30 EXPECT_TRUE(parse_ret) <<
"Failed parse of: " << test_cmd << endl;
34 EXPECT_TRUE(msg !=
nullptr);
44 const char* test_cmd =
"$GPGGA,,,,,,0,,,,M,,M,,*6";
47 EXPECT_FALSE(parse_ret);
53 const char* test_cmd =
54 "$GPRMC,161229.487,A,3723.2475,N,12158.3416,W,0.13,309.62,120598, ,*10";
57 EXPECT_TRUE(parse_ret) <<
"Failed parse of: " << test_cmd << endl;
62 EXPECT_TRUE(msg !=
nullptr);
70 const char* test_cmd =
"$GPGLL,3723.2475,N,12158.3416,W,161229.487,A,A*41";
73 EXPECT_TRUE(parse_ret) <<
"Failed parse of: " << test_cmd << endl;
78 EXPECT_TRUE(msg !=
nullptr);
86 const char* test_cmd =
"$GPVTG,054.7,T,034.4,M,005.5,N,010.2,K*48";
89 EXPECT_TRUE(parse_ret) <<
"Failed parse of: " << test_cmd << endl;
94 EXPECT_TRUE(msg !=
nullptr);
104 const char* test_cmd =
"$GPZDA,181813,14,10,2003,00,00*4F";
107 EXPECT_TRUE(parse_ret) <<
"Failed parse of: " << test_cmd << endl;
112 EXPECT_TRUE(msg !=
nullptr);
TEST(CGPSInterface, parse_NMEA_GGA)
A class capable of reading GPS/GNSS/GNSS+IMU receiver data, from a serial port or from any input stre...
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 class stores messages from GNSS or GNSS+IMU devices, from consumer-grade inexpensive GPS receive...
MSG_CLASS * getMsgByClassPtr()
Like CObservationGPS::getMsgByClass() but returns a nullptr pointer if message is not found,...
Contains classes for various device interfaces.
This namespace contains representation of robot actions and observations.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
double latitude_degrees
The measured latitude, in degrees (North:+ , South:-)
double altitude_meters
The measured altitude, in meters (A).
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:-)
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:-)
content_t fields
Message content, accesible by individual fields.
double true_track
Degrees.
double ground_speed_knots
content_t fields
Message content, accesible by individual fields.
UTC_time UTCTime
The GPS sensor measured timestamp (in UTC time)
uint16_t date_year
2000-...
content_t fields
Message content, accesible by individual fields.