Go to the documentation of this file.
25 : minSensorDistance(0),
26 maxSensorDistance(1e2f),
39 out << minSensorDistance << maxSensorDistance << stdError;
40 n = sensedData.size();
42 for (i = 0; i <
n; i++)
43 out << sensedData[i].sensorLocationOnRobot
44 << sensedData[i].sensedDistance << sensedData[i].beaconID;
45 out << auxEstimatePose;
46 out << sensorLabel << timestamp;
62 in >> minSensorDistance >> maxSensorDistance >> stdError;
66 for (i = 0; i <
n; i++)
68 in >> sensedData[i].sensorLocationOnRobot >>
69 sensedData[i].sensedDistance;
71 sensedData[i].beaconID =
id;
74 if (version >= 1)
in >> auxEstimatePose;
94 printf(
"[CObservationBeaconRanges::debugPrintOut] Dumping:\n");
96 "[CObservationBeaconRanges::debugPrintOut] minSensorDistance:\t%f\n",
99 "[CObservationBeaconRanges::debugPrintOut] maxSensorDistance:\t%f:\n",
102 "[CObservationBeaconRanges::debugPrintOut] stdError:\t%f\n", stdError);
104 "[CObservationBeaconRanges::debugPrintOut] %u ranges:\n",
105 static_cast<unsigned>(sensedData.size()));
107 size_t i,
n = sensedData.size();
108 for (i = 0; i <
n; i++)
110 "[CObservationBeaconRanges::debugPrintOut] \tID[%u]: %f\n",
111 sensedData[i].beaconID, sensedData[i].sensedDistance);
119 if (!sensedData.empty())
120 out_sensorPose =
CPose3D(sensedData[0].sensorLocationOnRobot);
122 out_sensorPose =
CPose3D(0, 0, 0);
130 size_t i,
n = sensedData.size();
132 for (i = 0; i <
n; i++)
133 sensedData[i].sensorLocationOnRobot =
CPoint3D(newSensorPose);
141 for (
size_t i = 0; i < sensedData.size(); i++)
142 if (sensedData[i].beaconID == beaconID)
143 return sensedData[i].sensedDistance;
152 o <<
"Auxiliary estimated pose (if available): " << auxEstimatePose << endl;
154 o <<
format(
"minSensorDistance=%f m\n", minSensorDistance);
155 o <<
format(
"maxSensorDistance=%f m\n", maxSensorDistance);
156 o <<
format(
"stdError=%f m\n\n", stdError);
159 "There are %u range measurements:\n\n", (
unsigned)sensedData.size());
161 o <<
" BEACON RANGE SENSOR POSITION ON ROBOT \n";
162 o <<
"------------------------------------------------\n";
165 it != sensedData.end(); it++)
168 " %i %.04f (%.03f,%.03f,%.03f)\n", (
int)it->beaconID,
169 it->sensedDistance, it->sensorLocationOnRobot.x(),
170 it->sensorLocationOnRobot.y(), it->sensorLocationOnRobot.z());
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const override
A general method to retrieve the sensor pose on the robot.
const Scalar * const_iterator
#define INVALID_TIMESTAMP
Represents an invalid timestamp, where applicable.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
This namespace contains representation of robot actions and observations.
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
Virtual base class for "archives": classes abstracting I/O streams.
Declares a class derived from "CObservation" that represents one (or more) range measurements to labe...
virtual void getDescriptionAsText(std::ostream &o) const
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose) override
A general method to change the sensor pose on the robot.
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
void debugPrintOut()
Prints out the contents of the object
Declares a class that represents any robot's observation.
A class used to store a 3D point.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
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 ...
unsigned __int32 uint32_t
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |