Class COctoMap
Defined in File COctoMap.h
Inheritance Relationships
Base Type
public mrpt::maps::COctoMapBase< octomap::OcTree, octomap::OcTreeNode >(Template Class COctoMapBase)
Class Documentation
-
class COctoMap : public mrpt::maps::COctoMapBase<octomap::OcTree, octomap::OcTreeNode>
A three-dimensional probabilistic occupancy grid, implemented as an octo-tree with the “octomap” C++ library. This version only stores occupancy information at each octree node. See the base class mrpt::maps::COctoMapBase.
The octomap library was presented in wurm2010octomap
See also
CMetricMap, the example in “MRPT/mrpt_examples_cpp/octomap_simple”
Direct access to octomap library methods
-
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.
-
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), using the log-odds parameters in insertionOptions
-
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, whether it is “mapped”)
-
double getResolution() const
-
unsigned int getTreeDepth() const
-
size_t size() const
- Returns:
The number of nodes in the tree
-
size_t memoryUsage() const
- Returns:
Memory usage of the complete octree in bytes (may vary between architectures)
-
size_t memoryUsageNode() const
- Returns:
Memory usage of the a single octree node
-
size_t memoryFullGrid() const
- Returns:
Memory usage of a full grid of the same size as the OcTree in bytes (for comparison)
-
double volume()
-
void getMetricSize(double &x, double &y, double &z)
Size of OcTree (all known space) in meters for x, y and z dimension.
-
void getMetricSize(double &x, double &y, double &z) const
Size of OcTree (all known space) in meters for x, y and z dimension.
-
void getMetricMin(double &x, double &y, double &z)
minimum value of the bounding box of all known space in x, y, z
-
void getMetricMin(double &x, double &y, double &z) const
minimum value of the bounding box of all known space in x, y, z
-
void getMetricMax(double &x, double &y, double &z)
maximum value of the bounding box of all known space in x, y, z
-
void getMetricMax(double &x, double &y, double &z) const
maximum value of the bounding box of all known space in x, y, z
-
size_t calcNumNodes() const
Traverses the tree to calculate the total number of nodes.
-
size_t getNumLeafNodes() const
Traverses the tree to calculate the total number of leaf nodes.
-
virtual void setOccupancyThres(double prob) override
-
virtual void setProbHit(double prob) override
-
virtual void setProbMiss(double prob) override
-
virtual void setClampingThresMin(double thresProb) override
-
virtual void setClampingThresMax(double thresProb) override
-
virtual double getOccupancyThres() const override
-
virtual float getOccupancyThresLog() const override
-
virtual double getProbHit() const override
-
virtual float getProbHitLog() const override
-
virtual double getProbMiss() const override
-
virtual float getProbMissLog() const override
-
virtual double getClampingThresMin() const override
-
virtual float getClampingThresMinLog() const override
-
virtual double getClampingThresMax() const override
-
virtual float getClampingThresMaxLog() const override
Public Functions
-
COctoMap(const double resolution = 0.10)
Default constructor.
-
~COctoMap() override
Destructor.
-
virtual void getAsOctoMapVoxels(mrpt::viz::COctoMapVoxels &gl_obj) const override
Builds a renderizable representation of the octomap as a mrpt::viz::COctoMapVoxels object.
See also
renderingOptions
-
inline virtual bool isEmpty() const override
Returns true if the map is empty/no observation has been inserted
Public Members
-
double resolution = 0.10
The finest resolution of the octomap (default: 0.10 meters)
Protected Functions
-
void internal_clear() override
-
bool internal_insertObservation(const mrpt::obs::CObservation &obs, const std::optional<const mrpt::poses::CPose3D> &robotPose) override
-
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)