28 minSensorDistance ( 0 ),
29 maxSensorDistance ( 1e2f ),
48 out << minSensorDistance << maxSensorDistance << stdError;
50 n = sensedData.size();
53 out << sensedData[i].sensorLocationOnRobot << sensedData[i].sensedDistance << sensedData[i].beaconID;
55 out << auxEstimatePose;
77 in >> minSensorDistance >> maxSensorDistance >> stdError;
83 in >> sensedData[i].sensorLocationOnRobot >> sensedData[i].sensedDistance;
84 in >>
id; sensedData[i].beaconID =
id;
88 in >> auxEstimatePose;
112 printf(
"[CObservationBeaconRanges::debugPrintOut] Dumping:\n");
113 printf(
"[CObservationBeaconRanges::debugPrintOut] minSensorDistance:\t%f\n",minSensorDistance);
114 printf(
"[CObservationBeaconRanges::debugPrintOut] maxSensorDistance:\t%f:\n",maxSensorDistance);
115 printf(
"[CObservationBeaconRanges::debugPrintOut] stdError:\t%f\n",stdError);
116 printf(
"[CObservationBeaconRanges::debugPrintOut] %u ranges:\n",static_cast<unsigned>( sensedData.size() ));
118 size_t i,
n = sensedData.size();
120 printf(
"[CObservationBeaconRanges::debugPrintOut] \tID[%u]: %f\n",
121 sensedData[i].beaconID,
122 sensedData[i].sensedDistance );
130 if (!sensedData.empty())
131 out_sensorPose=
CPose3D(sensedData[0].sensorLocationOnRobot);
132 else out_sensorPose =
CPose3D(0,0,0);
140 size_t i,
n = sensedData.size();
143 sensedData[i].sensorLocationOnRobot=
CPoint3D(newSensorPose);
151 for (
size_t i=0;i<sensedData.size();i++)
152 if (sensedData[i].beaconID==beaconID)
153 return sensedData[i].sensedDistance;
162 o <<
"Auxiliary estimated pose (if available): " << auxEstimatePose << endl;
164 o <<
format(
"minSensorDistance=%f m\n",minSensorDistance);
165 o <<
format(
"maxSensorDistance=%f m\n",maxSensorDistance);
166 o <<
format(
"stdError=%f m\n\n",stdError);
168 o <<
format(
"There are %u range measurements:\n\n",(
unsigned)sensedData.size());
170 o <<
" BEACON RANGE SENSOR POSITION ON ROBOT \n";
171 o <<
"------------------------------------------------\n";
174 o <<
format(
" %i %.04f (%.03f,%.03f,%.03f)\n",
175 (
int)it->beaconID,it->sensedDistance,
176 it->sensorLocationOnRobot.x(),it->sensorLocationOnRobot.y(),it->sensorLocationOnRobot.z());
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.
void readFromStream(mrpt::utils::CStream &in, int version)
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
Declares a class derived from "CObservation" that represents one (or more) range measurements to labe...
const Scalar * const_iterator
float getSensedRangeByBeaconID(int32_t beaconID)
Easy look-up into the vector sensedData, returns the range for a given beacon, or 0 if the beacon is ...
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const MRPT_OVERRIDE
A general method to retrieve the sensor pose on the robot.
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.
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose) MRPT_OVERRIDE
A general method to change the sensor pose on the robot.
This namespace contains representation of robot actions and observations.
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
void getDescriptionAsText(std::ostream &o) const MRPT_OVERRIDE
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
A class used to store a 3D point.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
#define INVALID_TIMESTAMP
Represents an invalid timestamp, where applicable.
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const
Introduces a pure virtual method responsible for writing to a CStream.
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 debugPrintOut()
Prints out the contents of the object */.
unsigned __int32 uint32_t
virtual void getDescriptionAsText(std::ostream &o) const
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...