MRPT  2.0.4
CAngularObservationMesh.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <mrpt/maps/CPointsMap.h>
12 #include <mrpt/math/CMatrixB.h>
19 
20 #include <mrpt/math/geometry.h>
21 
22 namespace mrpt::opengl
23 {
24 /**
25  * A mesh built from a set of 2D laser scan observations.
26  * Each element of this set is a single scan through the yaw, given a specific
27  * pitch.
28  * Each scan has a mrpt::poses::CPose3D identifying the origin of the scan,
29  * which ideally is the
30  * same for every one of them.
31  *
32  * <div align="center">
33  * <table border="0" cellspan="4" cellspacing="4" style="border-width: 1px;
34  * border-style: solid;">
35  * <tr> <td> mrpt::opengl::CAngularObservationMesh </td> <td> \image html
36  * preview_CAngularObservationMesh.png </td> </tr>
37  * </table>
38  * </div>
39  *
40  * \ingroup mrpt_maps_grp
41  */
44 {
46  public:
47  /**
48  * Range specification type, with several uses.
49  */
50  struct TDoubleRange
51  {
52  private:
53  /**
54  * Range type.
55  * If 0, it's specified by an initial and a final value, and an
56  * increment.
57  * If 1, it's specified by an initial and a final value, and a fixed
58  * size of samples.
59  * If 2, it's specified by an aperture, a fixed size of samples and a
60  * boolean variable controlling direction. This type is always
61  * zero-centered.
62  */
63  char rangeType;
64  /**
65  * Union type with the actual data.
66  * \sa rangeType
67  */
68  union rd {
69  struct
70  {
71  double initial;
72  double final;
73  double increment;
74  } mode0;
75  struct
76  {
77  double initial;
78  double final;
79  size_t amount;
80  } mode1;
81  struct
82  {
83  double aperture;
84  size_t amount;
85  bool negToPos;
86  } mode2;
87  } rangeData;
88 
89  public:
90  /**
91  * Constructor from initial value, final value and range.
92  */
93  TDoubleRange(double a, double b, double c) : rangeType(0)
94  {
96  rangeData.mode0.final = b;
98  }
99  /**
100  * Constructor from initial value, final value and amount of samples.
101  */
102  TDoubleRange(double a, double b, size_t c) : rangeType(1)
103  {
104  rangeData.mode1.initial = a;
105  rangeData.mode1.final = b;
106  rangeData.mode1.amount = c;
107  }
108  /**
109  * Constructor from aperture, amount of samples and scan direction.
110  */
111  TDoubleRange(double a, size_t b, bool c) : rangeType(2)
112  {
114  rangeData.mode2.amount = b;
116  }
117  /**
118  * Creates a range of values from the initial value, the final value
119  * and the increment.
120  * \throw std::logic_error if the increment is zero.
121  */
123  double initial, double final, double increment)
124  {
125  if (increment == 0)
126  throw std::logic_error("Invalid increment value.");
127  return TDoubleRange(initial, final, increment);
128  }
129  /**
130  * Creates a range of values from the initial value, the final value
131  * and a desired amount of samples.
132  */
134  double initial, double final, size_t amount)
135  {
136  return TDoubleRange(initial, final, amount);
137  }
138  /**
139  * Creates a zero-centered range of values from an aperture, an amount
140  * of samples and a direction.
141  */
143  double aperture, size_t amount, bool negToPos = true)
144  {
146  }
147  /**
148  * Returns the total aperture of the range.
149  * \throw std::logic_error on invalid range type.
150  */
151  inline double aperture() const
152  {
153  switch (rangeType)
154  {
155  case 0:
156  return (mrpt::sign(rangeData.mode0.increment) ==
157  mrpt::sign(
160  ? fabs(
163  : 0;
164  case 1:
166  case 2:
167  return rangeData.mode2.aperture;
168  default:
169  throw std::logic_error("Unknown range type.");
170  }
171  }
172  /**
173  * Returns the first value of the range.
174  * \throw std::logic_error on invalid range type.
175  */
176  inline double initialValue() const
177  {
178  switch (rangeType)
179  {
180  case 0:
181  case 1:
182  return rangeData.mode0.initial;
183  case 2:
184  return rangeData.mode2.negToPos
185  ? -rangeData.mode2.aperture / 2
186  : rangeData.mode2.aperture / 2;
187  default:
188  throw std::logic_error("Unknown range type.");
189  }
190  }
191  /**
192  * Returns the last value of the range.
193  * \throw std::logic_error on invalid range type.
194  */
195  inline double finalValue() const
196  {
197  switch (rangeType)
198  {
199  case 0:
200  return (mrpt::sign(rangeData.mode0.increment) ==
201  mrpt::sign(
206  case 1:
207  return rangeData.mode1.final;
208  case 2:
209  return rangeData.mode2.negToPos
210  ? rangeData.mode2.aperture / 2
211  : -rangeData.mode2.aperture / 2;
212  default:
213  throw std::logic_error("Unknown range type.");
214  }
215  }
216  /**
217  * Returns the increment between two consecutive values of the range.
218  * \throw std::logic_error on invalid range type.
219  */
220  inline double increment() const
221  {
222  switch (rangeType)
223  {
224  case 0:
225  return rangeData.mode0.increment;
226  case 1:
228  static_cast<double>(rangeData.mode1.amount - 1);
229  case 2:
230  return rangeData.mode2.negToPos
232  static_cast<double>(
233  rangeData.mode2.amount - 1)
235  static_cast<double>(
236  rangeData.mode2.amount - 1);
237  default:
238  throw std::logic_error("Unknown range type.");
239  }
240  }
241  /**
242  * Returns the total amount of values in this range.
243  * \throw std::logic_error on invalid range type.
244  */
245  inline size_t amount() const
246  {
247  switch (rangeType)
248  {
249  case 0:
250  return (mrpt::sign(rangeData.mode0.increment) ==
251  mrpt::sign(
254  ? 1 + static_cast<size_t>(ceil(
258  : 1;
259  case 1:
260  return rangeData.mode1.amount;
261  case 2:
262  return rangeData.mode2.amount;
263  default:
264  throw std::logic_error("Unknown range type.");
265  }
266  }
267  /**
268  * Gets a vector with every value in the range.
269  * \throw std::logic_error on invalid range type.
270  */
271  void values(std::vector<double>& vals) const;
272  /**
273  * Returns the direction of the scan. True if the increment is
274  * positive, false otherwise.
275  * \throw std::logic_error on invalid range type.
276  */
277  inline bool negToPos() const
278  {
279  switch (rangeType)
280  {
281  case 0:
282  return mrpt::sign(rangeData.mode0.increment) > 0;
283  case 1:
284  return mrpt::sign(
286  rangeData.mode1.initial) > 0;
287  case 2:
288  return rangeData.mode2.negToPos;
289  default:
290  throw std::logic_error("Unknown range type.");
291  }
292  }
293  };
294 
295  void getBoundingBox(
297  mrpt::math::TPoint3D& bb_max) const override;
298 
299  protected:
300  /** Updates the mesh, if needed. It's a const method, but modifies mutable
301  * content. */
302  void updateMesh() const;
303  /** Actual set of triangles to be displayed. */
304  mutable std::vector<mrpt::opengl::TTriangle> triangles;
305  /** Internal method to add a triangle to the mutable mesh. */
306  void addTriangle(
307  const mrpt::math::TPoint3D& p1, const mrpt::math::TPoint3D& p2,
308  const mrpt::math::TPoint3D& p3) const;
309  /** Whether the mesh will be displayed wireframe or solid. */
310  bool m_Wireframe{true};
311  /** Mutable variable which controls if the object has suffered any change
312  * since last time the mesh was updated. */
313  mutable bool meshUpToDate{false};
314  /** Whether the object may present transparencies or not. */
316  /** Mutable object with the mesh's points. */
319  /** Scan validity matrix. */
321  /** Observation pitch range. When containing exactly two elements, they
322  * represent the bounds. */
323  std::vector<double> pitchBounds;
324  /** Actual scan set which is used to generate the mesh. */
325  std::vector<mrpt::obs::CObservation2DRangeScan> scanSet;
326 
327  public:
328  /**
329  * Basic constructor.
330  */
332  : actualMesh(0, 0), validityMatrix(0, 0), pitchBounds(), scanSet()
333  {
334  }
335  /** Empty destructor. */
336  ~CAngularObservationMesh() override = default;
337  /**
338  * Returns whether the object is configured as wireframe or solid.
339  */
340  inline bool isWireframe() const { return m_Wireframe; }
341  /**
342  * Sets the display mode for the object. True=wireframe, False=solid.
343  */
344  inline void setWireframe(bool enabled = true)
345  {
346  m_Wireframe = enabled;
348  }
349  /**
350  * Returns whether the object may be transparent or not.
351  */
352  inline bool isTransparencyEnabled() const { return mEnableTransparency; }
353  /**
354  * Enables or disables transparencies.
355  */
356  inline void enableTransparency(bool enabled = true)
357  {
358  mEnableTransparency = enabled;
360  }
361 
362  /** @name Renderizable shader API virtual methods
363  * @{ */
364  void freeOpenGLResources() override
365  {
368  }
369  void render(const RenderContext& rc) const override;
370  void renderUpdateBuffers() const override;
371 
372  virtual shader_list_t requiredShaders() const override
373  {
374  // May use up to two shaders (triangles and lines):
376  }
377  void onUpdateBuffers_Wireframe() override;
378  void onUpdateBuffers_Triangles() override;
379  /** @} */
380 
381  /**
382  * Traces a ray to the object, returning the distance to a given pose
383  * through its X axis.
384  * \sa mrpt::opengl::CRenderizable,trace2DSetOfRays,trace1DSetOfRays
385  */
386  bool traceRay(const mrpt::poses::CPose3D& o, double& dist) const override;
387  /**
388  * Sets the pitch bounds for this range.
389  */
390  void setPitchBounds(const double initial, const double final);
391  /**
392  * Sets the pitch bounds for this range.
393  */
394  void setPitchBounds(const std::vector<double>& bounds);
395  /**
396  * Gets the initial and final pitch bounds for this range.
397  */
398  void getPitchBounds(double& initial, double& final) const;
399  /**
400  * Gets the pitch bounds for this range.
401  */
402  void getPitchBounds(std::vector<double>& bounds) const;
403  /**
404  * Gets the scan set.
405  */
406  void getScanSet(
407  std::vector<mrpt::obs::CObservation2DRangeScan>& scans) const;
408  /**
409  * Sets the scan set.
410  */
411  bool setScanSet(
412  const std::vector<mrpt::obs::CObservation2DRangeScan>& scans);
413  /**
414  * Gets the mesh as a set of triangles, for displaying them.
415  * \sa generateSetOfTriangles(std::vector<TPolygon3D>
416  * &),mrpt::opengl::CSetOfTriangles,mrpt::opengl::mrpt::opengl::TTriangle
417  */
419  /**
420  * Returns the scanned points as a 3D point cloud. The target pointmap must
421  * be passed as a pointer to allow the use of any derived class.
422  */
423  void generatePointCloud(mrpt::maps::CPointsMap* out_map) const;
424  /**
425  * Gets a set of lines containing the traced rays, for displaying them.
426  * \sa getUntracedRays,mrpt::opengl::CSetOfLines
427  */
428  void getTracedRays(CSetOfLines::Ptr& res) const;
429  /**
430  * Gets a set of lines containing the untraced rays, up to a specified
431  * distance, for displaying them.
432  * \sa getTracedRays,mrpt::opengl::CSetOfLines
433  */
434  void getUntracedRays(CSetOfLines::Ptr& res, double dist) const;
435  /**
436  * Gets the mesh as a set of polygons, to work with them.
437  * \sa generateSetOfTriangles(mrpt::opengl::CSetOfTriangles &)
438  */
439  void generateSetOfTriangles(std::vector<mrpt::math::TPolygon3D>& res) const;
440  /**
441  * Retrieves the full mesh, along with the validity matrix.
442  */
445  mrpt::math::CMatrixBool& validity) const
446  {
447  if (!meshUpToDate) updateMesh();
448  pts = actualMesh;
449  validity = validityMatrix;
450  }
451 
452  private:
453  /**
454  * Internal functor class to trace a ray.
455  */
456  template <class T>
457  class FTrace1D
458  {
459  protected:
461  const T& e;
462  std::vector<double>& values;
463  std::vector<char>& valid;
464 
465  public:
467  const T& s, const mrpt::poses::CPose3D& p, std::vector<double>& v,
468  std::vector<char>& v2)
469  : initial(p), e(s), values(v), valid(v2)
470  {
471  }
472  void operator()(double yaw)
473  {
474  double dist;
475  const mrpt::poses::CPose3D pNew =
476  initial + mrpt::poses::CPose3D(0.0, 0.0, 0.0, yaw, 0.0, 0.0);
477  if (e->traceRay(pNew, dist))
478  {
479  values.push_back(dist);
480  valid.push_back(1);
481  }
482  else
483  {
484  values.push_back(0);
485  valid.push_back(0);
486  }
487  }
488  };
489  /**
490  * Internal functor class to trace a set of rays.
491  */
492  template <class T>
493  class FTrace2D
494  {
495  protected:
496  const T& e;
500  std::vector<mrpt::obs::CObservation2DRangeScan>& vObs;
502 
503  public:
505  const T& s, const mrpt::poses::CPose3D& p,
508  std::vector<mrpt::obs::CObservation2DRangeScan>& obs,
509  const mrpt::poses::CPose3D& b)
510  : e(s), initial(p), caom(om), yaws(y), vObs(obs), pBase(b)
511  {
512  }
513  void operator()(double pitch)
514  {
515  std::vector<double> yValues;
516  yaws.values(yValues);
519  const mrpt::poses::CPose3D pNew =
520  initial + mrpt::poses::CPose3D(0, 0, 0, 0, pitch, 0);
521  std::vector<double> values;
522  std::vector<char> valid;
523  size_t nY = yValues.size();
524  values.reserve(nY);
525  valid.reserve(nY);
526  for_each(
527  yValues.begin(), yValues.end(),
528  FTrace1D<T>(e, pNew, values, valid));
529  o.aperture = yaws.aperture();
530  o.rightToLeft = yaws.negToPos();
531  o.maxRange = 10000;
532  o.sensorPose = pNew;
533  o.deltaPitch = 0;
534  o.resizeScan(values.size());
535  for (size_t i = 0; i < values.size(); i++)
536  {
537  o.setScanRange(i, values[i]);
538  o.setScanRangeValidity(i, valid[i] != 0);
539  }
540  vObs.push_back(o);
541  }
542  };
543 
544  public:
545  /**
546  * 2D ray tracing (will generate a 3D mesh). Given an object and two
547  * ranges, realizes a scan from the initial pose and stores it in a
548  * CAngularObservationMesh object.
549  * The objective may be a COpenGLScene, a CRenderizable or any children of
550  * its.
551  * \sa mrpt::opengl::CRenderizable,mrpt::opengl::COpenGLScene.
552  */
553  template <class T>
554  static void trace2DSetOfRays(
555  const T& e, const mrpt::poses::CPose3D& initial,
556  CAngularObservationMesh::Ptr& caom, const TDoubleRange& pitchs,
557  const TDoubleRange& yaws);
558  /**
559  * 2D ray tracing (will generate a vectorial mesh inside a plane). Given an
560  * object and a range, realizes a scan from the initial pose and stores it
561  * in a CObservation2DRangeScan object.
562  * The objective may be a COpenGLScene, a CRenderizable or any children of
563  * its.
564  * \sa mrpt::opengl::CRenderizable,mrpt::opengl::COpenGLScene.
565  */
566  template <class T>
567  static void trace1DSetOfRays(
568  const T& e, const mrpt::poses::CPose3D& initial,
570  {
571  std::vector<double> yValues;
572  yaws.values(yValues);
575  size_t nV = yaws.amount();
576  scanValues.reserve(nV);
577  valid.reserve(nV);
578  for_each(
579  yValues.begin(), yValues.end(),
580  FTrace1D<T>(e, initial, scanValues, valid));
581  obs.aperture = yaws.aperture();
582  obs.rightToLeft = yaws.negToPos();
583  obs.maxRange = 10000;
584  obs.sensorPose = initial;
585  obs.deltaPitch = 0;
586  for (size_t i = 0; i < nV; i++)
587  {
588  obs.setScanRange(i, scanValues[i]);
589  obs.setScanRangeValidity(i, valid[i]);
590  }
591  }
592 };
593 
594 template <class T>
596  const T& e, const mrpt::poses::CPose3D& initial,
597  CAngularObservationMesh::Ptr& caom, const TDoubleRange& pitchs,
598  const TDoubleRange& yaws)
599 {
600  std::vector<double> pValues;
601  pitchs.values(pValues);
602  std::vector<mrpt::obs::CObservation2DRangeScan> vObs;
603  vObs.reserve(pValues.size());
604  for_each(
605  pValues.begin(), pValues.end(),
606  FTrace2D<T>(e, initial, caom, yaws, vObs, initial));
607  caom->m_Wireframe = false;
608  caom->mEnableTransparency = false;
609  caom->setPitchBounds(pValues);
610  caom->setScanSet(vObs);
611 }
612 } // namespace mrpt::opengl
void getUntracedRays(CSetOfLines::Ptr &res, double dist) const
Gets a set of lines containing the untraced rays, up to a specified distance, for displaying them...
bool meshUpToDate
Mutable variable which controls if the object has suffered any change since last time the mesh was up...
bool negToPos() const
Returns the direction of the scan.
A mesh built from a set of 2D laser scan observations.
Internal functor class to trace a set of rays.
Internal functor class to trace a ray.
struct mrpt::opengl::CAngularObservationMesh::TDoubleRange::rd::@8 mode2
Trivially copiable underlying data for TPoint3D 1-byte memory packed, no padding].
Definition: TPoint3D.h:26
FTrace2D(const T &s, const mrpt::poses::CPose3D &p, CAngularObservationMesh::Ptr &om, const CAngularObservationMesh::TDoubleRange &y, std::vector< mrpt::obs::CObservation2DRangeScan > &obs, const mrpt::poses::CPose3D &b)
TDoubleRange(double a, size_t b, bool c)
Constructor from aperture, amount of samples and scan direction.
void freeOpenGLResources() override
Free opengl buffers.
void setScanRange(const size_t i, const float val)
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
Renderizable generic renderer for objects using the triangles shader.
struct mrpt::opengl::CAngularObservationMesh::TDoubleRange::rd::@7 mode1
std::vector< T, mrpt::aligned_allocator_cpp11< T > > aligned_std_vector
std::vector< mrpt::obs::CObservation2DRangeScan > & vObs
bool mEnableTransparency
Whether the object may present transparencies or not.
void setWireframe(bool enabled=true)
Sets the display mode for the object.
void getTracedRays(CSetOfLines::Ptr &res) const
Gets a set of lines containing the traced rays, for displaying them.
std::vector< shader_id_t > shader_list_t
A list of shader IDs.
Definition: Shader.h:26
std::vector< mrpt::opengl::TTriangle > triangles
Actual set of triangles to be displayed.
bool isTransparencyEnabled() const
Returns whether the object may be transparent or not.
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers, etc.
void getScanSet(std::vector< mrpt::obs::CObservation2DRangeScan > &scans) const
Gets the scan set.
void values(std::vector< double > &vals) const
Gets a vector with every value in the range.
float maxRange
The maximum range allowed by the device, in meters (e.g.
double finalValue() const
Returns the last value of the range.
mrpt::math::CMatrixDynamic< mrpt::math::TPoint3D_data< double > > actualMesh
Mutable object with the mesh&#39;s points.
void getPitchBounds(double &initial, double &final) const
Gets the initial and final pitch bounds for this range.
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans or other sensors...
Definition: CPointsMap.h:67
mrpt::math::CMatrixB validityMatrix
Scan validity matrix.
void generateSetOfTriangles(CSetOfTriangles::Ptr &res) const
Gets the mesh as a set of triangles, for displaying them.
static constexpr shader_id_t WIREFRAME
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable.
struct mrpt::opengl::CAngularObservationMesh::TDoubleRange::rd::@6 mode0
double initialValue() const
Returns the first value of the range.
size_t amount() const
Returns the total amount of values in this range.
FTrace1D(const T &s, const mrpt::poses::CPose3D &p, std::vector< double > &v, std::vector< char > &v2)
int sign(T x)
Returns the sign of X as "1" or "-1".
void getActualMesh(mrpt::math::CMatrixDynamic< mrpt::math::TPoint3D_data< double >> &pts, mrpt::math::CMatrixBool &validity) const
Retrieves the full mesh, along with the validity matrix.
double increment() const
Returns the increment between two consecutive values of the range.
void onUpdateBuffers_Triangles() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
static constexpr shader_id_t TRIANGLES
static TDoubleRange CreateFromIncrement(double initial, double final, double increment)
Creates a range of values from the initial value, the final value and the increment.
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
static void trace1DSetOfRays(const T &e, const mrpt::poses::CPose3D &initial, mrpt::obs::CObservation2DRangeScan &obs, const TDoubleRange &yaws)
2D ray tracing (will generate a vectorial mesh inside a plane).
void addTriangle(const mrpt::math::TPoint3D &p1, const mrpt::math::TPoint3D &p2, const mrpt::math::TPoint3D &p3) const
Internal method to add a triangle to the mutable mesh.
void freeOpenGLResources() override
Free opengl buffers.
~CAngularObservationMesh() override=default
Empty destructor.
static TDoubleRange CreateFromAmount(double initial, double final, size_t amount)
Creates a range of values from the initial value, the final value and a desired amount of samples...
const CAngularObservationMesh::TDoubleRange & yaws
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:85
void resizeScan(const size_t len)
Resizes all data vectors to allocate a given number of scan rays.
void generatePointCloud(mrpt::maps::CPointsMap *out_map) const
Returns the scanned points as a 3D point cloud.
static TDoubleRange CreateFromAperture(double aperture, size_t amount, bool negToPos=true)
Creates a zero-centered range of values from an aperture, an amount of samples and a direction...
Renderizable generic renderer for objects using the wireframe shader.
double deltaPitch
If the laser gathers data by sweeping in the pitch/elevation angle, this holds the increment in "pitc...
void onUpdateBuffers_Wireframe() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:13
union mrpt::opengl::CAngularObservationMesh::TDoubleRange::rd rangeData
float aperture
The "aperture" or field-of-view of the range finder, in radians (typically M_PI = 180 degrees)...
double aperture() const
Returns the total aperture of the range.
const auto bb_max
std::vector< mrpt::obs::CObservation2DRangeScan > scanSet
Actual scan set which is used to generate the mesh.
Range specification type, with several uses.
TDoubleRange(double a, double b, size_t c)
Constructor from initial value, final value and amount of samples.
This class is a "CSerializable" wrapper for "CMatrixBool".
Definition: CMatrixB.h:21
bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override
Traces a ray to the object, returning the distance to a given pose through its X axis.
TDoubleRange(double a, double b, double c)
Constructor from initial value, final value and range.
void updateMesh() const
Updates the mesh, if needed.
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
const auto bb_min
void enableTransparency(bool enabled=true)
Enables or disables transparencies.
void setPitchBounds(const double initial, const double final)
Sets the pitch bounds for this range.
static void trace2DSetOfRays(const T &e, const mrpt::poses::CPose3D &initial, CAngularObservationMesh::Ptr &caom, const TDoubleRange &pitchs, const TDoubleRange &yaws)
2D ray tracing (will generate a 3D mesh).
void freeOpenGLResources() override
Free opengl buffers.
virtual shader_list_t requiredShaders() const override
Returns the ID of the OpenGL shader program required to render this class.
bool setScanSet(const std::vector< mrpt::obs::CObservation2DRangeScan > &scans)
Sets the scan set.
This template class provides the basic functionality for a general 2D any-size, resizable container o...
bool m_Wireframe
Whether the mesh will be displayed wireframe or solid.
mrpt::poses::CPose3D sensorPose
The 6D pose of the sensor on the robot at the moment of starting the scan.
std::vector< double > pitchBounds
Observation pitch range.
bool isWireframe() const
Returns whether the object is configured as wireframe or solid.
bool rightToLeft
The scanning direction: true=counterclockwise; false=clockwise.
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const override
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
void setScanRangeValidity(const size_t i, const bool val)



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020