Go to the documentation of this file.
27 std::swap(timestamp, o.timestamp);
28 std::swap(originalReceivedTimestamp, o.originalReceivedTimestamp);
29 std::swap(has_satellite_timestamp, o.has_satellite_timestamp);
30 std::swap(sensorLabel, o.sensorLabel);
31 std::swap(sensorPose, o.sensorPose);
32 messages.swap(o.messages);
35 uint8_t CObservationGPS::serializeGetVersion()
const {
return 11; }
38 out << timestamp << originalReceivedTimestamp << sensorLabel << sensorPose;
39 out << has_satellite_timestamp;
41 const uint32_t nMsgs = messages.size();
44 it != messages.end(); ++it)
45 it->second->writeToStream(out);
48 void CObservationGPS::serializeFrom(
58 in >> timestamp >> originalReceivedTimestamp >> sensorLabel >>
61 in >> has_satellite_timestamp;
63 has_satellite_timestamp =
64 (this->timestamp != this->originalReceivedTimestamp);
68 for (
unsigned i = 0; i < nMsgs; i++)
71 gnss::gnss_message::readAndBuildFromStream(
in);
116 in >> has_GGA_datum_;
149 in >> has_RMC_datum_;
172 sensorPose.setFromValues(0, 0, 0, 0, 0, 0);
176 in >> has_PZS_datum_;
232 bool has_SATS_datum_;
233 in >> has_SATS_datum_;
248 originalReceivedTimestamp = timestamp;
251 void CObservationGPS::dumpToStream(std::ostream& out)
const
253 out <<
"\n------------- [CObservationGPS] Dump of " << messages.size()
254 <<
" messages --------------------\n";
255 for (
const auto& m : messages) m.second->dumpToStream(out);
256 out <<
"-------------- [CObservationGPS] End of dump -----------------\n\n";
259 void CObservationGPS::dumpToConsole(std::ostream& o)
const
261 this->dumpToStream(o);
266 return originalReceivedTimestamp;
275 void CObservationGPS::getDescriptionAsText(std::ostream& o)
const
277 CObservation::getDescriptionAsText(o);
279 o <<
"Timestamp (UTC) of reception at the computer: "
281 o <<
" (as time_t): " << std::fixed << std::setprecision(5)
284 o <<
" (as TTimestamp): " << originalReceivedTimestamp << std::endl;
286 o <<
"Sensor position on the robot/vehicle: " << sensorPose << std::endl;
288 this->dumpToConsole(o);
293 return messages.find(type_id) != messages.end();
302 "[CObservationGPS::getMsgByType] Cannot find "
303 "any observation of type `%u`",
304 static_cast<unsigned int>(type_id)));
305 return it->second.get();
314 "[CObservationGPS::getMsgByType] Cannot find "
315 "any observation of type `%u`",
316 static_cast<unsigned int>(type_id)));
317 return it->second.get();
321 #define TIMECONV_JULIAN_DATE_START_OF_GPS_TIME (2444244.5) // [days]
323 const unsigned short gps_week,
const double gps_tow,
324 const unsigned int utc_offset,
double* julian_date)
326 if (gps_tow < 0.0 || gps_tow > 604800.0)
return false;
328 *julian_date = (gps_week + (gps_tow -
utc_offset) / 604800.0) * 7.0 +
335 bool is_a_leap_year =
false;
338 is_a_leap_year =
true;
339 if ((year % 100) == 0)
341 if ((year % 400) == 0)
342 is_a_leap_year =
true;
344 is_a_leap_year =
false;
347 return is_a_leap_year;
352 const unsigned short year,
354 const unsigned char month,
356 unsigned char* days_in_month)
358 unsigned char utmp = 0;
410 *days_in_month = utmp;
424 unsigned char minute;
425 unsigned char days_in_month = 0;
431 if (julian_date < 0.0)
return false;
433 a = (int)(julian_date + 0.5);
435 c = (int)(((
double)
b - 122.1) / 365.25);
436 d = (int)(365.25 *
c);
437 e = (int)(((
double)(
b - d)) / 30.6001);
439 td =
b - d - (int)(30.6001 * e) + fmod(julian_date + 0.5, 1.0);
440 day = (
unsigned char)td;
443 hour = (
unsigned char)td;
446 minute = (
unsigned char)td;
450 month = (
unsigned char)(e - 1 - 12 * (
int)(e / 14));
451 year = (
unsigned short)(
c - 4715 - (
int)((7.0 + (double)month) / 10.0));
466 year, month, &days_in_month);
467 if (result ==
false)
return false;
468 if (day > days_in_month)
491 bool CObservationGPS::GPS_time_to_UTC(
492 uint16_t gps_week,
double gps_sec,
const int leap_seconds_count,
496 if (!GPS_time_to_UTC(gps_week, gps_sec, leap_seconds_count, tim))
502 bool CObservationGPS::GPS_time_to_UTC(
503 uint16_t gps_week,
double gps_sec,
const int leap_seconds_count,
506 double julian_date = 0.0;
507 if (gps_sec < 0.0 || gps_sec > 604800.0)
return false;
509 gps_week, gps_sec, leap_seconds_count, &julian_date))
int8_t validity_char
This will be: 'A'=OK or 'V'=void.
bool TIMECONV_GetNumberOfDaysInMonth(const unsigned short year, const unsigned char month, unsigned char *days_in_month)
std::string dateTimeToString(const mrpt::system::TTimeStamp t)
Convert a timestamp into this textual form (UTC time): YEAR/MONTH/DAY,HH:MM:SS.MMM.
void clear()
Clear the contents of this container.
const Scalar * const_iterator
TopCon mmGPS devices: SATS, a generic structure for statistics about tracked satelites and their posi...
double longitude_degrees
The measured longitude, in degrees (East:+ , West:-)
gnss_message_type_t
List of all known GNSS message types.
unsigned __int16 uint16_t
double speed_knots
Measured speed (in knots)
uint8_t TXBattery
battery level on transmitter
bool hasCartesianPosVel
system error indicator
#define INVALID_TIMESTAMP
Represents an invalid timestamp, where applicable.
mrpt::math::CMatrixFloat44 vel_covariance
Only if hasPosCov is true.
mrpt::system::TTimeStamp buildTimestampFromParts(const mrpt::system::TTimeParts &p)
Builds a timestamp from the parts (Parts are in UTC)
content_t fields
Message content, accesible by individual fields.
double second
Minute (0-59)
float HDOP
The HDOP (Horizontal Dilution of Precision) as returned by the sensor.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
double cartesian_vx
Only if hasCartesianPosVel is true.
This namespace contains representation of robot actions and observations.
The parts of a date/time (it's like the standard 'tm' but with fractions of seconds).
Virtual base class for "archives": classes abstracting I/O streams.
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
gnss_message_type_t message_type
Type of GNSS message.
double latitude_degrees
The measured latitude, in degrees (North:+ , South:-)
A smart pointer to a GNSS message.
double direction_degrees
Measured speed direction (in degrees)
double latitude_degrees
The measured latitude, in degrees (North:+ , South:-)
uint32_t satellitesUsed
The number of satelites used to compute this estimation.
bool TIMECONV_IsALeapYear(const unsigned short year)
double longitude_degrees
The measured longitude, in degrees (East:+ , West:-)
uint8_t stats_rtk_fix_progress
[0,100] %, only in modes other than RTK FIXED.
content_t fields
Message content, accesible by individual fields.
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
double cartesian_x
Only if hasCartesianPosVel is true.
uint8_t stats_GLONASS_sats_used
double angle_transmitter
Vertical angle of N-beam.
#define TIMECONV_JULIAN_DATE_START_OF_GPS_TIME
GPS datum for TopCon's mmGPS devices: PZS.
double timestampTotime_t(const mrpt::system::TTimeStamp t)
Transform from TTimeStamp to standard "time_t" (actually a double number, it can contain fractions of...
double corrected_orthometric_altitude
The corrected (only for TopCon mmGPS) orthometric altitude, in meters mmGPS(A+B).
double altitude_meters
The measured altitude, in meters (A).
UTC_time UTCTime
The GPS sensor measured timestamp (in UTC time)
std::vector< int8_t > ELs
Elevation (in degrees, 0-90) for each satellite in USIs.
uint8_t nId
ID of the transmitter [1-4], 0 if none.
double latitude_degrees
The measured latitude, in degrees (North:+ , South:-)
bool thereis_HDOP
This states whether to take into account the value in the HDOP field.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
double longitude_degrees
The measured longitude, in degrees (East:+ , West:-)
#define ASSERTMSG_(f, __ERROR_MSG)
Defines an assertion mechanism.
double RTK_height_meters
ellipsoidal height [m] without N-beam correction
double orthometric_altitude
The measured orthometric altitude, in meters (A)+(B).
uint8_t stats_GPS_sats_used
This class stores messages from GNSS or GNSS+IMU devices, from consumer-grade inexpensive GPS receive...
double geoidal_distance
Undulation: Difference between the measured altitude and the geoid, in meters (B).
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
uint8_t RXBattery
battery level on receiver
Declares a class that represents any robot's observation.
This base provides a set of functions for maths stuff.
std::vector< uint8_t > USIs
The list of USI (Universal Sat ID) for the detected sats (See GRIL Manual, pag 4-31).
uint8_t minute
Hour (0-23)
float PSigma
position SEP [m]
Pure virtual base for all message types.
UTC_time UTCTime
The GPS sensor measured timestamp (in UTC time)
mrpt::math::CMatrixFloat44 pos_covariance
Only if hasPosCov is true.
uint8_t fix_quality
NMEA standard values: 0 = invalid, 1 = GPS fix (SPS), 2 = DGPS fix, 3 = PPS fix, 4 = Real Time Kinema...
double height_meters
ellipsoidal height from N-beam [m] perhaps weighted with regular gps
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
#define MRPT_READ_POD(_STREAM, _VARIABLE)
uint8_t Fix
1: GPS, 2: mmGPS
unsigned __int32 uint32_t
bool TIMECONV_GetJulianDateFromGPSTime(const unsigned short gps_week, const double gps_tow, const unsigned int utc_offset, double *julian_date)
bool TIMECONV_GetUTCTimeFromJulianDate(const double julian_date, mrpt::system::TTimeParts &utc)
Number of days since noon Universal Time Jan 1, 4713 BCE (Julian calendar) [days].
GLubyte GLubyte GLubyte a
std::vector< int16_t > AZs
Azimuth (in degrees, 0-360) for each satellite in USIs.
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |