Main MRPT website > C++ reference for MRPT 1.9.9
CObservation2DRangeScan.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #include "obs-precomp.h" // Precompiled headers
11 
13 #include <mrpt/poses/CPosePDF.h>
14 #include <mrpt/utils/CStream.h>
15 #include <mrpt/math/CMatrix.h>
16 #include <mrpt/math/wrap2pi.h>
17 #if MRPT_HAS_MATLAB
18 #include <mexplus.h>
19 #endif
20 
21 using namespace std;
22 using namespace mrpt::obs;
23 using namespace mrpt::utils;
24 using namespace mrpt::poses;
25 using namespace mrpt::math;
26 
27 // This must be added to any CSerializable class implementation file.
29 
30 /*---------------------------------------------------------------
31  Constructor
32  ---------------------------------------------------------------*/
34  : m_scan(),
35  m_intensity(),
36  m_validRange(),
37  m_has_intensity(false),
38  scan(m_scan), // proxy ctor
39  intensity(m_intensity), // proxy ctor
40  validRange(m_validRange), // proxy ctor
41  aperture(M_PIf),
42  rightToLeft(true),
43  maxRange(80.0f),
44  sensorPose(),
45  stdError(0.01f),
46  beamAperture(0),
47  deltaPitch(0),
48  m_cachedMap()
49 {
50 }
51 
52 CObservation2DRangeScan::CObservation2DRangeScan(
53  const CObservation2DRangeScan& o)
54  : scan(m_scan), // proxy ctor
55  intensity(m_intensity), // proxy ctor
56  validRange(m_validRange) // proxy ctor
57 {
58  *this = o; // rely on compiler-generated copy op + the custom = operator in
59  // proxies.
60 }
61 
62 /*---------------------------------------------------------------
63  Destructor
64  ---------------------------------------------------------------*/
66 /*---------------------------------------------------------------
67  Implements the writing to a CStream capability of CSerializable objects
68  ---------------------------------------------------------------*/
70  mrpt::utils::CStream& out, int* version) const
71 {
72  if (version)
73  *version = 7;
74  else
75  {
76  // The data
77  out << aperture << rightToLeft << maxRange << sensorPose;
78  uint32_t N = scan.size();
79  out << N;
81  if (N)
82  {
83  out.WriteBufferFixEndianness(&m_scan[0], N);
84  out.WriteBuffer(&m_validRange[0], sizeof(m_validRange[0]) * N);
85  }
86  out << stdError;
87  out << timestamp;
88  out << beamAperture;
89 
90  out << sensorLabel;
91 
92  out << deltaPitch;
93 
94  out << hasIntensity();
96  }
97 }
98 
99 /*---------------------------------------------------------------
100  Filter out invalid points by a minimum distance, a maximum angle and a certain
101  distance at the end (z-coordinate of the lasers must be provided)
102  ---------------------------------------------------------------*/
104  float min_distance, float max_angle, float min_height, float max_height,
105  float h)
106 {
107  // FILTER OUT INVALID POINTS!!
110  CPose3D pose;
111  unsigned int k;
112  unsigned int nPts = scan.size();
113 
114  for (itScan = m_scan.begin(), itValid = m_validRange.begin(), k = 0;
115  itScan != m_scan.end(); itScan++, itValid++, k++)
116  {
117  float ang = fabs(k * aperture / nPts - aperture * 0.5);
118  float x = (*itScan) * cos(ang);
119 
120  if (min_height != 0 || max_height != 0)
121  {
122  ASSERT_(max_height > min_height);
123  if (*itScan < min_distance || ang > max_angle ||
124  x > h - min_height || x < h - max_height)
125  *itValid = false;
126  } // end if
127  else if (*itScan < min_distance || ang > max_angle)
128  *itValid = false;
129  }
130 }
131 
132 /*---------------------------------------------------------------
133  Implements the reading from a CStream capability of CSerializable objects
134  ---------------------------------------------------------------*/
136  mrpt::utils::CStream& in, int version)
137 {
138  switch (version)
139  {
140  case 0:
141  case 1:
142  case 2:
143  case 3:
144  {
145  CMatrix covSensorPose;
146  in >> aperture >> rightToLeft >> maxRange >> sensorPose >>
147  covSensorPose;
148  uint32_t N, i;
149 
150  in >> N;
151 
152  this->resizeScan(N);
153  if (N) in.ReadBufferFixEndianness(&m_scan[0], N);
154 
155  if (version >= 1)
156  { // Load validRange:
157  if (N)
158  in.ReadBuffer(
159  &m_validRange[0], sizeof(m_validRange[0]) * N);
160  }
161  else
162  {
163  // validRange: Default values: If distance is not maxRange
164  for (i = 0; i < N; i++) m_validRange[i] = scan[i] < maxRange;
165  }
166 
167  if (version >= 2)
168  {
169  in >> stdError;
170  }
171  else
172  {
173  stdError = 0.01f;
174  }
175 
176  if (version >= 3)
177  {
178  in >> timestamp;
179  }
180 
181  // Default values for newer versions:
182  beamAperture = DEG2RAD(0.25f);
183 
184  deltaPitch = 0;
185  sensorLabel = "";
186  }
187  break;
188 
189  case 4:
190  case 5:
191  case 6:
192  case 7:
193  {
194  uint32_t N;
195 
196  CMatrix covSensorPose;
198 
199  if (version < 6) // covSensorPose was removed in version 6
200  in >> covSensorPose;
201 
202  in >> N;
203  this->resizeScan(N);
204  if (N)
205  {
206  in.ReadBufferFixEndianness(&m_scan[0], N);
207  in.ReadBuffer(&m_validRange[0], sizeof(m_validRange[0]) * N);
208  }
209  in >> stdError;
210  in.ReadBufferFixEndianness(&timestamp, 1);
211  in >> beamAperture;
212 
213  if (version >= 5)
214  {
215  in >> sensorLabel;
216  in >> deltaPitch;
217  }
218  else
219  {
220  sensorLabel = "";
221  deltaPitch = 0;
222  }
223  if (version >= 7)
224  {
225  bool hasIntensity;
226  in >> hasIntensity;
228  if (hasIntensity && N)
229  {
230  in.ReadBufferFixEndianness(&m_intensity[0], N);
231  }
232  }
233  }
234  break;
235  default:
237  };
238 
239  m_cachedMap.reset();
240 }
241 
242 /*---------------------------------------------------------------
243  Implements the writing to a mxArray for Matlab
244  ---------------------------------------------------------------*/
245 #if MRPT_HAS_MATLAB
246 // Add to implement mexplus::from template specialization
248 
250 {
251  const char* fields[] = {
252  "class", // Data common to any MRPT class
253  "ts", "sensorLabel", // Data common to any observation
254  "scan", "validRange",
255  "intensity" // Received raw data
256  "aperture",
257  "rightToLeft", "maxRange", // Scan plane geometry and properties
258  "stdError", "beamAperture", "deltaPitch", // Ray properties
259  "pose", // Sensor pose
260  "map"}; // Points map
261  mexplus::MxArray obs_struct(
262  mexplus::MxArray::Struct(sizeof(fields) / sizeof(fields[0]), fields));
263 
264  obs_struct.set("class", this->GetRuntimeClass()->className);
265 
266  obs_struct.set("ts", this->timestamp);
267  obs_struct.set("sensorLabel", this->sensorLabel);
268 
269  obs_struct.set("scan", this->m_scan);
270  // TODO: "validRange should be a vector<bool> for Matlab instead of
271  // vector<char>" ==> JLBC: It cannot be done like that since serializing
272  // "bool" is not cross-platform safe, while "char" is...
273  obs_struct.set("validRange", this->m_validRange);
274  obs_struct.set("intensity", this->m_intensity);
275  obs_struct.set("aperture", this->aperture);
276  obs_struct.set("rightToLeft", this->rightToLeft);
277  obs_struct.set("maxRange", this->maxRange);
278  obs_struct.set("stdError", this->stdError);
279  obs_struct.set("beamAperture", this->beamAperture);
280  obs_struct.set("deltaPitch", this->deltaPitch);
281  obs_struct.set("pose", this->sensorPose);
282  // TODO: obs_struct.set("map", ...)
283  return obs_struct.release();
284 }
285 #endif
286 
287 /*---------------------------------------------------------------
288  isPlanarScan
289  ---------------------------------------------------------------*/
290 bool CObservation2DRangeScan::isPlanarScan(const double tolerance) const
291 {
292  return sensorPose.isHorizontal(tolerance);
293 }
294 
296 void CObservation2DRangeScan::setScanHasIntensity(bool setHasIntensityFlag)
297 {
298  m_has_intensity = setHasIntensityFlag;
299 }
300 
301 /*---------------------------------------------------------------
302  filterByExclusionAreas
303  ---------------------------------------------------------------*/
305  const TListExclusionAreasWithRanges& areas)
306 {
307  if (areas.empty()) return;
308 
309  MRPT_START
310 
311  double Ang, dA;
312  size_t sizeRangeScan = scan.size();
313 
314  ASSERT_(scan.size() == validRange.size());
315 
316  if (!sizeRangeScan) return;
317 
318  if (rightToLeft)
319  {
320  Ang = -0.5 * aperture;
321  dA = aperture / (sizeRangeScan - 1);
322  }
323  else
324  {
325  Ang = +0.5 * aperture;
326  dA = -aperture / (sizeRangeScan - 1);
327  }
328 
331 
332  for (scan_it = m_scan.begin(), valid_it = m_validRange.begin();
333  scan_it != m_scan.end(); scan_it++, valid_it++)
334  {
335  if (!*valid_it)
336  {
337  Ang += dA;
338  continue; // Already it's invalid
339  }
340 
341  // Compute point in 2D, local to the laser center:
342  const double Lx = *scan_it * cos(Ang);
343  const double Ly = *scan_it * sin(Ang);
344  Ang += dA;
345 
346  // To real 3D pose:
347  double Gx, Gy, Gz;
348  this->sensorPose.composePoint(Lx, Ly, 0, Gx, Gy, Gz);
349 
350  // Filter by X,Y:
351  for (TListExclusionAreasWithRanges::const_iterator i = areas.begin();
352  i != areas.end(); ++i)
353  {
354  if (i->first.PointIntoPolygon(Gx, Gy) &&
355  (Gz >= i->second.first && Gz <= i->second.second))
356  {
357  *valid_it = false;
358  break; // Go for next point
359  }
360  } // for each area
361  } // for each point
362 
363  MRPT_END
364 }
365 
366 /*---------------------------------------------------------------
367  filterByExclusionAreas
368  ---------------------------------------------------------------*/
370  const std::vector<mrpt::math::CPolygon>& areas)
371 {
372  if (areas.empty()) return;
373 
375  for (size_t i = 0; i < areas.size(); i++)
376  {
377  TListExclusionAreasWithRanges::value_type dat;
378  dat.first = areas[i];
379  dat.second.first = -std::numeric_limits<double>::max();
380  dat.second.second = std::numeric_limits<double>::max();
381 
382  lst.push_back(dat);
383  }
385 }
386 
387 /*---------------------------------------------------------------
388  filterByExclusionAngles
389  ---------------------------------------------------------------*/
391  const std::vector<std::pair<double, double>>& angles)
392 {
393  if (angles.empty()) return;
394 
395  MRPT_START
396 
397  double Ang, dA;
398  const size_t sizeRangeScan = scan.size();
399 
400  ASSERT_(scan.size() == validRange.size());
401 
402  if (!sizeRangeScan) return;
403 
404  if (rightToLeft)
405  {
406  Ang = -0.5 * aperture;
407  dA = aperture / (sizeRangeScan - 1);
408  }
409  else
410  {
411  Ang = +0.5 * aperture;
412  dA = -aperture / (sizeRangeScan - 1);
413  }
414 
415  // For each forbiden angle range:
416  for (vector<pair<double, double>>::const_iterator itA = angles.begin();
417  itA != angles.end(); ++itA)
418  {
419  int ap_idx_ini = mrpt::math::wrapTo2Pi(itA->first - Ang) /
420  dA; // The signs are all right! ;-)
421  int ap_idx_end = mrpt::math::wrapTo2Pi(itA->second - Ang) / dA;
422 
423  if (ap_idx_ini < 0) ap_idx_ini = 0;
424  if (ap_idx_end < 0) ap_idx_end = 0;
425 
426  if (ap_idx_ini > (int)sizeRangeScan) ap_idx_ini = sizeRangeScan - 1;
427  if (ap_idx_end > (int)sizeRangeScan) ap_idx_end = sizeRangeScan - 1;
428 
429  const size_t idx_ini = ap_idx_ini;
430  const size_t idx_end = ap_idx_end;
431 
432  if (idx_end >= idx_ini)
433  {
434  for (size_t i = idx_ini; i <= idx_end; i++) m_validRange[i] = false;
435  }
436  else
437  {
438  for (size_t i = 0; i < idx_end; i++) m_validRange[i] = false;
439 
440  for (size_t i = idx_ini; i < sizeRangeScan; i++)
441  m_validRange[i] = false;
442  }
443  }
444 
445  MRPT_END
446 }
447 
448 namespace mrpt
449 {
450 namespace obs
451 {
452 // Tricky way to call to a library that depends on us, a sort of "run-time"
453 // linking: ptr_internal_build_points_map_from_scan2D is a functor in
454 // "mrpt-obs", set by "mrpt-maps" at its startup.
455 using scan2pts_functor = void(*)(
457  mrpt::maps::CMetricMap::Ptr& out_map, const void* insertOps);
458 
460 
462 {
464 }
465 }
466 }
467 
468 /*---------------------------------------------------------------
469  internal_buildAuxPointsMap
470  ---------------------------------------------------------------*/
472  const void* options) const
473 {
475  throw std::runtime_error(
476  "[CObservation2DRangeScan::buildAuxPointsMap] ERROR: This function "
477  "needs linking against mrpt-maps.\n");
478 
479  (*ptr_internal_build_points_map_from_scan2D)(*this, m_cachedMap, options);
480 }
481 
482 /** Fill out a T2DScanProperties structure with the parameters of this scan */
484 {
485  p.nRays = this->scan.size();
486  p.aperture = this->aperture;
487  p.rightToLeft = this->rightToLeft;
488 }
489 
491  const T2DScanProperties& a, const T2DScanProperties& b)
492 {
493  if (a.nRays != b.nRays) return a.nRays < b.nRays;
494  if (a.aperture != b.aperture) return a.aperture < b.aperture;
495  if (a.rightToLeft != b.rightToLeft) return a.rightToLeft;
496  return false;
497 }
498 
500 {
502  o << "Homogeneous matrix for the sensor's 3D pose, relative to robot "
503  "base:\n";
505 
506  o << format(
507  "Samples direction: %s\n",
508  (rightToLeft) ? "Right->Left" : "Left->Right");
509  o << format("Points in the scan: %u\n", (unsigned)scan.size());
510  o << format("Estimated sensor 'sigma': %f\n", stdError);
511  o << format(
512  "Increment in pitch during the scan: %f deg\n", RAD2DEG(deltaPitch));
513 
514  size_t i, inval = 0;
515  for (i = 0; i < scan.size(); i++)
516  if (!validRange[i]) inval++;
517  o << format("Invalid points in the scan: %u\n", (unsigned)inval);
518 
519  o << format("Sensor maximum range: %.02f m\n", maxRange);
520  o << format(
521  "Sensor field-of-view (\"aperture\"): %.01f deg\n", RAD2DEG(aperture));
522 
523  o << "Raw scan values: [";
524  for (i = 0; i < scan.size(); i++) o << format("%.03f ", scan[i]);
525  o << "]\n";
526 
527  o << "Raw valid-scan values: [";
528  for (i = 0; i < validRange.size(); i++)
529  o << format("%u ", validRange[i] ? 1 : 0);
530  o << "]\n\n";
531 
532  if (hasIntensity())
533  {
534  o << "Raw intensity values: [";
535  for (i = 0; i < m_intensity.size(); i++)
536  o << format("%d ", m_intensity[i]);
537  o << "]\n\n";
538  }
539 }
540 
541 float CObservation2DRangeScan::getScanRange(const size_t i) const
542 {
543  ASSERT_BELOW_(i, m_scan.size());
544  return m_scan[i];
545 }
546 
547 void CObservation2DRangeScan::setScanRange(const size_t i, const float val)
548 {
549  ASSERT_BELOW_(i, m_scan.size());
550  m_scan[i] = val;
551 }
552 
554 {
555  ASSERT_BELOW_(i, m_intensity.size());
556  return m_intensity[i];
557 }
558 void CObservation2DRangeScan::setScanIntensity(const size_t i, const int val)
559 {
560  ASSERT_BELOW_(i, m_intensity.size());
561  m_intensity[i] = val;
562 }
563 
565 {
566  ASSERT_BELOW_(i, m_validRange.size());
567  return m_validRange[i] != 0;
568 }
570  const size_t i, const bool val)
571 {
572  ASSERT_BELOW_(i, m_validRange.size());
573  m_validRange[i] = val ? 1 : 0;
574 }
575 
577 {
578  const size_t capacity = mrpt::utils::length2length4N(len);
579  m_scan.reserve(capacity);
580  m_intensity.reserve(capacity);
581  m_validRange.reserve(capacity);
582 
583  m_scan.resize(len);
584  m_intensity.resize(len);
585  m_validRange.resize(len);
586 }
587 
589  const size_t len, const float rangeVal, const bool rangeValidity,
590  const int32_t rangeIntensity)
591 {
592  const size_t capacity = mrpt::utils::length2length4N(len);
593  m_scan.reserve(capacity);
594  m_intensity.reserve(capacity);
595  m_validRange.reserve(capacity);
596 
597  m_scan.assign(len, rangeVal);
598  m_validRange.assign(len, rangeValidity);
599  m_intensity.assign(len, rangeIntensity);
600 }
601 
602 size_t CObservation2DRangeScan::getScanSize() const { return m_scan.size(); }
604  size_t nRays, const float* scanRanges, const char* scanValidity)
605 {
606  ASSERT_(scanRanges);
607  ASSERT_(scanValidity);
608  resizeScan(nRays);
609  for (size_t i = 0; i < nRays; i++)
610  {
611  m_scan[i] = scanRanges[i];
612  m_validRange[i] = scanValidity[i];
613  }
614 }
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
void filterByExclusionAngles(const std::vector< std::pair< double, double >> &angles)
Mark as invalid the ranges in any of a given set of "forbiden angle ranges", given as pairs<min_angle...
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
scan2pts_functor ptr_internal_build_points_map_from_scan2D
float beamAperture
The aperture of each beam, in radians, used to insert "thick" rays in the occupancy grid...
bool isHorizontal(const double tolerance=0) const
Return true if the 6D pose represents a Z axis almost exactly vertical (upwards or downwards)...
Definition: CPose3D.cpp:682
void getScanProperties(T2DScanProperties &p) const
Fill out a T2DScanProperties structure with the parameters of this scan.
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const override
Introduces a pure virtual method responsible for writing to a CStream.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
void setScanRange(const size_t i, const float val)
#define ASSERT_BELOW_(__A, __B)
Scalar * iterator
Definition: eigen_plugins.h:26
void WriteBuffer(const void *Buffer, size_t Count)
Writes a block of bytes to the stream from Buffer.
Definition: CStream.cpp:64
bool operator<(const T2DScanProperties &a, const T2DScanProperties &b)
Order operator, so T2DScanProperties can appear in associative STL containers.
void setScanHasIntensity(bool setHasIntensityFlag)
Marks this scan as having or not intensity data.
void internal_set_build_points_map_from_scan2D(scan2pts_functor fn)
STL namespace.
const Scalar * const_iterator
Definition: eigen_plugins.h:27
float stdError
The "sigma" error of the device in meters, used while inserting the scan in an occupancy grid...
int32_t getScanIntensity(const size_t i) const
GLenum GLsizei len
Definition: glext.h:4712
size_t getScanSize() const
Get number of scan rays.
std::vector< char > m_validRange
It&#39;s false (=0) on no reflected rays, referenced to elements in scan.
float maxRange
The maximum range allowed by the device, in meters (e.g.
void WriteBufferFixEndianness(const T *ptr, size_t ElementCount)
Writes a sequence of elemental datatypes, taking care of reordering their bytes from the running arch...
Definition: CStream.h:159
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:41
This base provides a set of functions for maths stuff.
Definition: CArrayNumeric.h:19
T length2length4N(T len)
Returns the smaller number >=len such that it&#39;s a multiple of 4.
#define M_PIf
std::shared_ptr< CMetricMap > Ptr
Definition: CMetricMap.h:58
#define MRPT_END
mrpt::math::CMatrixDouble44 getHomogeneousMatrixVal() const
Definition: CPose3D.h:229
mrpt::maps::CMetricMap::Ptr m_cachedMap
A points map, build only under demand by the methods getAuxPointsMap() and buildAuxPointsMap().
bool isPlanarScan(const double tolerance=0) const
Return true if the laser scanner is "horizontal", so it has an absolute value of "pitch" and "roll" l...
Auxiliary struct that holds all the relevant geometry information about a 2D scan.
void internal_buildAuxPointsMap(const void *options=nullptr) const
Internal method, used from buildAuxPointsMap()
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
void setScanIntensity(const size_t i, const int val)
T wrapTo2Pi(T a)
Modifies the given angle to translate it into the [0,2pi[ range.
Definition: wrap2pi.h:41
std::vector< int32_t > m_intensity
The intensity values of the scan.
This namespace contains representation of robot actions and observations.
int val
Definition: mrpt_jpeglib.h:955
mrpt::utils::ContainerReadOnlyProxyAccessor< std::vector< char > > validRange
It&#39;s false (=0) on no reflected rays, referenced to elements in scan.
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
Definition: format.cpp:19
GLubyte GLubyte b
Definition: glext.h:6279
#define IMPLEMENTS_MEXPLUS_FROM(complete_type)
bool m_has_intensity
Whether the intensity values are present or not.
#define DEG2RAD
void resizeScanAndAssign(const size_t len, const float rangeVal, const bool rangeValidity, const int32_t rangeIntensity=0)
Resizes all data vectors to allocate a given number of scan rays and assign default values...
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Definition: CPoint.h:17
#define MRPT_START
__int32 int32_t
Definition: rptypes.h:46
std::string sensorLabel
An arbitrary label that can be used to identify the sensor.
Definition: CObservation.h:60
#define RAD2DEG
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
mrpt::system::TTimeStamp timestamp
The associated UTC time-stamp.
Definition: CObservation.h:58
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
virtual mxArray * writeToMatlab() const
Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class.
Definition: CSerializable.h:89
void truncateByDistanceAndAngle(float min_distance, float max_angle, float min_height=0, float max_height=0, float h=0)
A general method to truncate the scan by defining a minimum valid distance and a maximum valid angle ...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
std::vector< std::pair< mrpt::math::CPolygon, std::pair< double, double > > > TListExclusionAreasWithRanges
Used in filterByExclusionAreas.
Declares a class that represents any robot&#39;s observation.
Definition: CObservation.h:41
virtual const mrpt::utils::TRuntimeClassId * GetRuntimeClass() const override
Returns information about the class of an object in runtime.
void resizeScan(const size_t len)
Resizes all data vectors to allocate a given number of scan rays.
void composePoint(double lx, double ly, double lz, double &gx, double &gy, double &gz, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dpose=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dse3=nullptr, bool use_small_rot_approx=false) const
An alternative, slightly more efficient way of doing with G and L being 3D points and P this 6D pose...
Definition: CPose3D.cpp:453
double deltaPitch
If the laser gathers data by sweeping in the pitch/elevation angle, this holds the increment in "pitc...
GLuint in
Definition: glext.h:7274
static constexpr const char * className
float aperture
The "aperture" or field-of-view of the range finder, in radians (typically M_PI = 180 degrees)...
#define ASSERT_(f)
std::vector< float > m_scan
The range values of the scan, in meters.
void loadFromVectors(size_t nRays, const float *scanRanges, const char *scanValidity)
void(*)(const mrpt::obs::CObservation2DRangeScan &obs, mrpt::maps::CMetricMap::Ptr &out_map, const void *insertOps) scan2pts_functor
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
bool hasIntensity() const
Return true if scan has intensity.
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...
GLenum GLint x
Definition: glext.h:3538
mrpt::utils::ContainerReadOnlyProxyAccessor< std::vector< float > > scan
The range values of the scan, in meters.
void filterByExclusionAreas(const TListExclusionAreas &areas)
Mark as invalid sensed points that fall within any of a set of "exclusion areas", given in coordinate...
This class is a "CSerializable" wrapper for "CMatrixFloat".
Definition: CMatrix.h:25
bool rightToLeft
Angles storage order: true=counterclockwise; false=clockwise.
unsigned __int32 uint32_t
Definition: rptypes.h:47
GLubyte GLubyte GLubyte a
Definition: glext.h:6279
GLfloat GLfloat p
Definition: glext.h:6305
mrpt::poses::CPose3D sensorPose
The 6D pose of the sensor on the robot at the moment of starting the scan.
struct mxArray_tag mxArray
Forward declaration for mxArray (avoid #including as much as possible to speed up compiling) ...
Definition: CSerializable.h:19
bool rightToLeft
The scanning direction: true=counterclockwise; false=clockwise.
virtual void getDescriptionAsText(std::ostream &o) const
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
void setScanRangeValidity(const size_t i, const bool val)
bool getScanRangeValidity(const size_t i) const



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019