Main MRPT website > C++ reference for MRPT 1.9.9
COctoMapBase.h
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 #ifndef MRPT_COctoMapBase_H
11 #define MRPT_COctoMapBase_H
12 
13 #include <mrpt/maps/CMetricMap.h>
16 #include <octomap/octomap.h>
19 #include <mrpt/obs/obs_frwds.h>
20 
21 namespace mrpt
22 {
23 namespace maps
24 {
25 /** A three-dimensional probabilistic occupancy grid, implemented as an
26  * octo-tree with the "octomap" C++ library.
27  * This base class represents a 3D map where each voxel may contain an
28  * "occupancy" property, RGBD data, etc. depending on the derived class.
29  *
30  * As with any other mrpt::maps::CMetricMap, you can obtain a 3D representation
31  * of the map calling getAs3DObject() or getAsOctoMapVoxels()
32  *
33  * To use octomap's iterators to go through the voxels, use
34  * COctoMap::getOctomap()
35  *
36  * The octomap library was presented in:
37  * - K. M. Wurm, A. Hornung, M. Bennewitz, C. Stachniss, and W. Burgard,
38  * <i>"OctoMap: A Probabilistic, Flexible, and Compact 3D Map Representation
39  * for Robotic Systems"</i>
40  * in Proc. of the ICRA 2010 Workshop on Best Practice in 3D Perception and
41  * Modeling for Mobile Manipulation, 2010. Software available at
42  * http://octomap.sf.net/.
43  *
44  * \sa CMetricMap, the example in "MRPT/samples/octomap_simple"
45  * \ingroup mrpt_maps_grp
46  */
47 template <class OCTREE, class OCTREE_NODE>
49 {
50  public:
51  /** The type of this MRPT class */
53  /** The type of the octree class in the "octomap" library. */
54  typedef OCTREE octree_t;
55  /** The type of nodes in the octree, in the "octomap" library. */
56  typedef OCTREE_NODE octree_node_t;
57 
58  /** Constructor, defines the resolution of the octomap (length of each voxel
59  * side) */
60  COctoMapBase(const double resolution = 0.10)
61  : insertionOptions(*this), m_octomap(resolution)
62  {
63  }
64  virtual ~COctoMapBase() {}
65  /** Get a reference to the internal octomap object. Example:
66  * \code
67  * mrpt::maps::COctoMap map;
68  * ...
69  * octomap::OcTree &om = map.getOctomap();
70  *
71  *
72  * \endcode
73  */
74  inline OCTREE& getOctomap() { return m_octomap; }
75  /** With this struct options are provided to the observation insertion
76  * process.
77  * \sa CObservation::insertObservationInto()
78  */
80  {
81  /** Initilization of default parameters */
82  TInsertionOptions(myself_t& parent);
83 
84  /** Especial constructor, not attached to a real COctoMap object: used
85  * only in limited situations, since get*() methods don't work, etc. */
88  {
89  // Copy all but the m_parent pointer!
90  maxrange = o.maxrange;
91  pruning = o.pruning;
92  const bool o_has_parent = o.m_parent.get() != nullptr;
94  o_has_parent ? o.getOccupancyThres() : o.occupancyThres);
95  setProbHit(o_has_parent ? o.getProbHit() : o.probHit);
96  setProbMiss(o_has_parent ? o.getProbMiss() : o.probMiss);
98  o_has_parent ? o.getClampingThresMin() : o.clampingThresMin);
100  o_has_parent ? o.getClampingThresMax() : o.clampingThresMax);
101  return *this;
102  }
103 
104  void loadFromConfigFile(
106  const std::string& section) override; // See base docs
107  void dumpToTextStream(
108  mrpt::utils::CStream& out) const override; // See base docs
109 
110  /** maximum range for how long individual beams are inserted (default
111  * -1: complete beam) */
112  double maxrange;
113  /** whether the tree is (losslessly) pruned after insertion (default:
114  * true) */
115  bool pruning;
116 
117  /// (key name in .ini files: "occupancyThres") sets the threshold for
118  /// occupancy (sensor model) (Default=0.5)
119  void setOccupancyThres(double prob)
120  {
121  if (m_parent.get()) m_parent->m_octomap.setOccupancyThres(prob);
122  }
123  /// (key name in .ini files: "probHit")sets the probablility for a "hit"
124  /// (will be converted to logodds) - sensor model (Default=0.7)
125  void setProbHit(double prob)
126  {
127  if (m_parent.get()) m_parent->m_octomap.setProbHit(prob);
128  }
129  /// (key name in .ini files: "probMiss")sets the probablility for a
130  /// "miss" (will be converted to logodds) - sensor model (Default=0.4)
131  void setProbMiss(double prob)
132  {
133  if (m_parent.get()) m_parent->m_octomap.setProbMiss(prob);
134  }
135  /// (key name in .ini files: "clampingThresMin")sets the minimum
136  /// threshold for occupancy clamping (sensor model) (Default=0.1192, -2
137  /// in log odds)
138  void setClampingThresMin(double thresProb)
139  {
140  if (m_parent.get())
141  m_parent->m_octomap.setClampingThresMin(thresProb);
142  }
143  /// (key name in .ini files: "clampingThresMax")sets the maximum
144  /// threshold for occupancy clamping (sensor model) (Default=0.971, 3.5
145  /// in log odds)
146  void setClampingThresMax(double thresProb)
147  {
148  if (m_parent.get())
149  m_parent->m_octomap.setClampingThresMax(thresProb);
150  }
151 
152  /// @return threshold (probability) for occupancy - sensor model
153  double getOccupancyThres() const
154  {
155  if (m_parent.get())
156  return m_parent->m_octomap.getOccupancyThres();
157  else
158  return this->occupancyThres;
159  }
160  /// @return threshold (logodds) for occupancy - sensor model
161  float getOccupancyThresLog() const
162  {
163  return m_parent->m_octomap.getOccupancyThresLog();
164  }
165 
166  /// @return probablility for a "hit" in the sensor model (probability)
167  double getProbHit() const
168  {
169  if (m_parent.get())
170  return m_parent->m_octomap.getProbHit();
171  else
172  return this->probHit;
173  }
174  /// @return probablility for a "hit" in the sensor model (logodds)
175  float getProbHitLog() const
176  {
177  return m_parent->m_octomap.getProbHitLog();
178  }
179  /// @return probablility for a "miss" in the sensor model (probability)
180  double getProbMiss() const
181  {
182  if (m_parent.get())
183  return m_parent->m_octomap.getProbMiss();
184  else
185  return this->probMiss;
186  }
187  /// @return probablility for a "miss" in the sensor model (logodds)
188  float getProbMissLog() const
189  {
190  return m_parent->m_octomap.getProbMissLog();
191  }
192 
193  /// @return minimum threshold for occupancy clamping in the sensor model
194  /// (probability)
195  double getClampingThresMin() const
196  {
197  if (m_parent.get())
198  return m_parent->m_octomap.getClampingThresMin();
199  else
200  return this->clampingThresMin;
201  }
202  /// @return minimum threshold for occupancy clamping in the sensor model
203  /// (logodds)
205  {
206  return m_parent->m_octomap.getClampingThresMinLog();
207  }
208  /// @return maximum threshold for occupancy clamping in the sensor model
209  /// (probability)
210  double getClampingThresMax() const
211  {
212  if (m_parent.get())
213  return m_parent->m_octomap.getClampingThresMax();
214  else
215  return this->clampingThresMax;
216  }
217  /// @return maximum threshold for occupancy clamping in the sensor model
218  /// (logodds)
220  {
221  return m_parent->m_octomap.getClampingThresMaxLog();
222  }
223 
224  private:
226 
227  double occupancyThres; // sets the threshold for occupancy (sensor
228  // model) (Default=0.5)
229  double probHit; // sets the probablility for a "hit" (will be converted
230  // to logodds) - sensor model (Default=0.7)
231  double probMiss; // sets the probablility for a "miss" (will be
232  // converted to logodds) - sensor model (Default=0.4)
233  double clampingThresMin; // sets the minimum threshold for occupancy
234  // clamping (sensor model) (Default=0.1192, -2
235  // in log odds)
236  double clampingThresMax; // sets the maximum threshold for occupancy
237  // clamping (sensor model) (Default=0.971, 3.5
238  // in log odds)
239  };
240 
241  /** The options used when inserting observations in the map */
242  TInsertionOptions insertionOptions;
243 
244  /** Options used when evaluating "computeObservationLikelihood"
245  * \sa CObservation::computeObservationLikelihood
246  */
248  {
249  /** Initilization of default parameters
250  */
252  virtual ~TLikelihoodOptions() {}
253  void loadFromConfigFile(
255  const std::string& section) override; // See base docs
256  void dumpToTextStream(
257  mrpt::utils::CStream& out) const override; // See base docs
258 
259  /** Binary dump to stream */
260  void writeToStream(mrpt::utils::CStream& out) const;
261  /** Binary dump to stream */
263 
264  /** Speed up the likelihood computation by considering only one out of N
265  * rays (default=1) */
267  };
268 
269  TLikelihoodOptions likelihoodOptions;
270 
271  /** Returns true if the map is empty/no observation has been inserted */
272  virtual bool isEmpty() const override;
273 
275  const std::string& filNamePrefix) const override;
276 
277  /** Options for the conversion of a mrpt::maps::COctoMap into a
278  * mrpt::opengl::COctoMapVoxels */
280  {
281  /** Generate grid lines for all octree nodes, useful to draw the
282  * "structure" of the octree, but computationally costly (Default:
283  * false) */
285 
286  /** Generate voxels for the occupied volumes (Default=true) */
288  /** Set occupied voxels visible (requires generateOccupiedVoxels=true)
289  * (Default=true) */
291 
292  /** Generate voxels for the freespace (Default=true) */
294  /** Set free voxels visible (requires generateFreeVoxels=true)
295  * (Default=true) */
297 
299  : generateGridLines(false),
301  visibleOccupiedVoxels(true),
302  generateFreeVoxels(true),
303  visibleFreeVoxels(true)
304  {
305  }
306 
307  /** Binary dump to stream */
308  void writeToStream(mrpt::utils::CStream& out) const;
309  /** Binary dump to stream */
311  };
312 
313  TRenderingOptions renderingOptions;
314 
315  /** Returns a 3D object representing the map.
316  * \sa renderingOptions
317  */
318  virtual void getAs3DObject(
319  mrpt::opengl::CSetOfObjects::Ptr& outObj) const override
320  {
322  mrpt::make_aligned_shared<mrpt::opengl::COctoMapVoxels>();
323  this->getAsOctoMapVoxels(*gl_obj);
324  outObj->insert(gl_obj);
325  }
326 
327  /** Builds a renderizable representation of the octomap as a
328  * mrpt::opengl::COctoMapVoxels object.
329  * \sa renderingOptions
330  */
331  virtual void getAsOctoMapVoxels(
332  mrpt::opengl::COctoMapVoxels& gl_obj) const = 0;
333 
334  /** Check whether the given point lies within the volume covered by the
335  * octomap (that is, whether it is "mapped") */
336  bool isPointWithinOctoMap(const float x, const float y, const float z) const
337  {
338  octomap::OcTreeKey key;
339  return m_octomap.coordToKeyChecked(octomap::point3d(x, y, z), key);
340  }
341 
342  /** Get the occupancy probability [0,1] of a point
343  * \return false if the point is not mapped, in which case the returned
344  * "prob" is undefined. */
345  bool getPointOccupancy(
346  const float x, const float y, const float z,
347  double& prob_occupancy) const;
348 
349  /** Manually updates the occupancy of the voxel at (x,y,z) as being occupied
350  * (true) or free (false), using the log-odds parameters in \a
351  * insertionOptions */
353  const double x, const double y, const double z, bool occupied)
354  {
355  m_octomap.updateNode(x, y, z, occupied);
356  }
357 
358  /** Update the octomap with a 2D or 3D scan, given directly as a point cloud
359  * and the 3D location of the sensor (the origin of the rays) in this map's
360  * frame of reference.
361  * Insertion parameters can be found in \a insertionOptions.
362  * \sa The generic observation insertion method
363  * CMetricMap::insertObservation()
364  */
365  void insertPointCloud(
366  const CPointsMap& ptMap, const float sensor_x, const float sensor_y,
367  const float sensor_z);
368 
369  /** Just like insertPointCloud but with a single ray. */
370  void insertRay(
371  const float end_x, const float end_y, const float end_z,
372  const float sensor_x, const float sensor_y, const float sensor_z)
373  {
374  m_octomap.insertRay(
375  octomap::point3d(sensor_x, sensor_y, sensor_z),
376  octomap::point3d(end_x, end_y, end_z), insertionOptions.maxrange,
378  }
379 
380  /** Performs raycasting in 3d, similar to computeRay().
381  *
382  * A ray is cast from origin with a given direction, the first occupied
383  * cell is returned (as center coordinate). If the starting coordinate is
384  * already
385  * occupied in the tree, this coordinate will be returned as a hit.
386  *
387  * @param origin starting coordinate of ray
388  * @param direction A vector pointing in the direction of the raycast. Does
389  * not need to be normalized.
390  * @param end returns the center of the cell that was hit by the ray, if
391  * successful
392  * @param ignoreUnknownCells whether unknown cells are ignored. If false
393  * (default), the raycast aborts when an unkown cell is hit.
394  * @param maxRange Maximum range after which the raycast is aborted (<= 0:
395  * no limit, default)
396  * @return whether or not an occupied cell was hit
397  */
398  bool castRay(
399  const mrpt::math::TPoint3D& origin,
400  const mrpt::math::TPoint3D& direction, mrpt::math::TPoint3D& end,
401  bool ignoreUnknownCells = false, double maxRange = -1.0) const;
402 
403  /** @name Direct access to octomap library methods
404  @{ */
405 
406  double getResolution() const { return m_octomap.getResolution(); }
407  unsigned int getTreeDepth() const { return m_octomap.getTreeDepth(); }
408  /// \return The number of nodes in the tree
409  size_t size() const { return m_octomap.size(); }
410  /// \return Memory usage of the complete octree in bytes (may vary between
411  /// architectures)
412  size_t memoryUsage() const { return m_octomap.memoryUsage(); }
413  /// \return Memory usage of the a single octree node
414  size_t memoryUsageNode() const { return m_octomap.memoryUsageNode(); }
415  /// \return Memory usage of a full grid of the same size as the OcTree in
416  /// bytes (for comparison)
417  size_t memoryFullGrid() const { return m_octomap.memoryFullGrid(); }
418  double volume() { return m_octomap.volume(); }
419  /// Size of OcTree (all known space) in meters for x, y and z dimension
420  void getMetricSize(double& x, double& y, double& z)
421  {
422  return m_octomap.getMetricSize(x, y, z);
423  }
424  /// Size of OcTree (all known space) in meters for x, y and z dimension
425  void getMetricSize(double& x, double& y, double& z) const
426  {
427  return m_octomap.getMetricSize(x, y, z);
428  }
429  /// minimum value of the bounding box of all known space in x, y, z
430  void getMetricMin(double& x, double& y, double& z)
431  {
432  return m_octomap.getMetricMin(x, y, z);
433  }
434  /// minimum value of the bounding box of all known space in x, y, z
435  void getMetricMin(double& x, double& y, double& z) const
436  {
437  return m_octomap.getMetricMin(x, y, z);
438  }
439  /// maximum value of the bounding box of all known space in x, y, z
440  void getMetricMax(double& x, double& y, double& z)
441  {
442  return m_octomap.getMetricMax(x, y, z);
443  }
444  /// maximum value of the bounding box of all known space in x, y, z
445  void getMetricMax(double& x, double& y, double& z) const
446  {
447  return m_octomap.getMetricMax(x, y, z);
448  }
449 
450  /// Traverses the tree to calculate the total number of nodes
451  size_t calcNumNodes() const { return m_octomap.calcNumNodes(); }
452  /// Traverses the tree to calculate the total number of leaf nodes
453  size_t getNumLeafNodes() const { return m_octomap.getNumLeafNodes(); }
454  /** @} */
455 
456  protected:
457  virtual void internal_clear() override { m_octomap.clear(); }
458  /** Builds the list of 3D points in global coordinates for a generic
459  * observation. Used for both, insertObservation() and computeLikelihood().
460  * \param[out] point3d_sensorPt Is a pointer to a "point3D".
461  * \param[out] ptr_scan Is in fact a pointer to "octomap::Pointcloud". Not
462  * declared as such to avoid headers dependencies in user code.
463  * \return false if the observation kind is not applicable.
464  */
466  const mrpt::obs::CObservation* obs,
467  const mrpt::poses::CPose3D* robotPose,
468  octomap::point3d& point3d_sensorPt,
469  octomap::Pointcloud& ptr_scan) const;
470 
471  /** The actual octo-map object. */
472  OCTREE m_octomap;
473 
474  private:
475  // See docs in base class
477  const mrpt::obs::CObservation* obs,
478  const mrpt::poses::CPose3D& takenFrom) override;
479 
480 }; // End of class def.
481 } // End of namespace
482 } // End of namespace
483 
484 #include "COctoMapBase_impl.h"
485 
486 #endif
bool getPointOccupancy(const float x, const float y, const float z, double &prob_occupancy) const
Get the occupancy probability [0,1] of a point.
virtual double internal_computeObservationLikelihood(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) override
Internal method called by computeObservationLikelihood()
Options for the conversion of a mrpt::maps::COctoMap into a mrpt::opengl::COctoMapVoxels.
Definition: COctoMapBase.h:279
virtual void saveMetricMapRepresentationToFile(const std::string &filNamePrefix) const override
This virtual method saves the map to a file "filNamePrefix"+< some_file_extension >...
size_t getNumLeafNodes() const
Traverses the tree to calculate the total number of leaf nodes.
Definition: COctoMapBase.h:453
void setOccupancyThres(double prob)
(key name in .ini files: "occupancyThres") sets the threshold for occupancy (sensor model) (Default=0...
Definition: COctoMapBase.h:119
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string &section) override
This method load the options from a ".ini"-like file or memory-stored string list.
GLdouble GLdouble z
Definition: glext.h:3872
void updateVoxel(const double x, const double y, const double z, bool occupied)
Manually updates the occupancy of the voxel at (x,y,z) as being occupied (true) or free (false)...
Definition: COctoMapBase.h:352
OCTREE m_octomap
The actual octo-map object.
Definition: COctoMapBase.h:472
OCTREE & getOctomap()
Get a reference to the internal octomap object.
Definition: COctoMapBase.h:74
void getMetricMax(double &x, double &y, double &z) const
maximum value of the bounding box of all known space in x, y, z
Definition: COctoMapBase.h:445
void writeToStream(mrpt::utils::CStream &out) const
Binary dump to stream.
std::shared_ptr< COctoMapVoxels > Ptr
COctoMapBase< OCTREE, OCTREE_NODE > myself_t
The type of this MRPT class.
Definition: COctoMapBase.h:52
bool visibleOccupiedVoxels
Set occupied voxels visible (requires generateOccupiedVoxels=true) (Default=true) ...
Definition: COctoMapBase.h:290
TLikelihoodOptions likelihoodOptions
Definition: COctoMapBase.h:269
void getMetricSize(double &x, double &y, double &z) const
Size of OcTree (all known space) in meters for x, y and z dimension.
Definition: COctoMapBase.h:425
void dumpToTextStream(mrpt::utils::CStream &out) const override
This method should clearly display all the contents of the structure in textual form, sending it to a CStream.
unsigned int getTreeDepth() const
Definition: COctoMapBase.h:407
void insertRay(const float end_x, const float end_y, const float end_z, const float sensor_x, const float sensor_y, const float sensor_z)
Just like insertPointCloud but with a single ray.
Definition: COctoMapBase.h:370
virtual void internal_clear() override
Internal method called by clear()
Definition: COctoMapBase.h:457
OCTREE_NODE octree_node_t
The type of nodes in the octree, in the "octomap" library.
Definition: COctoMapBase.h:56
virtual void getAs3DObject(mrpt::opengl::CSetOfObjects::Ptr &outObj) const override
Returns a 3D object representing the map.
Definition: COctoMapBase.h:318
This class allows loading and storing values and vectors of different types from a configuration text...
TInsertionOptions insertionOptions
The options used when inserting observations in the map.
Definition: COctoMapBase.h:242
A three-dimensional probabilistic occupancy grid, implemented as an octo-tree with the "octomap" C++ ...
Definition: COctoMapBase.h:48
A flexible renderer of voxels, typically from a 3D octo map (see mrpt::maps::COctoMap).
bool isPointWithinOctoMap(const float x, const float y, const float z) const
Check whether the given point lies within the volume covered by the octomap (that is...
Definition: COctoMapBase.h:336
TLikelihoodOptions()
Initilization of default parameters.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:41
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans or other sensors...
Definition: CPointsMap.h:63
void writeToStream(mrpt::utils::CStream &out) const
Binary dump to stream.
bool generateOccupiedVoxels
Generate voxels for the occupied volumes (Default=true)
Definition: COctoMapBase.h:287
bool internal_build_PointCloud_for_observation(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose, octomap::point3d &point3d_sensorPt, octomap::Pointcloud &ptr_scan) const
Builds the list of 3D points in global coordinates for a generic observation.
size_t memoryUsageNode() const
Definition: COctoMapBase.h:414
void dumpToTextStream(mrpt::utils::CStream &out) const override
This method should clearly display all the contents of the structure in textual form, sending it to a CStream.
GLuint GLuint end
Definition: glext.h:3528
size_t memoryUsage() const
Definition: COctoMapBase.h:412
std::shared_ptr< CSetOfObjects > Ptr
Definition: CSetOfObjects.h:32
bool generateGridLines
Generate grid lines for all octree nodes, useful to draw the "structure" of the octree, but computationally costly (Default: false)
Definition: COctoMapBase.h:284
size_t memoryFullGrid() const
Definition: COctoMapBase.h:417
void getMetricMin(double &x, double &y, double &z) const
minimum value of the bounding box of all known space in x, y, z
Definition: COctoMapBase.h:435
TInsertionOptions()
Especial constructor, not attached to a real COctoMap object: used only in limited situations...
void readFromStream(mrpt::utils::CStream &in)
Binary dump to stream.
GLsizei const GLchar ** string
Definition: glext.h:4101
bool castRay(const mrpt::math::TPoint3D &origin, const mrpt::math::TPoint3D &direction, mrpt::math::TPoint3D &end, bool ignoreUnknownCells=false, double maxRange=-1.0) const
Performs raycasting in 3d, similar to computeRay().
void getMetricSize(double &x, double &y, double &z)
Size of OcTree (all known space) in meters for x, y and z dimension.
Definition: COctoMapBase.h:420
virtual bool isEmpty() const override
Returns true if the map is empty/no observation has been inserted.
TInsertionOptions & operator=(const TInsertionOptions &o)
Definition: COctoMapBase.h:87
bool pruning
whether the tree is (losslessly) pruned after insertion (default: true)
Definition: COctoMapBase.h:115
void setClampingThresMax(double thresProb)
(key name in .ini files: "clampingThresMax")sets the maximum threshold for occupancy clamping (sensor...
Definition: COctoMapBase.h:146
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void setProbHit(double prob)
(key name in .ini files: "probHit")sets the probablility for a "hit" (will be converted to logodds) -...
Definition: COctoMapBase.h:125
void setProbMiss(double prob)
(key name in .ini files: "probMiss")sets the probablility for a "miss" (will be converted to logodds)...
Definition: COctoMapBase.h:131
bool generateFreeVoxels
Generate voxels for the freespace (Default=true)
Definition: COctoMapBase.h:293
Declares a virtual base class for all metric maps storage classes.
Definition: CMetricMap.h:55
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
double maxrange
maximum range for how long individual beams are inserted (default -1: complete beam) ...
Definition: COctoMapBase.h:112
Declares a class that represents any robot&#39;s observation.
Definition: CObservation.h:41
void insertPointCloud(const CPointsMap &ptMap, const float sensor_x, const float sensor_y, const float sensor_z)
Update the octomap with a 2D or 3D scan, given directly as a point cloud and the 3D location of the s...
GLuint in
Definition: glext.h:7274
size_t calcNumNodes() const
Traverses the tree to calculate the total number of nodes.
Definition: COctoMapBase.h:451
void readFromStream(mrpt::utils::CStream &in)
Binary dump to stream.
GLsizei GLsizei GLchar * source
Definition: glext.h:4082
uint32_t decimation
Speed up the likelihood computation by considering only one out of N rays (default=1) ...
Definition: COctoMapBase.h:266
void getMetricMin(double &x, double &y, double &z)
minimum value of the bounding box of all known space in x, y, z
Definition: COctoMapBase.h:430
GLenum GLint GLint y
Definition: glext.h:3538
With this struct options are provided to the observation insertion process.
Definition: COctoMapBase.h:79
bool visibleFreeVoxels
Set free voxels visible (requires generateFreeVoxels=true) (Default=true)
Definition: COctoMapBase.h:296
double getResolution() const
Definition: COctoMapBase.h:406
GLenum GLint x
Definition: glext.h:3538
OCTREE octree_t
The type of the octree class in the "octomap" library.
Definition: COctoMapBase.h:54
Lightweight 3D point.
mrpt::utils::ignored_copy_ptr< myself_t > m_parent
Definition: COctoMapBase.h:225
COctoMapBase(const double resolution=0.10)
Constructor, defines the resolution of the octomap (length of each voxel side)
Definition: COctoMapBase.h:60
Options used when evaluating "computeObservationLikelihood".
Definition: COctoMapBase.h:247
unsigned __int32 uint32_t
Definition: rptypes.h:47
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string &section) override
This method load the options from a ".ini"-like file or memory-stored string list.
void setClampingThresMin(double thresProb)
(key name in .ini files: "clampingThresMin")sets the minimum threshold for occupancy clamping (sensor...
Definition: COctoMapBase.h:138
A wrapper class for pointers whose copy operations from other objects of the same type are ignored...
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
virtual void getAsOctoMapVoxels(mrpt::opengl::COctoMapVoxels &gl_obj) const =0
Builds a renderizable representation of the octomap as a mrpt::opengl::COctoMapVoxels object...
TRenderingOptions renderingOptions
Definition: COctoMapBase.h:313
void getMetricMax(double &x, double &y, double &z)
maximum value of the bounding box of all known space in x, y, z
Definition: COctoMapBase.h:440



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