Class MapBase

Inheritance Relationships

Derived Types

Class Documentation

class MapBase

Base class for wavemap maps.

Subclassed by wavemap::HashedBlocks, wavemap::HashedChunkedWaveletOctree, wavemap::HashedWaveletOctree, wavemap::VolumetricOctree, wavemap::WaveletOctree

Public Types

using Ptr = std::shared_ptr<MapBase>
using ConstPtr = std::shared_ptr<const MapBase>
using IndexedLeafVisitorFunction = std::function<void(const OctreeIndex &index, FloatingPoint value)>

Public Functions

inline explicit MapBase(const MapBaseConfig &config)
virtual ~MapBase() = default
virtual bool empty() const = 0

Whether the map is empty.

virtual size_t size() const = 0

The number of cells or nodes in the map.

virtual void threshold() = 0

Threshold the occupancy values of all cells in the map to stay within the range specified by its min_log_odds and max_log_odds.

virtual void prune() = 0

Free up memory by pruning nodes that are no longer needed.

Note

Implementations of this pruning operation should be lossless and does not alter the estimated occupancy posterior.

inline virtual void pruneSmart()

Similar to prune(), but avoids de-allocating nodes that will likely be used again in the near future.

virtual void clear() = 0

Erase all cells in the map.

inline FloatingPoint getMinCellWidth() const

Maximum map resolution, set as width of smallest cell it can represent.

inline FloatingPoint getMinLogOdds() const

Lower threshold for the occupancy values stored in the map, in log-odds.

inline FloatingPoint getMaxLogOdds() const

Upper threshold for the occupancy values stored in the map, in log-odds.

virtual size_t getMemoryUsage() const = 0

The amount of memory used by the map, in bytes.

virtual IndexElement getTreeHeight() const = 0

Height of the octree used to store the map.

Note

This value is only defined for multi-resolution maps.

virtual Index3D getMinIndex() const = 0

Index of the minimum corner of the map’s Axis Aligned Bounding Box.

virtual Index3D getMaxIndex() const = 0

Index of the maximum corner of the map’s Axis Aligned Bounding Box.

virtual FloatingPoint getCellValue(const Index3D &index) const = 0

Query the value of the map at a given index.

virtual void setCellValue(const Index3D &index, FloatingPoint new_value) = 0

Set the value of the map at a given index.

virtual void addToCellValue(const Index3D &index, FloatingPoint update) = 0

Increment the value of the map at a given index.

virtual void forEachLeaf(IndexedLeafVisitorFunction visitor_fn) const = 0

Public Static Attributes

static constexpr int kDim = 3

Protected Functions

inline FloatingPoint clamp(FloatingPoint value) const
inline FloatingPoint clampedAdd(FloatingPoint value, FloatingPoint update) const

Protected Attributes

const MapBaseConfig config_