73 std::map<gnss::gnss_message_type_t, gnss::gnss_message_ptr>;
102 template <
class MSG_CLASS>
106 .
set(
new MSG_CLASS(msg));
115 template <
class MSG_CLASS>
119 static_cast<gnss::gnss_message_type_t>(MSG_CLASS::msg_type));
143 template <
class MSG_CLASS>
147 static_cast<gnss::gnss_message_type_t>(MSG_CLASS::msg_type));
150 "[CObservationGPS::getMsgByClass] Cannot " 151 "find any observation of type `%s`",
152 typeid(MSG_CLASS).name()));
154 return *
dynamic_cast<MSG_CLASS*
>(it->second.get());
157 template <
class MSG_CLASS>
161 static_cast<gnss::gnss_message_type_t>(MSG_CLASS::msg_type));
164 "[CObservationGPS::getMsgByClass] Cannot " 165 "find any observation of type `%s`",
166 typeid(MSG_CLASS).name()));
168 return *
dynamic_cast<const MSG_CLASS*
>(it->second.get());
173 template <
class MSG_CLASS>
177 static_cast<gnss::gnss_message_type_t>(MSG_CLASS::msg_type));
179 ?
static_cast<MSG_CLASS*
>(
nullptr)
180 : dynamic_cast<MSG_CLASS*>(it->second.get());
183 template <
class MSG_CLASS>
187 static_cast<gnss::gnss_message_type_t>(MSG_CLASS::msg_type));
189 ?
dynamic_cast<MSG_CLASS*
>(
nullptr)
190 : dynamic_cast<MSG_CLASS*>(it->second.get());
212 std::ostream& o)
const override;
232 uint16_t gps_week,
double gps_sec,
233 const int leap_seconds_count
241 uint16_t gps_week,
double gps_sec,
const int leap_seconds_count,
bool has_GGA_datum() const
true if the corresponding field exists in messages.
MSG_CLASS * getMsgByClassPtr()
Like CObservationGPS::getMsgByClass() but returns a nullptr pointer if message is not found...
std::string std::string format(std::string_view fmt, ARGS &&... args)
void dumpToStream(std::ostream &out) const
Dumps the contents of the observation in a human-readable form to a given output stream.
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.
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...
#define ASSERT_(f)
Defines an assertion mechanism.
mrpt::Clock::time_point TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
bool has_RMC_datum() const
true if the corresponding field exists in messages.
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...
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.
This namespace contains representation of robot actions and observations.
bool has_satellite_timestamp
If true, CObservation::timestamp has been generated from accurate satellite clock.
#define ASSERTMSG_(f, __ERROR_MSG)
Defines an assertion mechanism.
std::map< gnss::gnss_message_type_t, gnss::gnss_message_ptr > message_list_t
MSG_CLASS & getMsgByClass()
Returns a reference to the message in the list CObservationGPS::messages of the requested class...
void clear()
Empties this observation, clearing the container messages.
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...
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).
mrpt::vision::TStereoCalibResults out
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)
void dumpToConsole(std::ostream &o) const
Dumps the contents of the observation in a human-readable form to an std::ostream (use std::cout to p...
bool hasMsgClass() const
Like hasMsgType() but allows querying for message classes, from any of those derived from mrpt::obs::...
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
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 INVALID_TIMESTAMP
Represents an invalid timestamp, where applicable.