24 : sensorConeApperture(
DEG2RAD(20)), sensedData()
32 out << minSensorDistance << maxSensorDistance << sensorConeApperture;
36 out << sensedData[i].sensorID <<
CPose3D(sensedData[i].sensorPose)
37 << sensedData[i].sensedDistance;
38 out << sensorLabel << timestamp;
54 in >> minSensorDistance >> maxSensorDistance >> sensorConeApperture;
59 for (i = 0; i <
n; i++)
62 in >> sensedData[i].sensorID;
64 sensedData[i].sensorID = i;
66 in >> aux >> sensedData[i].sensedDistance;
67 sensedData[i].sensorPose = aux.
asTPose();
91 if (!sensedData.empty())
92 out_sensorPose =
CPose3D(sensedData[0].sensorPose);
94 out_sensorPose =
CPose3D(0, 0, 0);
102 for (
auto& sd : sensedData) sd.sensorPose = newSensorPose.
asTPose();
110 o <<
"minSensorDistance = " << minSensorDistance <<
" m" << endl;
111 o <<
"maxSensorDistance = " << maxSensorDistance <<
" m" << endl;
112 o <<
"sensorConeApperture = " <<
RAD2DEG(sensorConeApperture) <<
" deg" 116 o <<
" SENSOR_ID RANGE (m) SENSOR POSE (on the robot)" << endl;
117 o <<
"-------------------------------------------------------" << endl;
118 for (
const auto&
q : sensedData)
120 o <<
format(
" %7u", (
unsigned int)
q.sensorID);
121 o <<
format(
" %4.03f ",
q.sensedDistance);
122 o <<
q.sensorPose << endl;
mrpt::math::TPose3D asTPose() const
Declares a class derived from "CObservation" that encapsules a single range measurement, and associated parameters.
double RAD2DEG(const double x)
Radians to degrees.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
To be added to all CSerializable-classes implementation files.
double DEG2RAD(const double x)
Degrees to radians.
GLdouble GLdouble GLdouble GLdouble q
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
This namespace contains representation of robot actions and observations.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
Virtual base class for "archives": classes abstracting I/O streams.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Declares a class that represents any robot's observation.
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose) override
A general method to change the sensor pose on the robot.
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
unsigned __int32 uint32_t
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const override
A general method to retrieve the sensor pose on the robot.
#define INVALID_TIMESTAMP
Represents an invalid timestamp, where applicable.
virtual void getDescriptionAsText(std::ostream &o) const
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...