24 : minSensorDistance(0),
26 sensorConeApperture(
DEG2RAD(20)),
35 out << minSensorDistance << maxSensorDistance << sensorConeApperture;
39 out << sensedData[i].sensorID <<
CPose3D(sensedData[i].sensorPose)
40 << sensedData[i].sensedDistance;
41 out << sensorLabel << timestamp;
57 in >> minSensorDistance >> maxSensorDistance >> sensorConeApperture;
62 for (i = 0; i <
n; i++)
65 in >> sensedData[i].sensorID;
67 sensedData[i].sensorID = i;
69 in >> aux >> sensedData[i].sensedDistance;
70 sensedData[i].sensorPose = aux.
asTPose();
94 if (!sensedData.empty())
95 out_sensorPose =
CPose3D(sensedData[0].sensorPose);
97 out_sensorPose =
CPose3D(0, 0, 0);
105 for (
auto& sd : sensedData) sd.sensorPose = newSensorPose.
asTPose();
113 o <<
"minSensorDistance = " << minSensorDistance <<
" m" << endl;
114 o <<
"maxSensorDistance = " << maxSensorDistance <<
" m" << endl;
115 o <<
"sensorConeApperture = " <<
RAD2DEG(sensorConeApperture) <<
" deg" 119 o <<
" SENSOR_ID RANGE (m) SENSOR POSE (on the robot)" << endl;
120 o <<
"-------------------------------------------------------" << endl;
121 for (
size_t q = 0;
q < sensedData.size();
q++)
123 o <<
format(
" %7u", (
unsigned int)sensedData[
q].sensorID);
124 o <<
format(
" %4.03f ", sensedData[
q].sensedDistance);
125 o << sensedData[
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)
This must be inserted in 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...