9 #ifndef CObservationGPS_H 10 #define CObservationGPS_H 74 typedef std::map<gnss::gnss_message_type_t, gnss::gnss_message_ptr>
107 template <
class MSG_CLASS>
111 .
set(
new MSG_CLASS(msg));
120 template <
class MSG_CLASS>
124 static_cast<gnss::gnss_message_type_t>(MSG_CLASS::msg_type));
148 template <
class MSG_CLASS>
152 static_cast<gnss::gnss_message_type_t>(MSG_CLASS::msg_type));
155 "[CObservationGPS::getMsgByClass] Cannot " 156 "find any observation of type `%s`",
157 typeid(MSG_CLASS).
name()));
159 return *
dynamic_cast<MSG_CLASS*
>(it->second.get());
162 template <
class MSG_CLASS>
166 static_cast<gnss::gnss_message_type_t>(MSG_CLASS::msg_type));
169 "[CObservationGPS::getMsgByClass] Cannot " 170 "find any observation of type `%s`",
171 typeid(MSG_CLASS).
name()));
173 return *
dynamic_cast<const MSG_CLASS*
>(it->second.get());
178 template <
class MSG_CLASS>
182 static_cast<gnss::gnss_message_type_t>(MSG_CLASS::msg_type));
184 ?
static_cast<MSG_CLASS*
>(
nullptr)
185 : dynamic_cast<MSG_CLASS*>(it->second.get());
188 template <
class MSG_CLASS>
192 static_cast<gnss::gnss_message_type_t>(MSG_CLASS::msg_type));
194 ?
dynamic_cast<MSG_CLASS*
>(
nullptr)
195 : dynamic_cast<MSG_CLASS*>(it->second.get());
217 std::ostream& o)
const override;
238 template <mrpt::obs::gnss::gnss_message_type_t MSG_TYPE>
242 operator bool(
void)
const {
return msgs.find(MSG_TYPE) !=
msgs.end(); }
278 uint16_t gps_week,
double gps_sec,
const int leap_seconds_count,
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
MSG_CLASS * getMsgByClassPtr()
Like CObservationGPS::getMsgByClass() but returns a nullptr pointer if message is not found...
gnss::UTC_time TUTCTime
Deprecated, kept for backwards compatibility.
unsigned __int16 uint16_t
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
TopCon mmGPS devices: SATS, a generic structure for statistics about tracked satelites and their posi...
UTC (Coordinated Universal Time) time-stamp structure for GPS messages.
mrpt::system::TTimeStamp originalReceivedTimestamp
The local computer-based timestamp based on the reception of the message in the computer.
void swap(CObservationGPS &o)
gnss_message_type_t
List of all known GNSS message types.
message_list_t messages
The main piece of data in this class: a list of GNNS messages.
gnss::Message_NMEA_RMC TGPSDatum_RMC
Deprecated, kept for backwards compatibility.
const Scalar * const_iterator
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose) override
A general method to change the sensor pose on the robot.
mrpt::obs::gnss::gnss_message * getMsgByType(const gnss::gnss_message_type_t type_id)
Returns a pointer to the message in the list CObservationGPS::messages of the requested type...
GPS datum for TopCon's mmGPS devices: PZS.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
const MSG_CLASS * getMsgByClassPtr() const
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
internal_msg_test_proxy< gnss::NMEA_RMC > has_RMC_datum
Evaluates as a bool; true if the corresponding field exists in messages.
The parts of a date/time (it's like the standard 'tm' but with fractions of seconds).
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const override
A general method to retrieve the sensor pose on the robot.
internal_msg_test_proxy(message_list_t &msgs_)
Proxy class for type-based testing existence of data inside CObservationGPS::messages.
bool has_satellite_timestamp
If true, CObservation::timestamp has been generated from accurate satellite clock.
internal_msg_test_proxy< gnss::TOPCON_PZS > has_PZS_datum
Evaluates as a bool; true if the corresponding field exists in messages.
gnss::Message_TOPCON_SATS TGPSDatum_SATS
Deprecated, kept for backwards compatibility.
MSG_CLASS & getMsgByClass()
Returns a reference to the message in the list CObservationGPS::messages of the requested class...
gnss::Message_TOPCON_PZS TGPSDatum_PZS
Deprecated, kept for backwards compatibility.
void clear()
Empties this observation, clearing the container messages.
void dumpToConsole(std::ostream &o=std::cout) const
Dumps the contents of the observation in a human-readable form to an std::ostream (default=console) ...
internal_msg_test_proxy< MSG_TYPE > & operator=(const internal_msg_test_proxy< MSG_TYPE > &)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
void setMsg(const MSG_CLASS &msg)
Stores a message in the list messages, making a copy of the passed object.
mrpt::system::TTimeStamp getOriginalReceivedTimeStamp() const override
By default, returns CObservation::timestamp but in sensors capable of satellite (or otherwise) accura...
void dumpToStream(mrpt::utils::CStream &out) const
Dumps the contents of the observation in a human-readable form to a given output stream.
internal_msg_test_proxy< gnss::NMEA_GGA > has_GGA_datum
Evaluates as a bool; true if the corresponding field exists in messages.
mrpt::poses::CPose3D sensorPose
The sensor pose on the robot/vehicle.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Declares a class that represents any robot's observation.
Pure virtual base for all message types.
static bool GPS_time_to_UTC(uint16_t gps_week, double gps_sec, const int leap_seconds_count, mrpt::system::TTimeStamp &utc_out)
bool hasMsgClass() const
Like hasMsgType() but allows querying for message classes, from any of those derived from mrpt::obs::...
GLuint const GLchar * name
std::map< gnss::gnss_message_type_t, gnss::gnss_message_ptr > message_list_t
internal_msg_test_proxy< gnss::TOPCON_SATS > has_SATS_datum
Evaluates as a bool; true if the corresponding field exists in messages.
bool hasMsgType(const gnss::gnss_message_type_t type_id) const
Returns true if the list CObservationGPS::messages contains one of the requested type.
This class stores messages from GNSS or GNSS+IMU devices, from consumer-grade inexpensive GPS receive...
const MSG_CLASS & getMsgByClass() const
#define ASSERTMSG_(f, __ERROR_MSG)
gnss::Message_NMEA_GGA TGPSDatum_GGA
Deprecated, kept for backwards compatibility.