Go to the documentation of this file.
9 #ifndef CObservationGPS_H
10 #define CObservationGPS_H
66 typedef std::map<gnss::gnss_message_type_t, gnss::gnss_message_ptr>
message_list_t;
85 template <
class MSG_CLASS>
87 messages[static_cast<gnss::gnss_message_type_t>(MSG_CLASS::msg_type)].set(
new MSG_CLASS(msg));
92 template <
class MSG_CLASS>
bool hasMsgClass()
const {
return hasMsgType(static_cast<gnss::gnss_message_type_t>(MSG_CLASS::msg_type)); }
104 template <
class MSG_CLASS>
107 ASSERTMSG_(it!=messages.end(),
mrpt::format(
"[CObservationGPS::getMsgByClass] Cannot find any observation of type `%s`",
typeid(MSG_CLASS).name()));
109 return *dynamic_cast<MSG_CLASS*>(it->second.get());
112 template <
class MSG_CLASS>
115 ASSERTMSG_(it!=messages.end(),
mrpt::format(
"[CObservationGPS::getMsgByClass] Cannot find any observation of type `%s`",
typeid(MSG_CLASS).name()));
117 return *dynamic_cast<const MSG_CLASS*>(it->second.get());
121 template <
class MSG_CLASS>
124 return it==messages.end() ? reinterpret_cast<MSG_CLASS*>(NULL) : dynamic_cast<MSG_CLASS*>(it->second.get());
127 template <
class MSG_CLASS>
130 return it==messages.end() ? dynamic_cast<MSG_CLASS*>(NULL) : dynamic_cast<MSG_CLASS*>(it->second.get());
134 void dumpToConsole(std::ostream &o = std::cout)
const;
140 void getDescriptionAsText(std::ostream &o)
const MRPT_OVERRIDE;
157 operator bool(
void)
const {
return msgs.find(MSG_TYPE)!=msgs.end(); }
172 static bool GPS_time_to_UTC(
173 uint16_t gps_week,
double gps_sec,
174 const int leap_seconds_count ,
176 static bool GPS_time_to_UTC(uint16_t gps_week,
double gps_sec,
const int leap_seconds_count,
mrpt::system::TTimeParts &utc_out);
mrpt::poses::CPose3D sensorPose
The sensor pose on the robot/vehicle.
std::map< gnss::gnss_message_type_t, gnss::gnss_message_ptr > message_list_t
bool hasMsgClass() const
Like hasMsgType() but allows querying for message classes, from any of those derived from mrpt::obs::...
#define ASSERTMSG_(f, __ERROR_MSG)
TopCon mmGPS devices: SATS, a generic structure for statistics about tracked satelites and their posi...
gnss_message_type_t
List of all known GNSS message types.
internal_msg_test_proxy< gnss::TOPCON_SATS > has_SATS_datum
Evaluates as a bool; true if the corresponding field exists in messages.
const MSG_CLASS * getMsgByClassPtr() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const MRPT_OVERRIDE
A general method to retrieve the sensor pose on the robot.
MSG_CLASS & getMsgByClass()
Returns a reference to the message in the list CObservationGPS::messages of the requested class.
mrpt::system::TTimeStamp originalReceivedTimestamp
The local computer-based timestamp based on the reception of the message in the computer.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
message_list_t messages
The main piece of data in this class: a list of GNNS messages.
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose) MRPT_OVERRIDE
A general method to change the sensor pose on the robot.
const typedef Scalar * const_iterator
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
The parts of a date/time (it's like the standard 'tm' but with fractions of seconds).
UTC (Coordinated Universal Time) time-stamp structure for GPS messages.
const MSG_CLASS & getMsgByClass() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
internal_msg_test_proxy(message_list_t &msgs_)
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
internal_msg_test_proxy< gnss::NMEA_RMC > has_RMC_datum
Evaluates as a bool; true if the corresponding field exists in messages.
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
GPS datum for TopCon's mmGPS devices: PZS.
MSG_CLASS * getMsgByClassPtr()
Like CObservationGPS::getMsgByClass() but returns a NULL pointer if message is not found,...
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
This class stores messages from GNSS or GNSS+IMU devices, from consumer-grade inexpensive GPS receive...
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
internal_msg_test_proxy< gnss::TOPCON_PZS > has_PZS_datum
Evaluates as a bool; true if the corresponding field exists in messages.
bool has_satellite_timestamp
If true, CObservation::timestamp has been generated from accurate satellite clock....
void setMsg(const MSG_CLASS &msg)
Stores a message in the list messages, making a copy of the passed object.
Declares a class that represents any robot's observation.
Pure virtual base for all message types.
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
Proxy class for type-based testing existence of data inside CObservationGPS::messages.
internal_msg_test_proxy< gnss::NMEA_GGA > has_GGA_datum
Evaluates as a bool; true if the corresponding field exists in messages.
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
Page generated by Doxygen 1.8.16 for MRPT 1.4.0 SVN: at Mon Oct 14 23:08:25 UTC 2019 | | |