25 : minSensorDistance(0),
27 sensorConeApperture(
DEG2RAD(20)),
45 out << minSensorDistance << maxSensorDistance << sensorConeApperture;
47 n = sensedData.size();
49 for (i = 0; i <
n; i++)
50 out << sensedData[i].sensorID <<
CPose3D(sensedData[i].sensorPose)
51 << sensedData[i].sensedDistance;
53 out << sensorLabel << timestamp;
72 in >> minSensorDistance >> maxSensorDistance >> sensorConeApperture;
77 for (i = 0; i <
n; i++)
80 in >> sensedData[i].sensorID;
82 sensedData[i].sensorID = i;
84 in >> aux >> sensedData[i].sensedDistance;
85 sensedData[i].sensorPose = aux;
109 if (!sensedData.empty())
110 out_sensorPose =
CPose3D(sensedData[0].sensorPose);
112 out_sensorPose =
CPose3D(0, 0, 0);
120 size_t i,
n = sensedData.size();
122 for (i = 0; i <
n; i++) sensedData[i].sensorPose = newSensorPose;
130 o <<
"minSensorDistance = " << minSensorDistance <<
" m" << endl;
131 o <<
"maxSensorDistance = " << maxSensorDistance <<
" m" << endl;
132 o <<
"sensorConeApperture = " <<
RAD2DEG(sensorConeApperture) <<
" deg" 136 o <<
" SENSOR_ID RANGE (m) SENSOR POSE (on the robot)" << endl;
137 o <<
"-------------------------------------------------------" << endl;
138 for (
size_t q = 0;
q < sensedData.size();
q++)
140 o <<
format(
" %7u", (
unsigned int)sensedData[
q].sensorID);
141 o <<
format(
" %4.03f ", sensedData[
q].sensedDistance);
142 o << sensedData[
q].sensorPose << endl;
Declares a class derived from "CObservation" that encapsules a single range measurement, and associated parameters.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
GLdouble GLdouble GLdouble GLdouble q
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const override
Introduces a pure virtual method responsible for writing to a CStream.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
This namespace contains representation of robot actions and observations.
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
void readFromStream(mrpt::utils::CStream &in, int version) override
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
#define INVALID_TIMESTAMP
Represents an invalid timestamp, where applicable.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Declares a class that represents any robot's observation.
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...
unsigned __int32 uint32_t
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const override
A general method to retrieve the sensor pose on the robot.
virtual void getDescriptionAsText(std::ostream &o) const
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...