35 sensorLocationOnRobot(),
37 validCovariances(false),
56 out << minSensorDistance
60 << sensorLocationOnRobot
63 out << validCovariances;
64 if (!validCovariances)
65 out << sensor_std_range << sensor_std_yaw << sensor_std_pitch;
68 std::set<int32_t> lstIDs;
70 n = sensedData.size();
74 int32_t id = sensedData[i].landmarkID;
77 if (0!=lstIDs.count(
id))
82 out << sensedData[i].range
84 << sensedData[i].pitch
88 out << sensedData[i].covariance;
110 in >> minSensorDistance
111 >> maxSensorDistance;
115 in >> fieldOfView_yaw
116 >> fieldOfView_pitch;
124 fieldOfView_pitch = fieldOfView;
127 in >> sensorLocationOnRobot;
135 in >> validCovariances;
136 if (!validCovariances)
137 in >> sensor_std_range >> sensor_std_yaw >> sensor_std_pitch;
139 validCovariances =
false;
142 sensedData.resize(
n);
145 std::set<int32_t> lstIDs;
149 in >> sensedData[i].range
151 >> sensedData[i].pitch
152 >> sensedData[i].landmarkID;
154 if (
version>=3 && validCovariances)
155 in >> sensedData[i].covariance;
157 int32_t id = sensedData[i].landmarkID;
160 if (0!=lstIDs.count(
id))
168 else sensorLabel =
"";
183 printf(
"[CObservationBearingRange::debugPrintOut] Dumping:\n");
184 printf(
"[CObservationBearingRange::debugPrintOut] minSensorDistance:\t%f\n",minSensorDistance);
185 printf(
"[CObservationBearingRange::debugPrintOut] maxSensorDistance:\t%f:\n",maxSensorDistance);
186 printf(
"[CObservationBearingRange::debugPrintOut] %u landmarks:\n",static_cast<unsigned>(sensedData.size()) );
188 size_t i,
n = sensedData.size();
190 printf(
"[CObservationBearingRange::debugPrintOut] \tID[%i]: y:%fdeg p:%fdeg range: %f\n",
191 sensedData[i].landmarkID,
194 sensedData[i].
range );
202 o <<
"Homogeneous matrix for the sensor's 3D pose, relative to robot base:\n";
203 o << sensorLocationOnRobot.getHomogeneousMatrixVal()
204 << sensorLocationOnRobot << endl << endl;
206 o <<
"Do observations have individual covariance matrices? " << (validCovariances ?
"YES":
"NO") << endl << endl;
208 o <<
"Default noise sigmas:" << endl;
209 o <<
"sensor_std_range (m) : " << sensor_std_range << endl;
210 o <<
"sensor_std_yaw (deg) : " <<
RAD2DEG(sensor_std_yaw) << endl;
211 o <<
"sensor_std_pitch (deg) : " <<
RAD2DEG(sensor_std_pitch) << endl;
216 o <<
" LANDMARK_ID RANGE (m) YAW (deg) PITCH (deg) COV. MATRIX (optional)" << endl;
217 o <<
"--------------------------------------------------------------------------------------" << endl;
218 for (
size_t q=0;
q<sensedData.size();
q++)
224 else o <<
format(
"%7u",sensedData[
q].landmarkID);
226 o <<
format(
" %10.03f %10.03f %10.03f ",
231 if (validCovariances)
232 o << sensedData[
q].covariance.inMatlabFormat() << endl;
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
GLdouble GLdouble GLdouble GLdouble q
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const
Introduces a pure virtual method responsible for writing to a CStream.
IMPLEMENTS_SERIALIZABLE(CLogFileRecord_FullEval, CHolonomicLogFileRecord, mrpt::nav) IMPLEMENTS_SERIALIZABLE(CHolonomicFullEval
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 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...
T wrapToPi(T a)
Modifies the given angle to translate it into the ]-pi,pi] range.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
#define INVALID_TIMESTAMP
Represents an invalid timestamp, where applicable.
Declares a class that represents any robot's observation.
This file implements matrix/vector text and binary serialization.
This observation represents a number of range-bearing value pairs, each one for a detected landmark...
#define INVALID_LANDMARK_ID
Used for CObservationBearingRange::TMeasurement::beaconID and others.
void debugPrintOut()
Prints out the contents of the object.
unsigned __int32 uint32_t
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...
virtual void getDescriptionAsText(std::ostream &o) const
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...