MRPT  1.9.9
CObservation.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2019, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #include "obs-precomp.h" // Precompiled headers
11 
12 #include <mrpt/obs/CObservation.h>
14 #include <mrpt/system/os.h>
15 
16 #include <mrpt/poses/CPose3D.h>
17 #include <iomanip>
18 
19 using namespace mrpt::obs;
20 using namespace mrpt::poses;
21 using namespace mrpt::math;
22 
24 
25 void CObservation::getSensorPose(mrpt::math::TPose3D& out_sensorPose) const
26 {
27  CPose3D p;
28  getSensorPose(p);
29  out_sensorPose = p.asTPose();
30 }
31 
33 {
34  setSensorPose(CPose3D(newSensorPose));
35 }
36 
38 {
39  std::swap(timestamp, o.timestamp);
40  std::swap(sensorLabel, o.sensorLabel);
41 }
42 
43 void CObservation::getDescriptionAsText(std::ostream& o) const
44 {
45  using namespace mrpt::system; // for the TTimeStamp << op
46 
47  o << "Timestamp (UTC): " << mrpt::system::dateTimeToString(timestamp)
48  << std::endl;
49  o << " (as time_t): " << std::fixed << std::setprecision(5)
50  << mrpt::system::timestampTotime_t(timestamp) << std::endl;
51  o << " (as TTimestamp): " << timestamp << std::endl;
52  o << "Sensor label: '" << sensorLabel << "'" << std::endl;
53  o << std::endl;
54 }
#define IMPLEMENTS_VIRTUAL_SERIALIZABLE(class_name, base_class, NS)
This must be inserted as implementation of some required members for virtual CSerializable classes: ...
void swap(CObservation &o)
Swap with another observation, ONLY the data defined here in the base class CObservation.
This base provides a set of functions for maths stuff.
virtual void setSensorPose(const mrpt::poses::CPose3D &newSensorPose)=0
A general method to change the sensor pose on the robot.
double timestampTotime_t(const mrpt::system::TTimeStamp t) noexcept
Transform from TTimeStamp to standard "time_t" (actually a double number, it can contain fractions of...
Definition: datetime.h:105
This namespace contains representation of robot actions and observations.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
std::string sensorLabel
An arbitrary label that can be used to identify the sensor.
Definition: CObservation.h:62
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
mrpt::system::TTimeStamp timestamp
The associated UTC time-stamp.
Definition: CObservation.h:60
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:84
Declares a class that represents any robot&#39;s observation.
Definition: CObservation.h:43
std::string dateTimeToString(const mrpt::system::TTimeStamp t)
Convert a timestamp into this textual form (UTC time): YEAR/MONTH/DAY,HH:MM:SS.MMM.
Definition: datetime.cpp:148
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
Definition: TPose3D.h:23
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
GLfloat GLfloat p
Definition: glext.h:6398
virtual void getDescriptionAsText(std::ostream &o) const
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c26d46ba6 Thu Jul 18 13:03:42 2019 +0200 at jue jul 18 13:10:17 CEST 2019