Main MRPT website > C++ reference for MRPT 1.4.0
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes
octomap::OcTree Class Reference

Detailed Description

octomap main map data structure, stores 3D occupancy grid map in an OcTree.

Basic functionality is implemented in OcTreeBase.

Definition at line 63 of file OcTree.h.

#include <mrpt/otherlibs/octomap/OcTree.h>

Inheritance diagram for octomap::OcTree:
Inheritance graph

Classes

class  StaticMemberInitializer
 Static member object which ensures that this OcTree's prototype ends up in the classIDMapping only once. More...
 

Public Types

typedef OcTreeNode NodeType
 Make the templated NODE type available from the outside. More...
 
typedef leaf_iterator iterator
 

Public Member Functions

 OcTree (double resolution)
 Default constructor, sets resolution of leafs. More...
 
 OcTree (std::string _filename)
 Reads an OcTree from a binary file. More...
 
virtual ~OcTree ()
 
OcTreecreate () const
 virtual constructor: creates a new object of same type (Covariant return type requires an up-to-date compiler) More...
 
std::string getTreeType () const
 returns actual class name as string for identification More...
 
virtual void insertScan (const Pointcloud &scan, const octomap::point3d &sensor_origin, double maxrange=-1., bool pruning=true, bool lazy_eval=false)
 Integrate a Pointcloud (in global reference frame) More...
 
virtual void insertScan (const Pointcloud &scan, const point3d &sensor_origin, const pose6d &frame_origin, double maxrange=-1., bool pruning=true, bool lazy_eval=false)
 Integrate a 3d scan, transform scan before tree update. More...
 
virtual void insertScan (const ScanNode &scan, double maxrange=-1., bool pruning=true, bool lazy_eval=false)
 Insert a 3d scan (given as a ScanNode) into the tree. More...
 
void insertScan_templ (const SCAN &scan, const octomap::point3d &sensor_origin, double maxrange=-1., bool pruning=true, bool lazy_eval=false)
 
virtual void insertScanNaive (const Pointcloud &pc, const point3d &origin, double maxrange, bool pruning=true, bool lazy_eval=false)
 for testing only More...
 
virtual OcTreeNodeupdateNode (const OcTreeKey &key, float log_odds_update, bool lazy_eval=false)
 Manipulate log_odds value of voxel directly. More...
 
virtual OcTreeNodeupdateNode (const point3d &value, float log_odds_update, bool lazy_eval=false)
 Manipulate log_odds value of voxel directly. More...
 
virtual OcTreeNodeupdateNode (double x, double y, double z, float log_odds_update, bool lazy_eval=false)
 Manipulate log_odds value of voxel directly. More...
 
virtual OcTreeNodeupdateNode (const OcTreeKey &key, bool occupied, bool lazy_eval=false)
 Integrate occupancy measurement. More...
 
virtual OcTreeNodeupdateNode (const point3d &value, bool occupied, bool lazy_eval=false)
 Integrate occupancy measurement. More...
 
virtual OcTreeNodeupdateNode (double x, double y, double z, bool occupied, bool lazy_eval=false)
 Integrate occupancy measurement. More...
 
virtual void toMaxLikelihood ()
 Creates the maximum likelihood map by calling toMaxLikelihood on all tree nodes, setting their occupancy to the corresponding occupancy thresholds. More...
 
virtual bool insertRay (const point3d &origin, const point3d &end, double maxrange=-1.0, bool lazy_eval=false)
 Insert one ray between origin and end into the tree. More...
 
virtual bool castRay (const point3d &origin, const point3d &direction, point3d &end, bool ignoreUnknownCells=false, double maxRange=-1.0) const
 Performs raycasting in 3d, similar to computeRay(). More...
 
 DEPRECATED (void getOccupied(point3d_list &node_centers, unsigned int max_depth=0) const)
 Convenience function to return all occupied nodes in the OcTree. More...
 
 DEPRECATED (void getOccupied(std::list< OcTreeVolume > &occupied_volumes, unsigned int max_depth=0) const)
 Convenience function to return all occupied nodes in the OcTree. More...
 
 DEPRECATED (void getOccupied(std::list< OcTreeVolume > &binary_nodes, std::list< OcTreeVolume > &delta_nodes, unsigned int max_depth=0) const)
 Traverses the tree and collects all OcTreeVolumes regarded as occupied. More...
 
 DEPRECATED (void getOccupiedLeafsBBX(point3d_list &node_centers, point3d min, point3d max) const)
 returns occupied leafs within a bounding box defined by min and max. More...
 
 DEPRECATED (void getFreespace(std::list< OcTreeVolume > &free_volumes, unsigned int max_depth=0) const)
 Convenience function to return all free nodes in the OcTree. More...
 
 DEPRECATED (void getFreespace(std::list< OcTreeVolume > &binary_nodes, std::list< OcTreeVolume > &delta_nodes, unsigned int max_depth=0) const)
 Traverses the tree and collects all OcTreeVolumes regarded as free. More...
 
 DEPRECATED (bool genKeyValue(double coordinate, unsigned short int &keyval) const)
 
 DEPRECATED (bool genKey(const point3d &point, OcTreeKey &key) const )
 
 DEPRECATED (bool genKeyValueAtDepth(const unsigned short int keyval, unsigned int depth, unsigned short int &out_keyval) const )
 
 DEPRECATED (bool genKeyAtDepth(const OcTreeKey &key, unsigned int depth, OcTreeKey &out_key) const )
 
 DEPRECATED (bool genCoordFromKey(const unsigned short int &key, unsigned depth, float &coord) const )
 
 DEPRECATED (inline bool genCoordFromKey(const unsigned short int &key, float &coord, unsigned depth) const)
 
 DEPRECATED (inline bool genCoordFromKey(const unsigned short int &key, float &coord) const)
 
 DEPRECATED (double genCoordFromKey(const unsigned short int &key, unsigned depth) const)
 
 DEPRECATED (inline double genCoordFromKey(const unsigned short int &key) const)
 
 DEPRECATED (inline bool genCoords(const OcTreeKey &key, unsigned int depth, point3d &point) const)
 
 DEPRECATED (inline void genPos(const OcTreeKey &key, int depth, unsigned int &pos) const)
 generate child index (between 0 and 7) from key at given tree depth DEPRECATED More...
 
void useBBXLimit (bool enable)
 use or ignore BBX limit (default: ignore) More...
 
bool bbxSet () const
 
void setBBXMin (point3d &min)
 sets the minimum for a query bounding box to use More...
 
void setBBXMax (point3d &max)
 sets the maximum for a query bounding box to use More...
 
point3d getBBXMin () const
 
point3d getBBXMax () const
 
point3d getBBXBounds () const
 
point3d getBBXCenter () const
 
bool inBBX (const point3d &p) const
 
bool inBBX (const OcTreeKey &key) const
 
void enableChangeDetection (bool enable)
 track or ignore changes while inserting scans (default: ignore) More...
 
void resetChangeDetection ()
 Reset the set of changed keys. Call this after you obtained all changed nodes. More...
 
KeyBoolMap::const_iterator changedKeysBegin ()
 Iterator to traverse all keys of changed nodes. More...
 
KeyBoolMap::const_iterator changedKeysEnd ()
 Iterator to traverse all keys of changed nodes. More...
 
void computeUpdate (const Pointcloud &scan, const octomap::point3d &origin, KeySet &free_cells, KeySet &occupied_cells, double maxrange)
 Helper for insertScan. More...
 
void computeUpdate_templ (const POINTCLOUD &scan, const octomap::point3d &origin, KeySet &free_cells, KeySet &occupied_cells, double maxrange)
 
void computeUpdate_onePoint (const point3d &p, const octomap::point3d &origin, KeySet &free_cells, KeySet &occupied_cells, double maxrange)
 
std::istream & readBinaryData (std::istream &s)
 Reads only the data (=tree structure) from the input stream. More...
 
std::istream & readBinaryNode (std::istream &s, OcTreeNode *node) const
 Read node from binary stream (max-likelihood value), recursively continue with all children. More...
 
std::ostream & writeBinaryNode (std::ostream &s, const OcTreeNode *node) const
 Write node to binary stream (max-likelihood value), recursively continue with all children. More...
 
std::ostream & writeBinaryData (std::ostream &s) const
 Writes the data of the tree (without header) to the stream, recursively calling writeBinaryNode (starting with root) More...
 
void calcNumThresholdedNodes (unsigned int &num_thresholded, unsigned int &num_other) const
 
void updateInnerOccupancy ()
 Updates the occupancy of all inner nodes to reflect their children's occupancy. More...
 
virtual void integrateHit (OcTreeNode *occupancyNode) const
 integrate a "hit" measurement according to the tree's sensor model More...
 
virtual void integrateMiss (OcTreeNode *occupancyNode) const
 integrate a "miss" measurement according to the tree's sensor model More...
 
virtual void updateNodeLogOdds (OcTreeNode *occupancyNode, const float &update) const
 
virtual void nodeToMaxLikelihood (OcTreeNode *occupancyNode) const
 converts the node to the maximum likelihood value according to the tree's parameter for "occupancy" More...
 
virtual void nodeToMaxLikelihood (OcTreeNode &occupancyNode) const
 converts the node to the maximum likelihood value according to the tree's parameter for "occupancy" More...
 
bool operator== (const OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree > &rhs) const
 
void setResolution (double r)
 Change the resolution of the octree, scaling all voxels. More...
 
double getResolution () const
 
unsigned int getTreeDepth () const
 
double getNodeSize (unsigned depth) const
 
OcTreeNodegetRoot () const
 
OcTreeNodesearch (double x, double y, double z, unsigned int depth=0) const
 Search node at specified depth given a 3d point (depth=0: search full tree depth) More...
 
OcTreeNodesearch (const point3d &value, unsigned int depth=0) const
 Search node at specified depth given a 3d point (depth=0: search full tree depth) More...
 
OcTreeNodesearch (const OcTreeKey &key, unsigned int depth=0) const
 Search a node at specified depth given an addressing key (depth=0: search full tree depth) More...
 
bool deleteNode (double x, double y, double z, unsigned int depth=0)
 Delete a node (if exists) given a 3d point. More...
 
bool deleteNode (const point3d &value, unsigned int depth=0)
 Delete a node (if exists) given a 3d point. More...
 
bool deleteNode (const OcTreeKey &key, unsigned int depth=0)
 Delete a node (if exists) given an addressing key. More...
 
void clear ()
 Deletes the complete tree structure (only the root node will remain) More...
 
virtual void prune ()
 Lossless compression of OcTree: merge children to parent when there are eight children with identical values. More...
 
virtual void expand ()
 Expands all pruned nodes (reverse of prune()) More...
 
virtual size_t size () const
 
virtual size_t memoryUsage () const
 
virtual size_t memoryUsageNode () const
 
size_t memoryFullGrid () const
 
double volume () const
 
virtual void getMetricSize (double &x, double &y, double &z)
 Size of OcTree (all known space) in meters for x, y and z dimension. More...
 
virtual void getMetricSize (double &x, double &y, double &z) const
 Size of OcTree (all known space) in meters for x, y and z dimension. More...
 
virtual void getMetricMin (double &x, double &y, double &z)
 minimum value of the bounding box of all known space in x, y, z More...
 
void getMetricMin (double &x, double &y, double &z) const
 minimum value of the bounding box of all known space in x, y, z More...
 
virtual void getMetricMax (double &x, double &y, double &z)
 maximum value of the bounding box of all known space in x, y, z More...
 
void getMetricMax (double &x, double &y, double &z) const
 maximum value of the bounding box of all known space in x, y, z More...
 
size_t calcNumNodes () const
 Traverses the tree to calculate the total number of nodes. More...
 
size_t getNumLeafNodes () const
 Traverses the tree to calculate the total number of leaf nodes. More...
 
void getUnknownLeafCenters (point3d_list &node_centers, point3d pmin, point3d pmax) const
 return centers of leafs that do NOT exist (but could) in a given bounding box More...
 
bool computeRayKeys (const point3d &origin, const point3d &end, KeyRay &ray) const
 Traces a ray from origin to end (excluding), returning an OcTreeKey of all nodes traversed by the beam. More...
 
bool computeRay (const point3d &origin, const point3d &end, std::vector< point3d > &ray)
 Traces a ray from origin to end (excluding), returning the coordinates of all nodes traversed by the beam. More...
 
std::istream & readData (std::istream &s)
 Read all nodes from the input stream (without file header), for this the tree needs to be already created. More...
 
std::ostream & writeData (std::ostream &s) const
 Write complete state of tree to stream (without file header) unmodified. More...
 
iterator begin (unsigned char maxDepth=0) const
 
const iterator end () const
 
leaf_iterator begin_leafs (unsigned char maxDepth=0) const
 
const leaf_iterator end_leafs () const
 
leaf_bbx_iterator begin_leafs_bbx (const OcTreeKey &min, const OcTreeKey &max, unsigned char maxDepth=0) const
 
leaf_bbx_iterator begin_leafs_bbx (const point3d &min, const point3d &max, unsigned char maxDepth=0) const
 
const leaf_bbx_iterator end_leafs_bbx () const
 
tree_iterator begin_tree (unsigned char maxDepth=0) const
 
const tree_iterator end_tree () const
 
unsigned short int coordToKey (double coordinate) const
 Converts from a single coordinate into a discrete key. More...
 
unsigned short int coordToKey (double coordinate, unsigned depth) const
 Converts from a single coordinate into a discrete key at a given depth. More...
 
OcTreeKey coordToKey (const point3d &coord) const
 Converts from a 3D coordinate into a 3D addressing key. More...
 
OcTreeKey coordToKey (double x, double y, double z) const
 Converts from a 3D coordinate into a 3D addressing key. More...
 
OcTreeKey coordToKey (const point3d &coord, unsigned depth) const
 Converts from a 3D coordinate into a 3D addressing key at a given depth. More...
 
OcTreeKey coordToKey (double x, double y, double z, unsigned depth) const
 Converts from a 3D coordinate into a 3D addressing key at a given depth. More...
 
OcTreeKey adjustKeyAtDepth (const OcTreeKey &key, unsigned int depth) const
 Adjusts a 3D key from the lowest level to correspond to a higher depth (by shifting the key values) More...
 
unsigned short int adjustKeyAtDepth (unsigned short int key, unsigned int depth) const
 Adjusts a single key value from the lowest level to correspond to a higher depth (by shifting the key value) More...
 
bool coordToKeyChecked (const point3d &coord, OcTreeKey &key) const
 Converts a 3D coordinate into a 3D OcTreeKey, with boundary checking. More...
 
bool coordToKeyChecked (const point3d &coord, unsigned depth, OcTreeKey &key) const
 Converts a 3D coordinate into a 3D OcTreeKey at a certain depth, with boundary checking. More...
 
bool coordToKeyChecked (double x, double y, double z, OcTreeKey &key) const
 Converts a 3D coordinate into a 3D OcTreeKey, with boundary checking. More...
 
bool coordToKeyChecked (double x, double y, double z, unsigned depth, OcTreeKey &key) const
 Converts a 3D coordinate into a 3D OcTreeKey at a certain depth, with boundary checking. More...
 
bool coordToKeyChecked (double coordinate, unsigned short int &key) const
 Converts a single coordinate into a discrete addressing key, with boundary checking. More...
 
bool coordToKeyChecked (double coordinate, unsigned depth, unsigned short int &key) const
 Converts a single coordinate into a discrete addressing key, with boundary checking. More...
 
double keyToCoord (unsigned short int key, unsigned depth) const
 converts from a discrete key at a given depth into a coordinate corresponding to the key's center More...
 
double keyToCoord (unsigned short int key) const
 converts from a discrete key at the lowest tree level into a coordinate corresponding to the key's center More...
 
point3d keyToCoord (const OcTreeKey &key) const
 converts from an addressing key at the lowest tree level into a coordinate corresponding to the key's center More...
 
point3d keyToCoord (const OcTreeKey &key, unsigned depth) const
 converts from an addressing key at a given depth into a coordinate corresponding to the key's center More...
 
bool writeBinary (const std::string &filename)
 Writes OcTree to a binary file using writeBinary(). More...
 
bool writeBinary (std::ostream &s)
 Writes compressed maximum likelihood OcTree to a binary stream. More...
 
bool writeBinaryConst (const std::string &filename) const
 Writes OcTree to a binary file using writeBinaryConst(). More...
 
bool writeBinaryConst (std::ostream &s) const
 Writes the maximum likelihood OcTree to a binary stream (const variant). More...
 
bool readBinary (std::istream &s)
 Reads an OcTree from an input stream. More...
 
bool readBinary (const std::string &filename)
 Reads OcTree from a binary file. More...
 
bool isNodeOccupied (const OcTreeNode *occupancyNode) const
 queries whether a node is occupied according to the tree's parameter for "occupancy" More...
 
bool isNodeOccupied (const OcTreeNode &occupancyNode) const
 queries whether a node is occupied according to the tree's parameter for "occupancy" More...
 
bool isNodeAtThreshold (const OcTreeNode *occupancyNode) const
 queries whether a node is at the clamping threshold according to the tree's parameter More...
 
bool isNodeAtThreshold (const OcTreeNode &occupancyNode) const
 queries whether a node is at the clamping threshold according to the tree's parameter More...
 
void setOccupancyThres (double prob)
 sets the threshold for occupancy (sensor model) More...
 
void setProbHit (double prob)
 sets the probablility for a "hit" (will be converted to logodds) - sensor model More...
 
void setProbMiss (double prob)
 sets the probablility for a "miss" (will be converted to logodds) - sensor model More...
 
void setClampingThresMin (double thresProb)
 sets the minimum threshold for occupancy clamping (sensor model) More...
 
void setClampingThresMax (double thresProb)
 sets the maximum threshold for occupancy clamping (sensor model) More...
 
double getOccupancyThres () const
 
float getOccupancyThresLog () const
 
double getProbHit () const
 
float getProbHitLog () const
 
double getProbMiss () const
 
float getProbMissLog () const
 
double getClampingThresMin () const
 
float getClampingThresMinLog () const
 
double getClampingThresMax () const
 
float getClampingThresMaxLog () const
 
bool write (const std::string &filename) const
 Write file header and complete tree to file (serialization) More...
 
bool write (std::ostream &s) const
 Write file header and complete tree to stream (serialization) More...
 

Static Public Member Functions

static AbstractOcTreecreateTree (const std::string id, double res)
 Creates a certain OcTree (factory pattern) More...
 
static AbstractOcTreeread (const std::string &filename)
 Read the file header, create the appropriate class and deserialize. More...
 
static AbstractOcTreeread (std::istream &s)
 Read the file header, create the appropriate class and deserialize. More...
 

Protected Member Functions

bool integrateMissOnRay (const point3d &origin, const point3d &end, bool lazy_eval=false)
 Traces a ray from origin to end and updates all voxels on the way as free. More...
 
OcTreeNodeupdateNodeRecurs (OcTreeNode *node, bool node_just_created, const OcTreeKey &key, unsigned int depth, const float &log_odds_update, bool lazy_eval=false)
 
void updateInnerOccupancyRecurs (OcTreeNode *node, unsigned int depth)
 
void getOccupiedLeafsBBXRecurs (point3d_list &node_centers, unsigned int max_depth, OcTreeNode *node, unsigned int depth, const OcTreeKey &parent_key, const OcTreeKey &min, const OcTreeKey &max) const
 
void toMaxLikelihoodRecurs (OcTreeNode *node, unsigned int depth, unsigned int max_depth)
 
void calcNumThresholdedNodesRecurs (OcTreeNode *node, unsigned int &num_thresholded, unsigned int &num_other) const
 
void calcMinMax ()
 recalculates min and max in x, y, z. Does nothing when tree size didn't change. More...
 
void calcNumNodesRecurs (OcTreeNode *node, size_t &num_nodes) const
 
bool deleteNodeRecurs (OcTreeNode *node, unsigned int depth, unsigned int max_depth, const OcTreeKey &key)
 recursive call of deleteNode() More...
 
void pruneRecurs (OcTreeNode *node, unsigned int depth, unsigned int max_depth, unsigned int &num_pruned)
 recursive call of prune() More...
 
void expandRecurs (OcTreeNode *node, unsigned int depth, unsigned int max_depth)
 recursive call of expand() More...
 
size_t getNumLeafNodesRecurs (const OcTreeNode *parent) const
 
bool readBinaryLegacyHeader (std::istream &s, unsigned int &size, double &res)
 Try to read the old binary format for conversion, will be removed in the future. More...
 

Static Protected Member Functions

static bool readHeader (std::istream &s, std::string &id, unsigned &size, double &res)
 
static void registerTreeType (AbstractOcTree *tree)
 

Protected Attributes

bool use_bbx_limit
 use bounding box for queries (needs to be set)? More...
 
point3d bbx_min
 
point3d bbx_max
 
OcTreeKey bbx_min_key
 
OcTreeKey bbx_max_key
 
bool use_change_detection
 
KeyBoolMap changed_keys
 Set of leaf keys (lowest level) which changed since last resetChangeDetection. More...
 
OcTreeNoderoot
 
const unsigned int tree_depth
 Maximum tree depth is fixed to 16 currently. More...
 
const unsigned int tree_max_val
 
double resolution
 in meters More...
 
double resolution_factor
 = 1. / resolution More...
 
size_t tree_size
 number of nodes in tree More...
 
bool size_changed
 flag to denote whether the octree extent changed (for lazy min/max eval) More...
 
point3d tree_center
 
double max_value [3]
 max in x, y, z More...
 
double min_value [3]
 min in x, y, z More...
 
std::vector< double > sizeLookupTable
 contains the size of a voxel at level i (0: root node). tree_depth+1 levels (incl. 0) More...
 
KeyRay keyray
 
const leaf_iterator leaf_iterator_end
 
const leaf_bbx_iterator leaf_iterator_bbx_end
 
const tree_iterator tree_iterator_end
 
float clamping_thres_min
 
float clamping_thres_max
 
float prob_hit_log
 
float prob_miss_log
 
float occ_prob_thres_log
 

Static Protected Attributes

static StaticMemberInitializer ocTreeMemberInit
 to ensure static initialization (only once) More...
 
static const std::string binaryFileHeader
 
static const std::string fileHeader
 

Member Typedef Documentation

typedef leaf_iterator octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::iterator
inherited

Definition at line 261 of file OcTreeBaseImpl.h.

Make the templated NODE type available from the outside.

Definition at line 89 of file OcTreeBaseImpl.h.

Constructor & Destructor Documentation

octomap::OcTree::OcTree ( double  resolution)
inline

Default constructor, sets resolution of leafs.

Definition at line 67 of file OcTree.h.

Referenced by create(), and octomap::OcTree::StaticMemberInitializer::StaticMemberInitializer().

octomap::OcTree::OcTree ( std::string  _filename)

Reads an OcTree from a binary file.

Parameters
_filename
virtual octomap::OcTree::~OcTree ( )
inlinevirtual

Definition at line 76 of file OcTree.h.

Member Function Documentation

OcTreeKey octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::adjustKeyAtDepth ( const OcTreeKey key,
unsigned int  depth 
) const
inlineinherited

Adjusts a 3D key from the lowest level to correspond to a higher depth (by shifting the key values)

Parameters
keyInput key, at the lowest tree level
depthTarget depth level for the new key
Returns
Key for the new depth level

Definition at line 336 of file OcTreeBaseImpl.h.

unsigned short int octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::adjustKeyAtDepth ( unsigned short int  key,
unsigned int  depth 
) const
inherited

Adjusts a single key value from the lowest level to correspond to a higher depth (by shifting the key value)

Parameters
keyInput key, at the lowest tree level
depthTarget depth level for the new key
Returns
Key for the new depth level
bool octomap::OccupancyOcTreeBase< OcTreeNode >::bbxSet ( ) const
inlineinherited

Definition at line 319 of file OccupancyOcTreeBase.h.

iterator octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::begin ( unsigned char  maxDepth = 0) const
inlineinherited
Returns
beginning of the tree as leaf iterator

Definition at line 264 of file OcTreeBaseImpl.h.

leaf_iterator octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::begin_leafs ( unsigned char  maxDepth = 0) const
inlineinherited
Returns
beginning of the tree as leaf iterator

Definition at line 269 of file OcTreeBaseImpl.h.

leaf_bbx_iterator octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::begin_leafs_bbx ( const OcTreeKey min,
const OcTreeKey max,
unsigned char  maxDepth = 0 
) const
inlineinherited
Returns
beginning of the tree as leaf iterator in a bounding box

Definition at line 274 of file OcTreeBaseImpl.h.

leaf_bbx_iterator octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::begin_leafs_bbx ( const point3d min,
const point3d max,
unsigned char  maxDepth = 0 
) const
inlineinherited
Returns
beginning of the tree as leaf iterator in a bounding box

Definition at line 278 of file OcTreeBaseImpl.h.

tree_iterator octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::begin_tree ( unsigned char  maxDepth = 0) const
inlineinherited
Returns
beginning of the tree as iterator to all nodes (incl. inner)

Definition at line 285 of file OcTreeBaseImpl.h.

void octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::calcMinMax ( )
protectedinherited

recalculates min and max in x, y, z. Does nothing when tree size didn't change.

size_t octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::calcNumNodes ( ) const
inherited

Traverses the tree to calculate the total number of nodes.

void octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::calcNumNodesRecurs ( OcTreeNode node,
size_t &  num_nodes 
) const
protectedinherited
void octomap::OccupancyOcTreeBase< OcTreeNode >::calcNumThresholdedNodes ( unsigned int &  num_thresholded,
unsigned int &  num_other 
) const
inherited
void octomap::OccupancyOcTreeBase< OcTreeNode >::calcNumThresholdedNodesRecurs ( OcTreeNode node,
unsigned int &  num_thresholded,
unsigned int &  num_other 
) const
protectedinherited
virtual bool octomap::OccupancyOcTreeBase< OcTreeNode >::castRay ( const point3d origin,
const point3d direction,
point3d end,
bool  ignoreUnknownCells = false,
double  maxRange = -1.0 
) const
virtualinherited

Performs raycasting in 3d, similar to computeRay().

A ray is cast from origin with a given direction, the first occupied cell is returned (as center coordinate). If the starting coordinate is already occupied in the tree, this coordinate will be returned as a hit.

Parameters
originstarting coordinate of ray
directionA vector pointing in the direction of the raycast. Does not need to be normalized.
endreturns the center of the cell that was hit by the ray, if successful
ignoreUnknownCellswhether unknown cells are ignored. If false (default), the raycast aborts when an unkown cell is hit.
maxRangeMaximum range after which the raycast is aborted (<= 0: no limit, default)
Returns
whether or not an occupied cell was hit
KeyBoolMap::const_iterator octomap::OccupancyOcTreeBase< OcTreeNode >::changedKeysBegin ( )
inlineinherited

Iterator to traverse all keys of changed nodes.

you need to enableChangeDetection() first. Here, an OcTreeKey always refers to a node at the lowest tree level (its size is the minimum tree resolution)

Definition at line 346 of file OccupancyOcTreeBase.h.

KeyBoolMap::const_iterator octomap::OccupancyOcTreeBase< OcTreeNode >::changedKeysEnd ( )
inlineinherited

Iterator to traverse all keys of changed nodes.

Definition at line 349 of file OccupancyOcTreeBase.h.

void octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::clear ( void  )
virtualinherited

Deletes the complete tree structure (only the root node will remain)

Implements octomap::AbstractOcTree.

bool octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::computeRay ( const point3d origin,
const point3d end,
std::vector< point3d > &  ray 
)
inherited

Traces a ray from origin to end (excluding), returning the coordinates of all nodes traversed by the beam.

You still need to check if a node at that coordinate exists (e.g. with search()).

Note
: use the faster computeRayKeys method if possible.
Parameters
originstart coordinate of ray
endend coordinate of ray
rayKeyRay structure that holds the keys of all nodes traversed by the ray, excluding "end"
Returns
Success of operation. Returning false usually means that one of the coordinates is out of the OcTree's range
bool octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::computeRayKeys ( const point3d origin,
const point3d end,
KeyRay ray 
) const
inherited

Traces a ray from origin to end (excluding), returning an OcTreeKey of all nodes traversed by the beam.

You still need to check if a node at that coordinate exists (e.g. with search()).

Parameters
originstart coordinate of ray
endend coordinate of ray
rayKeyRay structure that holds the keys of all nodes traversed by the ray, excluding "end"
Returns
Success of operation. Returning false usually means that one of the coordinates is out of the OcTree's range
void octomap::OccupancyOcTreeBase< OcTreeNode >::computeUpdate ( const Pointcloud scan,
const octomap::point3d origin,
KeySet free_cells,
KeySet occupied_cells,
double  maxrange 
)
inherited

Helper for insertScan.

Computes all octree nodes affected by the point cloud integration at once. Here, occupied nodes have a preference over free ones.

Parameters
scanpoint cloud measurement to be integrated
originorigin of the sensor for ray casting
free_cellskeys of nodes to be cleared
occupied_cellskeys of nodes to be marked occupied
maxrangemaximum range for raycasting (-1: unlimited)
void octomap::OccupancyOcTreeBase< OcTreeNode >::computeUpdate_onePoint ( const point3d p,
const octomap::point3d origin,
KeySet free_cells,
KeySet occupied_cells,
double  maxrange 
)
inlineinherited
void octomap::OccupancyOcTreeBase< OcTreeNode >::computeUpdate_templ ( const POINTCLOUD &  scan,
const octomap::point3d origin,
KeySet free_cells,
KeySet occupied_cells,
double  maxrange 
)
inherited
unsigned short int octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::coordToKey ( double  coordinate) const
inlineinherited

Converts from a single coordinate into a discrete key.

Definition at line 294 of file OcTreeBaseImpl.h.

unsigned short int octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::coordToKey ( double  coordinate,
unsigned  depth 
) const
inherited

Converts from a single coordinate into a discrete key at a given depth.

OcTreeKey octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::coordToKey ( const point3d coord) const
inlineinherited

Converts from a 3D coordinate into a 3D addressing key.

Definition at line 303 of file OcTreeBaseImpl.h.

OcTreeKey octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::coordToKey ( double  x,
double  y,
double  z 
) const
inlineinherited

Converts from a 3D coordinate into a 3D addressing key.

Definition at line 308 of file OcTreeBaseImpl.h.

OcTreeKey octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::coordToKey ( const point3d coord,
unsigned  depth 
) const
inlineinherited

Converts from a 3D coordinate into a 3D addressing key at a given depth.

Definition at line 313 of file OcTreeBaseImpl.h.

OcTreeKey octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::coordToKey ( double  x,
double  y,
double  z,
unsigned  depth 
) const
inlineinherited

Converts from a 3D coordinate into a 3D addressing key at a given depth.

Definition at line 321 of file OcTreeBaseImpl.h.

bool octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::coordToKeyChecked ( const point3d coord,
OcTreeKey key 
) const
inherited

Converts a 3D coordinate into a 3D OcTreeKey, with boundary checking.

Parameters
coord3d coordinate of a point
keyvalues that will be computed, an array of fixed size 3.
Returns
true if point is within the octree (valid), false otherwise
bool octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::coordToKeyChecked ( const point3d coord,
unsigned  depth,
OcTreeKey key 
) const
inherited

Converts a 3D coordinate into a 3D OcTreeKey at a certain depth, with boundary checking.

Parameters
coord3d coordinate of a point
depthlevel of the key from the top
keyvalues that will be computed, an array of fixed size 3.
Returns
true if point is within the octree (valid), false otherwise
bool octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::coordToKeyChecked ( double  x,
double  y,
double  z,
OcTreeKey key 
) const
inherited

Converts a 3D coordinate into a 3D OcTreeKey, with boundary checking.

Parameters
x
y
z
keyvalues that will be computed, an array of fixed size 3.
Returns
true if point is within the octree (valid), false otherwise
bool octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::coordToKeyChecked ( double  x,
double  y,
double  z,
unsigned  depth,
OcTreeKey key 
) const
inherited

Converts a 3D coordinate into a 3D OcTreeKey at a certain depth, with boundary checking.

Parameters
x
y
z
depthlevel of the key from the top
keyvalues that will be computed, an array of fixed size 3.
Returns
true if point is within the octree (valid), false otherwise
bool octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::coordToKeyChecked ( double  coordinate,
unsigned short int &  key 
) const
inherited

Converts a single coordinate into a discrete addressing key, with boundary checking.

Parameters
coordinate3d coordinate of a point
keydiscrete 16 bit adressing key, result
Returns
true if coordinate is within the octree bounds (valid), false otherwise
bool octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::coordToKeyChecked ( double  coordinate,
unsigned  depth,
unsigned short int &  key 
) const
inherited

Converts a single coordinate into a discrete addressing key, with boundary checking.

Parameters
coordinate3d coordinate of a point
depthlevel of the key from the top
keydiscrete 16 bit adressing key, result
Returns
true if coordinate is within the octree bounds (valid), false otherwise
OcTree* octomap::OcTree::create ( ) const
inlinevirtual

virtual constructor: creates a new object of same type (Covariant return type requires an up-to-date compiler)

Implements octomap::AbstractOcTree.

Definition at line 80 of file OcTree.h.

References OcTree(), and octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >::resolution.

static AbstractOcTree* octomap::AbstractOcTree::createTree ( const std::string  id,
double  res 
)
staticinherited

Creates a certain OcTree (factory pattern)

Parameters
idunique ID of OcTree
resresolution of OcTree
Returns
pointer to newly created OcTree (empty). NULL if the ID is unknown!

Referenced by octomap::AbstractOcTree::~AbstractOcTree().

bool octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::deleteNode ( double  x,
double  y,
double  z,
unsigned int  depth = 0 
)
inherited

Delete a node (if exists) given a 3d point.

Will always delete at the lowest level unless depth !=0, and expand pruned inner nodes as needed. Pruned nodes at level "depth" will directly be deleted as a whole.

bool octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::deleteNode ( const point3d value,
unsigned int  depth = 0 
)
inherited

Delete a node (if exists) given a 3d point.

Will always delete at the lowest level unless depth !=0, and expand pruned inner nodes as needed. Pruned nodes at level "depth" will directly be deleted as a whole.

bool octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::deleteNode ( const OcTreeKey key,
unsigned int  depth = 0 
)
inherited

Delete a node (if exists) given an addressing key.

Will always delete at the lowest level unless depth !=0, and expand pruned inner nodes as needed. Pruned nodes at level "depth" will directly be deleted as a whole.

bool octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::deleteNodeRecurs ( OcTreeNode node,
unsigned int  depth,
unsigned int  max_depth,
const OcTreeKey key 
)
protectedinherited

recursive call of deleteNode()

octomap::OccupancyOcTreeBase< OcTreeNode >::DEPRECATED ( void getOccupied(point3d_list &node_centers, unsigned int max_depth=0)  const)
inherited

Convenience function to return all occupied nodes in the OcTree.

Note
Deprecated, will be removed in the future. Direcly access the nodes with iterators instead!
Parameters
node_centerslist of occpupied nodes (as point3d)
max_depthDepth limit of query. 0 (default): no depth limit
octomap::OccupancyOcTreeBase< OcTreeNode >::DEPRECATED ( void getOccupied(std::list< OcTreeVolume > &occupied_volumes, unsigned int max_depth=0)  const)
inherited

Convenience function to return all occupied nodes in the OcTree.

Note
Deprecated, will be removed in the future. Direcly access the nodes with iterators instead! *
Parameters
occupied_volumeslist of occpupied nodes (as point3d and size of the volume)
max_depthDepth limit of query. 0 (default): no depth limit
octomap::OccupancyOcTreeBase< OcTreeNode >::DEPRECATED ( void getOccupied(std::list< OcTreeVolume > &binary_nodes, std::list< OcTreeVolume > &delta_nodes, unsigned int max_depth=0)  const)
inherited

Traverses the tree and collects all OcTreeVolumes regarded as occupied.

Inner nodes with both occupied and free children are regarded as occupied. This should be for internal use only, use getOccupied(occupied_volumes) instead.

Note
Deprecated, will be removed in the future. Direcly access the nodes with iterators instead! *
Parameters
binary_nodeslist of binary OcTreeVolumes which are occupied
delta_nodeslist of delta OcTreeVolumes which are occupied
max_depthDepth limit of query. 0 (default): no depth limit
octomap::OccupancyOcTreeBase< OcTreeNode >::DEPRECATED ( void getOccupiedLeafsBBX(point3d_list &node_centers, point3d min, point3d max)  const)
inherited

returns occupied leafs within a bounding box defined by min and max.

Note
Deprecated, will be removed in the future. Direcly access the nodes with iterators instead!
octomap::OccupancyOcTreeBase< OcTreeNode >::DEPRECATED ( void getFreespace(std::list< OcTreeVolume > &free_volumes, unsigned int max_depth=0)  const)
inherited

Convenience function to return all free nodes in the OcTree.

Note
Deprecated, will be removed in the future. Direcly access the nodes with iterators instead!
Parameters
free_volumeslist of free nodes (as point3d and size of the volume)
max_depthDepth limit of query. 0 (default): no depth limit
octomap::OccupancyOcTreeBase< OcTreeNode >::DEPRECATED ( void getFreespace(std::list< OcTreeVolume > &binary_nodes, std::list< OcTreeVolume > &delta_nodes, unsigned int max_depth=0)  const)
inherited

Traverses the tree and collects all OcTreeVolumes regarded as free.

Inner nodes with both occupied and free children are regarded as occupied.

Note
Deprecated, will be removed in the future. Direcly access the nodes with iterators instead!
Parameters
binary_nodeslist of binary OcTreeVolumes which are free
delta_nodeslist of delta OcTreeVolumes which are free
max_depthDepth limit of query. 0 (default): no depth limit
octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::DEPRECATED ( bool genKeyValue(double coordinate, unsigned short int &keyval)  const)
inlineinherited
Deprecated:
, replaced with coordToKeyChecked()

Definition at line 438 of file OcTreeBaseImpl.h.

octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::DEPRECATED ( bool genKey(const point3d &point, OcTreeKey &key)  const)
inlineinherited
Deprecated:
, replaced with coordToKeyChecked()

Definition at line 443 of file OcTreeBaseImpl.h.

octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::DEPRECATED ( bool genKeyValueAtDepth(const unsigned short int keyval, unsigned int depth, unsigned short int &out_keyval)  const)
inherited
Deprecated:
, replaced by adjustKeyAtDepth() or coordToKey() with depth parameter
octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::DEPRECATED ( bool genKeyAtDepth(const OcTreeKey &key, unsigned int depth, OcTreeKey &out_key)  const)
inherited
Deprecated:
, replaced by adjustKeyAtDepth() or coordToKey() with depth parameter
octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::DEPRECATED ( bool genCoordFromKey(const unsigned short int &key, unsigned depth, float &coord)  const)
inlineinherited
Deprecated:
, replaced by keyToCoord() Will always return true, there is no more boundary check here

Definition at line 455 of file OcTreeBaseImpl.h.

octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::DEPRECATED ( inline bool genCoordFromKey(const unsigned short int &key, float &coord, unsigned depth)  const)
inlineinherited
Deprecated:
, replaced by keyToCoord() Will always return true, there is no more boundary check here

Definition at line 462 of file OcTreeBaseImpl.h.

octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::DEPRECATED ( inline bool genCoordFromKey(const unsigned short int &key, float &coord)  const)
inlineinherited
Deprecated:
, replaced by keyToCoord() Will always return true, there is no more boundary check here

Definition at line 469 of file OcTreeBaseImpl.h.

octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::DEPRECATED ( double genCoordFromKey(const unsigned short int &key, unsigned depth)  const)
inlineinherited
Deprecated:
, replaced by keyToCoord()

Definition at line 475 of file OcTreeBaseImpl.h.

octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::DEPRECATED ( inline double genCoordFromKey(const unsigned short int &key)  const)
inlineinherited
Deprecated:
, replaced by keyToCoord()

Definition at line 480 of file OcTreeBaseImpl.h.

octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::DEPRECATED ( inline bool genCoords(const OcTreeKey &key, unsigned int depth, point3d &point)  const)
inlineinherited
Deprecated:
, replaced by keyToCoord().

Will always return true, there is no more boundary check here

Definition at line 486 of file OcTreeBaseImpl.h.

octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::DEPRECATED ( inline void genPos(const OcTreeKey &key, int depth, unsigned int &pos)  const)
inlineinherited

generate child index (between 0 and 7) from key at given tree depth DEPRECATED

Definition at line 493 of file OcTreeBaseImpl.h.

void octomap::OccupancyOcTreeBase< OcTreeNode >::enableChangeDetection ( bool  enable)
inlineinherited

track or ignore changes while inserting scans (default: ignore)

Definition at line 337 of file OccupancyOcTreeBase.h.

const iterator octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::end ( ) const
inlineinherited
Returns
end of the tree as leaf iterator

Definition at line 266 of file OcTreeBaseImpl.h.

const leaf_iterator octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::end_leafs ( ) const
inlineinherited
Returns
end of the tree as leaf iterator

Definition at line 271 of file OcTreeBaseImpl.h.

const leaf_bbx_iterator octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::end_leafs_bbx ( ) const
inlineinherited
Returns
end of the tree as leaf iterator in a bounding box

Definition at line 282 of file OcTreeBaseImpl.h.

const tree_iterator octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::end_tree ( ) const
inlineinherited
Returns
end of the tree as iterator to all nodes (incl. inner)

Definition at line 287 of file OcTreeBaseImpl.h.

virtual void octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::expand ( )
virtualinherited

Expands all pruned nodes (reverse of prune())

Note
This is an expensive operation, especially when the tree is nearly empty!

Implements octomap::AbstractOcTree.

void octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::expandRecurs ( OcTreeNode node,
unsigned int  depth,
unsigned int  max_depth 
)
protectedinherited

recursive call of expand()

point3d octomap::OccupancyOcTreeBase< OcTreeNode >::getBBXBounds ( ) const
inherited
point3d octomap::OccupancyOcTreeBase< OcTreeNode >::getBBXCenter ( ) const
inherited
point3d octomap::OccupancyOcTreeBase< OcTreeNode >::getBBXMax ( ) const
inlineinherited
Returns
the currently set maximum for bounding box queries, if set

Definition at line 327 of file OccupancyOcTreeBase.h.

point3d octomap::OccupancyOcTreeBase< OcTreeNode >::getBBXMin ( ) const
inlineinherited
Returns
the currently set minimum for bounding box queries, if set

Definition at line 325 of file OccupancyOcTreeBase.h.

double octomap::AbstractOccupancyOcTree::getClampingThresMax ( ) const
inlineinherited
Returns
maximum threshold for occupancy clamping in the sensor model (probability)

Definition at line 231 of file AbstractOccupancyOcTree.h.

References octomap::AbstractOccupancyOcTree::clamping_thres_max, and octomap::probability().

float octomap::AbstractOccupancyOcTree::getClampingThresMaxLog ( ) const
inlineinherited
Returns
maximum threshold for occupancy clamping in the sensor model (logodds)

Definition at line 233 of file AbstractOccupancyOcTree.h.

References octomap::AbstractOccupancyOcTree::clamping_thres_max, octomap::AbstractOccupancyOcTree::readBinaryLegacyHeader(), and octomap::AbstractOcTree::size().

double octomap::AbstractOccupancyOcTree::getClampingThresMin ( ) const
inlineinherited
Returns
minimum threshold for occupancy clamping in the sensor model (probability)

Definition at line 227 of file AbstractOccupancyOcTree.h.

References octomap::AbstractOccupancyOcTree::clamping_thres_min, and octomap::probability().

float octomap::AbstractOccupancyOcTree::getClampingThresMinLog ( ) const
inlineinherited
Returns
minimum threshold for occupancy clamping in the sensor model (logodds)

Definition at line 229 of file AbstractOccupancyOcTree.h.

References octomap::AbstractOccupancyOcTree::clamping_thres_min.

virtual void octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::getMetricMax ( double &  x,
double &  y,
double &  z 
)
virtualinherited

maximum value of the bounding box of all known space in x, y, z

Implements octomap::AbstractOcTree.

void octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::getMetricMax ( double &  x,
double &  y,
double &  z 
) const
virtualinherited

maximum value of the bounding box of all known space in x, y, z

Implements octomap::AbstractOcTree.

virtual void octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::getMetricMin ( double &  x,
double &  y,
double &  z 
)
virtualinherited

minimum value of the bounding box of all known space in x, y, z

Implements octomap::AbstractOcTree.

void octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::getMetricMin ( double &  x,
double &  y,
double &  z 
) const
virtualinherited

minimum value of the bounding box of all known space in x, y, z

Implements octomap::AbstractOcTree.

virtual void octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::getMetricSize ( double &  x,
double &  y,
double &  z 
)
virtualinherited

Size of OcTree (all known space) in meters for x, y and z dimension.

Implements octomap::AbstractOcTree.

virtual void octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::getMetricSize ( double &  x,
double &  y,
double &  z 
) const
virtualinherited

Size of OcTree (all known space) in meters for x, y and z dimension.

double octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::getNodeSize ( unsigned  depth) const
inlineinherited

Definition at line 111 of file OcTreeBaseImpl.h.

size_t octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::getNumLeafNodes ( ) const
inherited

Traverses the tree to calculate the total number of leaf nodes.

size_t octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::getNumLeafNodesRecurs ( const OcTreeNode parent) const
protectedinherited
double octomap::AbstractOccupancyOcTree::getOccupancyThres ( ) const
inlineinherited
Returns
threshold (probability) for occupancy - sensor model

Definition at line 213 of file AbstractOccupancyOcTree.h.

References octomap::AbstractOccupancyOcTree::occ_prob_thres_log, and octomap::probability().

float octomap::AbstractOccupancyOcTree::getOccupancyThresLog ( ) const
inlineinherited
Returns
threshold (logodds) for occupancy - sensor model

Definition at line 215 of file AbstractOccupancyOcTree.h.

References octomap::AbstractOccupancyOcTree::occ_prob_thres_log.

void octomap::OccupancyOcTreeBase< OcTreeNode >::getOccupiedLeafsBBXRecurs ( point3d_list node_centers,
unsigned int  max_depth,
OcTreeNode node,
unsigned int  depth,
const OcTreeKey parent_key,
const OcTreeKey min,
const OcTreeKey max 
) const
protectedinherited
double octomap::AbstractOccupancyOcTree::getProbHit ( ) const
inlineinherited
Returns
probablility for a "hit" in the sensor model (probability)

Definition at line 218 of file AbstractOccupancyOcTree.h.

References octomap::AbstractOccupancyOcTree::prob_hit_log, and octomap::probability().

float octomap::AbstractOccupancyOcTree::getProbHitLog ( ) const
inlineinherited
Returns
probablility for a "hit" in the sensor model (logodds)

Definition at line 220 of file AbstractOccupancyOcTree.h.

References octomap::AbstractOccupancyOcTree::prob_hit_log.

double octomap::AbstractOccupancyOcTree::getProbMiss ( ) const
inlineinherited
Returns
probablility for a "miss" in the sensor model (probability)

Definition at line 222 of file AbstractOccupancyOcTree.h.

References octomap::AbstractOccupancyOcTree::prob_miss_log, and octomap::probability().

float octomap::AbstractOccupancyOcTree::getProbMissLog ( ) const
inlineinherited
Returns
probablility for a "miss" in the sensor model (logodds)

Definition at line 224 of file AbstractOccupancyOcTree.h.

References octomap::AbstractOccupancyOcTree::prob_miss_log.

double octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::getResolution ( ) const
inlinevirtualinherited

Implements octomap::AbstractOcTree.

Definition at line 107 of file OcTreeBaseImpl.h.

OcTreeNode * octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::getRoot ( ) const
inlineinherited
Returns
Pointer to the root node of the tree. This pointer should not be modified or deleted externally, the OcTree manages its memory itself.

Definition at line 118 of file OcTreeBaseImpl.h.

unsigned int octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::getTreeDepth ( ) const
inlineinherited

Definition at line 109 of file OcTreeBaseImpl.h.

std::string octomap::OcTree::getTreeType ( ) const
inlinevirtual

returns actual class name as string for identification

Implements octomap::AbstractOcTree.

Definition at line 82 of file OcTree.h.

void octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::getUnknownLeafCenters ( point3d_list node_centers,
point3d  pmin,
point3d  pmax 
) const
inherited

return centers of leafs that do NOT exist (but could) in a given bounding box

bool octomap::OccupancyOcTreeBase< OcTreeNode >::inBBX ( const point3d p) const
inherited
Returns
true if point is in the currently set bounding box
bool octomap::OccupancyOcTreeBase< OcTreeNode >::inBBX ( const OcTreeKey key) const
inherited
Returns
true if key is in the currently set bounding box
virtual bool octomap::OccupancyOcTreeBase< OcTreeNode >::insertRay ( const point3d origin,
const point3d end,
double  maxrange = -1.0,
bool  lazy_eval = false 
)
virtualinherited

Insert one ray between origin and end into the tree.

integrateMissOnRay() is called for the ray, the end point is updated as occupied.

Parameters
originorigin of sensor in global coordinates
endendpoint of measurement in global coordinates
maxrangemaximum range after which the raycast should be aborted
lazy_evalwhether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done.
Returns
success of operation
virtual void octomap::OccupancyOcTreeBase< OcTreeNode >::insertScan ( const Pointcloud scan,
const octomap::point3d sensor_origin,
double  maxrange = -1.,
bool  pruning = true,
bool  lazy_eval = false 
)
virtualinherited

Integrate a Pointcloud (in global reference frame)

Parameters
scanPointcloud (measurement endpoints), in global reference frame
sensor_originmeasurement origin in global reference frame
maxrangemaximum range for how long individual beams are inserted (default -1: complete beam)
pruningwhether the tree is (losslessly) pruned after insertion (default: true)
lazy_evalwhether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done.
virtual void octomap::OccupancyOcTreeBase< OcTreeNode >::insertScan ( const Pointcloud scan,
const point3d sensor_origin,
const pose6d frame_origin,
double  maxrange = -1.,
bool  pruning = true,
bool  lazy_eval = false 
)
virtualinherited

Integrate a 3d scan, transform scan before tree update.

Parameters
scanPointcloud (measurement endpoints) relative to frame origin
sensor_originorigin of sensor relative to frame origin
frame_originorigin of reference frame, determines transform to be applied to cloud and sensor origin
maxrangemaximum range for how long individual beams are inserted (default -1: complete beam)
pruningwhether the tree is (losslessly) pruned after insertion (default: true)
lazy_evalwhether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done.
virtual void octomap::OccupancyOcTreeBase< OcTreeNode >::insertScan ( const ScanNode scan,
double  maxrange = -1.,
bool  pruning = true,
bool  lazy_eval = false 
)
virtualinherited

Insert a 3d scan (given as a ScanNode) into the tree.

Parameters
scanScanNode contains Pointcloud data and frame/sensor origin
maxrangemaximum range for how long individual beams are inserted (default -1: complete beam)
pruningwhether the tree is (losslessly) pruned after insertion (default: true)
lazy_evalwhether the tree is left 'dirty' after the update (default: false). This speeds up the insertion by not updating inner nodes, but you need to call updateInnerOccupancy() when done.
void octomap::OccupancyOcTreeBase< OcTreeNode >::insertScan_templ ( const SCAN &  scan,
const octomap::point3d sensor_origin,
double  maxrange = -1.,
bool  pruning = true,
bool  lazy_eval = false 
)
inherited
virtual void octomap::OccupancyOcTreeBase< OcTreeNode >::insertScanNaive ( const Pointcloud pc,
const point3d origin,
double  maxrange,
bool  pruning = true,
bool  lazy_eval = false 
)
virtualinherited

for testing only

virtual void octomap::OccupancyOcTreeBase< OcTreeNode >::integrateHit ( OcTreeNode occupancyNode) const
virtualinherited

integrate a "hit" measurement according to the tree's sensor model

virtual void octomap::OccupancyOcTreeBase< OcTreeNode >::integrateMiss ( OcTreeNode occupancyNode) const
virtualinherited

integrate a "miss" measurement according to the tree's sensor model

bool octomap::OccupancyOcTreeBase< OcTreeNode >::integrateMissOnRay ( const point3d origin,
const point3d end,
bool  lazy_eval = false 
)
inlineprotectedinherited

Traces a ray from origin to end and updates all voxels on the way as free.

The volume containing "end" is not updated.

bool octomap::AbstractOccupancyOcTree::isNodeAtThreshold ( const OcTreeNode occupancyNode) const
inlineinherited

queries whether a node is at the clamping threshold according to the tree's parameter

Definition at line 138 of file AbstractOccupancyOcTree.h.

References octomap::AbstractOccupancyOcTree::clamping_thres_max, octomap::AbstractOccupancyOcTree::clamping_thres_min, and octomap::OcTreeNode::getLogOdds().

bool octomap::AbstractOccupancyOcTree::isNodeAtThreshold ( const OcTreeNode occupancyNode) const
inlineinherited
bool octomap::AbstractOccupancyOcTree::isNodeOccupied ( const OcTreeNode occupancyNode) const
inlineinherited

queries whether a node is occupied according to the tree's parameter for "occupancy"

Definition at line 128 of file AbstractOccupancyOcTree.h.

References octomap::OcTreeNode::getLogOdds(), and octomap::AbstractOccupancyOcTree::occ_prob_thres_log.

bool octomap::AbstractOccupancyOcTree::isNodeOccupied ( const OcTreeNode occupancyNode) const
inlineinherited

queries whether a node is occupied according to the tree's parameter for "occupancy"

Definition at line 133 of file AbstractOccupancyOcTree.h.

References octomap::OcTreeNode::getLogOdds(), and octomap::AbstractOccupancyOcTree::occ_prob_thres_log.

double octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::keyToCoord ( unsigned short int  key,
unsigned  depth 
) const
inherited

converts from a discrete key at a given depth into a coordinate corresponding to the key's center

double octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::keyToCoord ( unsigned short int  key) const
inlineinherited

converts from a discrete key at the lowest tree level into a coordinate corresponding to the key's center

Definition at line 421 of file OcTreeBaseImpl.h.

point3d octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::keyToCoord ( const OcTreeKey key) const
inlineinherited

converts from an addressing key at the lowest tree level into a coordinate corresponding to the key's center

Definition at line 427 of file OcTreeBaseImpl.h.

point3d octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::keyToCoord ( const OcTreeKey key,
unsigned  depth 
) const
inlineinherited

converts from an addressing key at a given depth into a coordinate corresponding to the key's center

Definition at line 433 of file OcTreeBaseImpl.h.

size_t octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::memoryFullGrid ( ) const
inherited
Returns
Memory usage of a full grid of the same size as the OcTree in bytes (for comparison)
virtual size_t octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::memoryUsage ( ) const
virtualinherited
Returns
Memory usage of the complete octree in bytes (may vary between architectures)

Implements octomap::AbstractOcTree.

virtual size_t octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::memoryUsageNode ( ) const
inlinevirtualinherited
Returns
Memory usage of the a single octree node

Implements octomap::AbstractOcTree.

Definition at line 182 of file OcTreeBaseImpl.h.

virtual void octomap::OccupancyOcTreeBase< OcTreeNode >::nodeToMaxLikelihood ( OcTreeNode occupancyNode) const
virtualinherited

converts the node to the maximum likelihood value according to the tree's parameter for "occupancy"

virtual void octomap::OccupancyOcTreeBase< OcTreeNode >::nodeToMaxLikelihood ( OcTreeNode occupancyNode) const
virtualinherited

converts the node to the maximum likelihood value according to the tree's parameter for "occupancy"

virtual void octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::prune ( )
virtualinherited

Lossless compression of OcTree: merge children to parent when there are eight children with identical values.

Implements octomap::AbstractOcTree.

void octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::pruneRecurs ( OcTreeNode node,
unsigned int  depth,
unsigned int  max_depth,
unsigned int &  num_pruned 
)
protectedinherited

recursive call of prune()

static AbstractOcTree* octomap::AbstractOcTree::read ( const std::string &  filename)
staticinherited

Read the file header, create the appropriate class and deserialize.

This creates a new octree which you need to delete yourself. If you expect or requre a specific kind of octree, use dynamic_cast afterwards:

AbstractOcTree* tree = AbstractOcTree::read("filename.ot");
OcTree* octree = dynamic_cast<OcTree*>(tree);

Referenced by octomap::AbstractOcTree::~AbstractOcTree().

static AbstractOcTree* octomap::AbstractOcTree::read ( std::istream &  s)
staticinherited

Read the file header, create the appropriate class and deserialize.

This creates a new octree which you need to delete yourself.

bool octomap::AbstractOccupancyOcTree::readBinary ( std::istream &  s)
inherited

Reads an OcTree from an input stream.

Existing nodes of the tree are deleted before the tree is read.

Returns
success of operation

Referenced by octomap::AbstractOccupancyOcTree::~AbstractOccupancyOcTree().

bool octomap::AbstractOccupancyOcTree::readBinary ( const std::string &  filename)
inherited

Reads OcTree from a binary file.

Existing nodes of the tree are deleted before the tree is read.

Returns
success of operation
std::istream& octomap::OccupancyOcTreeBase< OcTreeNode >::readBinaryData ( std::istream &  s)
virtualinherited

Reads only the data (=tree structure) from the input stream.

The tree needs to be constructed with the proper header information beforehand, see readBinary().

Implements octomap::AbstractOccupancyOcTree.

bool octomap::AbstractOccupancyOcTree::readBinaryLegacyHeader ( std::istream &  s,
unsigned int &  size,
double &  res 
)
protectedinherited

Try to read the old binary format for conversion, will be removed in the future.

Referenced by octomap::AbstractOccupancyOcTree::getClampingThresMaxLog().

std::istream& octomap::OccupancyOcTreeBase< OcTreeNode >::readBinaryNode ( std::istream &  s,
OcTreeNode node 
) const
inherited

Read node from binary stream (max-likelihood value), recursively continue with all children.

This will set the log_odds_occupancy value of all leaves to either free or occupied.

Parameters
s
Returns
std::istream& octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::readData ( std::istream &  s)
virtualinherited

Read all nodes from the input stream (without file header), for this the tree needs to be already created.

For general file IO, you should probably use AbstractOcTree::read() instead.

Implements octomap::AbstractOcTree.

static bool octomap::AbstractOcTree::readHeader ( std::istream &  s,
std::string &  id,
unsigned &  size,
double &  res 
)
staticprotectedinherited
static void octomap::AbstractOcTree::registerTreeType ( AbstractOcTree tree)
staticprotectedinherited
void octomap::OccupancyOcTreeBase< OcTreeNode >::resetChangeDetection ( )
inlineinherited

Reset the set of changed keys. Call this after you obtained all changed nodes.

Definition at line 339 of file OccupancyOcTreeBase.h.

OcTreeNode * octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::search ( double  x,
double  y,
double  z,
unsigned int  depth = 0 
) const
inherited

Search node at specified depth given a 3d point (depth=0: search full tree depth)

Returns
pointer to node if found, NULL otherwise
OcTreeNode * octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::search ( const point3d value,
unsigned int  depth = 0 
) const
inherited

Search node at specified depth given a 3d point (depth=0: search full tree depth)

Returns
pointer to node if found, NULL otherwise
OcTreeNode * octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::search ( const OcTreeKey key,
unsigned int  depth = 0 
) const
inherited

Search a node at specified depth given an addressing key (depth=0: search full tree depth)

Returns
pointer to node if found, NULL otherwise
void octomap::OccupancyOcTreeBase< OcTreeNode >::setBBXMax ( point3d max)
inherited

sets the maximum for a query bounding box to use

void octomap::OccupancyOcTreeBase< OcTreeNode >::setBBXMin ( point3d min)
inherited

sets the minimum for a query bounding box to use

void octomap::AbstractOccupancyOcTree::setClampingThresMax ( double  thresProb)
inlineinherited

sets the maximum threshold for occupancy clamping (sensor model)

Definition at line 210 of file AbstractOccupancyOcTree.h.

References octomap::AbstractOccupancyOcTree::clamping_thres_max, and octomap::logodds().

void octomap::AbstractOccupancyOcTree::setClampingThresMin ( double  thresProb)
inlineinherited

sets the minimum threshold for occupancy clamping (sensor model)

Definition at line 208 of file AbstractOccupancyOcTree.h.

References octomap::AbstractOccupancyOcTree::clamping_thres_min, and octomap::logodds().

void octomap::AbstractOccupancyOcTree::setOccupancyThres ( double  prob)
inlineinherited

sets the threshold for occupancy (sensor model)

Definition at line 202 of file AbstractOccupancyOcTree.h.

References octomap::logodds(), and octomap::AbstractOccupancyOcTree::occ_prob_thres_log.

void octomap::AbstractOccupancyOcTree::setProbHit ( double  prob)
inlineinherited

sets the probablility for a "hit" (will be converted to logodds) - sensor model

Definition at line 204 of file AbstractOccupancyOcTree.h.

References octomap::logodds(), and octomap::AbstractOccupancyOcTree::prob_hit_log.

void octomap::AbstractOccupancyOcTree::setProbMiss ( double  prob)
inlineinherited

sets the probablility for a "miss" (will be converted to logodds) - sensor model

Definition at line 206 of file AbstractOccupancyOcTree.h.

References octomap::logodds(), and octomap::AbstractOccupancyOcTree::prob_miss_log.

void octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::setResolution ( double  r)
virtualinherited

Change the resolution of the octree, scaling all voxels.

This will not preserve the (metric) scale!

Implements octomap::AbstractOcTree.

virtual size_t octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::size ( ) const
inlinevirtualinherited
Returns
The number of nodes in the tree

Implements octomap::AbstractOcTree.

Definition at line 176 of file OcTreeBaseImpl.h.

virtual void octomap::OccupancyOcTreeBase< OcTreeNode >::toMaxLikelihood ( )
virtualinherited

Creates the maximum likelihood map by calling toMaxLikelihood on all tree nodes, setting their occupancy to the corresponding occupancy thresholds.

This enables a very efficient compression if you call prune() afterwards.

Implements octomap::AbstractOccupancyOcTree.

void octomap::OccupancyOcTreeBase< OcTreeNode >::toMaxLikelihoodRecurs ( OcTreeNode node,
unsigned int  depth,
unsigned int  max_depth 
)
protectedinherited
void octomap::OccupancyOcTreeBase< OcTreeNode >::updateInnerOccupancy ( )
inherited

Updates the occupancy of all inner nodes to reflect their children's occupancy.

If you performed batch-updates with lazy evaluation enabled, you must call this before any queries to ensure correct multi-resolution behavior.

void octomap::OccupancyOcTreeBase< OcTreeNode >::updateInnerOccupancyRecurs ( OcTreeNode node,
unsigned int  depth 
)
protectedinherited
virtual OcTreeNode * octomap::OccupancyOcTreeBase< OcTreeNode >::updateNode ( const OcTreeKey key,
float  log_odds_update,
bool  lazy_eval = false 
)
virtualinherited

Manipulate log_odds value of voxel directly.

Parameters
keyOcTreeKey of the NODE that is to be updated
log_odds_updatevalue to be added (+) to log_odds value of node
lazy_evalwhether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done.
Returns
pointer to the updated NODE

Implements octomap::AbstractOccupancyOcTree.

virtual OcTreeNode * octomap::OccupancyOcTreeBase< OcTreeNode >::updateNode ( const point3d value,
float  log_odds_update,
bool  lazy_eval = false 
)
virtualinherited

Manipulate log_odds value of voxel directly.

Looks up the OcTreeKey corresponding to the coordinate and then calls udpateNode() with it.

Parameters
value3d coordinate of the NODE that is to be updated
log_odds_updatevalue to be added (+) to log_odds value of node
lazy_evalwhether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done.
Returns
pointer to the updated NODE

Implements octomap::AbstractOccupancyOcTree.

virtual OcTreeNode * octomap::OccupancyOcTreeBase< OcTreeNode >::updateNode ( double  x,
double  y,
double  z,
float  log_odds_update,
bool  lazy_eval = false 
)
virtualinherited

Manipulate log_odds value of voxel directly.

Looks up the OcTreeKey corresponding to the coordinate and then calls udpateNode() with it.

Parameters
x
y
z
log_odds_updatevalue to be added (+) to log_odds value of node
lazy_evalwhether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done.
Returns
pointer to the updated NODE
virtual OcTreeNode * octomap::OccupancyOcTreeBase< OcTreeNode >::updateNode ( const OcTreeKey key,
bool  occupied,
bool  lazy_eval = false 
)
virtualinherited

Integrate occupancy measurement.

Parameters
keyOcTreeKey of the NODE that is to be updated
occupiedtrue if the node was measured occupied, else false
lazy_evalwhether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done.
Returns
pointer to the updated NODE

Implements octomap::AbstractOccupancyOcTree.

virtual OcTreeNode * octomap::OccupancyOcTreeBase< OcTreeNode >::updateNode ( const point3d value,
bool  occupied,
bool  lazy_eval = false 
)
virtualinherited

Integrate occupancy measurement.

Looks up the OcTreeKey corresponding to the coordinate and then calls udpateNode() with it.

Parameters
value3d coordinate of the NODE that is to be updated
occupiedtrue if the node was measured occupied, else false
lazy_evalwhether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done.
Returns
pointer to the updated NODE

Implements octomap::AbstractOccupancyOcTree.

virtual OcTreeNode * octomap::OccupancyOcTreeBase< OcTreeNode >::updateNode ( double  x,
double  y,
double  z,
bool  occupied,
bool  lazy_eval = false 
)
virtualinherited

Integrate occupancy measurement.

Looks up the OcTreeKey corresponding to the coordinate and then calls udpateNode() with it.

Parameters
x
y
z
occupiedtrue if the node was measured occupied, else false
lazy_evalwhether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done.
Returns
pointer to the updated NODE
virtual void octomap::OccupancyOcTreeBase< OcTreeNode >::updateNodeLogOdds ( OcTreeNode occupancyNode,
const float &  update 
) const
virtualinherited
OcTreeNode * octomap::OccupancyOcTreeBase< OcTreeNode >::updateNodeRecurs ( OcTreeNode node,
bool  node_just_created,
const OcTreeKey key,
unsigned int  depth,
const float &  log_odds_update,
bool  lazy_eval = false 
)
protectedinherited
void octomap::OccupancyOcTreeBase< OcTreeNode >::useBBXLimit ( bool  enable)
inlineinherited

use or ignore BBX limit (default: ignore)

Definition at line 318 of file OccupancyOcTreeBase.h.

double octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::volume ( ) const
inherited
bool octomap::AbstractOcTree::write ( const std::string &  filename) const
inherited

Write file header and complete tree to file (serialization)

Referenced by octomap::AbstractOcTree::~AbstractOcTree().

bool octomap::AbstractOcTree::write ( std::ostream &  s) const
inherited

Write file header and complete tree to stream (serialization)

bool octomap::AbstractOccupancyOcTree::writeBinary ( const std::string &  filename)
inherited

Writes OcTree to a binary file using writeBinary().

The OcTree is first converted to the maximum likelihood estimate and pruned.

Returns
success of operation

Referenced by octomap::AbstractOccupancyOcTree::~AbstractOccupancyOcTree().

bool octomap::AbstractOccupancyOcTree::writeBinary ( std::ostream &  s)
inherited

Writes compressed maximum likelihood OcTree to a binary stream.

The OcTree is first converted to the maximum likelihood estimate and pruned for maximum compression.

Returns
success of operation
bool octomap::AbstractOccupancyOcTree::writeBinaryConst ( const std::string &  filename) const
inherited

Writes OcTree to a binary file using writeBinaryConst().

The OcTree is not changed, in particular not pruned first. Files will be smaller when the tree is pruned first or by using writeBinary() instead.

Returns
success of operation

Referenced by octomap::AbstractOccupancyOcTree::~AbstractOccupancyOcTree().

bool octomap::AbstractOccupancyOcTree::writeBinaryConst ( std::ostream &  s) const
inherited

Writes the maximum likelihood OcTree to a binary stream (const variant).

Files will be smaller when the tree is pruned first or by using writeBinary() instead.

Returns
success of operation
std::ostream& octomap::OccupancyOcTreeBase< OcTreeNode >::writeBinaryData ( std::ostream &  s) const
virtualinherited

Writes the data of the tree (without header) to the stream, recursively calling writeBinaryNode (starting with root)

Implements octomap::AbstractOccupancyOcTree.

std::ostream& octomap::OccupancyOcTreeBase< OcTreeNode >::writeBinaryNode ( std::ostream &  s,
const OcTreeNode node 
) const
inherited

Write node to binary stream (max-likelihood value), recursively continue with all children.

This will discard the log_odds_occupancy value, writing all leaves as either free or occupied.

Parameters
s
nodeOcTreeNode to write out, will recurse to all children
Returns
std::ostream& octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::writeData ( std::ostream &  s) const
virtualinherited

Write complete state of tree to stream (without file header) unmodified.

Pruning the tree first produces smaller files (lossless compression)

Implements octomap::AbstractOcTree.

Member Data Documentation

point3d octomap::OccupancyOcTreeBase< OcTreeNode >::bbx_max
protectedinherited

Definition at line 475 of file OccupancyOcTreeBase.h.

OcTreeKey octomap::OccupancyOcTreeBase< OcTreeNode >::bbx_max_key
protectedinherited

Definition at line 477 of file OccupancyOcTreeBase.h.

point3d octomap::OccupancyOcTreeBase< OcTreeNode >::bbx_min
protectedinherited

Definition at line 474 of file OccupancyOcTreeBase.h.

OcTreeKey octomap::OccupancyOcTreeBase< OcTreeNode >::bbx_min_key
protectedinherited

Definition at line 476 of file OccupancyOcTreeBase.h.

const std::string octomap::AbstractOccupancyOcTree::binaryFileHeader
staticprotectedinherited

Definition at line 249 of file AbstractOccupancyOcTree.h.

KeyBoolMap octomap::OccupancyOcTreeBase< OcTreeNode >::changed_keys
protectedinherited

Set of leaf keys (lowest level) which changed since last resetChangeDetection.

Definition at line 481 of file OccupancyOcTreeBase.h.

float octomap::AbstractOccupancyOcTree::clamping_thres_max
protectedinherited
float octomap::AbstractOccupancyOcTree::clamping_thres_min
protectedinherited
const std::string octomap::AbstractOcTree::fileHeader
staticprotectedinherited

Definition at line 169 of file AbstractOcTree.h.

Definition at line 544 of file OcTreeBaseImpl.h.

const leaf_bbx_iterator octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::leaf_iterator_bbx_end
protectedinherited

Definition at line 547 of file OcTreeBaseImpl.h.

const leaf_iterator octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::leaf_iterator_end
protectedinherited

Definition at line 546 of file OcTreeBaseImpl.h.

double octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::max_value[3]
protectedinherited

max in x, y, z

Definition at line 539 of file OcTreeBaseImpl.h.

double octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::min_value[3]
protectedinherited

min in x, y, z

Definition at line 540 of file OcTreeBaseImpl.h.

float octomap::AbstractOccupancyOcTree::occ_prob_thres_log
protectedinherited
StaticMemberInitializer octomap::OcTree::ocTreeMemberInit
staticprotected

to ensure static initialization (only once)

Definition at line 98 of file OcTree.h.

float octomap::AbstractOccupancyOcTree::prob_hit_log
protectedinherited
float octomap::AbstractOccupancyOcTree::prob_miss_log
protectedinherited
double octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::resolution
protectedinherited

in meters

Definition at line 530 of file OcTreeBaseImpl.h.

Referenced by create().

double octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::resolution_factor
protectedinherited

= 1. / resolution

Definition at line 531 of file OcTreeBaseImpl.h.

Definition at line 525 of file OcTreeBaseImpl.h.

bool octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::size_changed
protectedinherited

flag to denote whether the octree extent changed (for lazy min/max eval)

Definition at line 535 of file OcTreeBaseImpl.h.

std::vector<double> octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::sizeLookupTable
protectedinherited

contains the size of a voxel at level i (0: root node). tree_depth+1 levels (incl. 0)

Definition at line 542 of file OcTreeBaseImpl.h.

point3d octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::tree_center
protectedinherited

Definition at line 537 of file OcTreeBaseImpl.h.

const unsigned int octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::tree_depth
protectedinherited

Maximum tree depth is fixed to 16 currently.

Definition at line 528 of file OcTreeBaseImpl.h.

const tree_iterator octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::tree_iterator_end
protectedinherited

Definition at line 548 of file OcTreeBaseImpl.h.

const unsigned int octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::tree_max_val
protectedinherited

Definition at line 529 of file OcTreeBaseImpl.h.

size_t octomap::OcTreeBaseImpl< OcTreeNode , AbstractOccupancyOcTree >::tree_size
protectedinherited

number of nodes in tree

Definition at line 533 of file OcTreeBaseImpl.h.

bool octomap::OccupancyOcTreeBase< OcTreeNode >::use_bbx_limit
protectedinherited

use bounding box for queries (needs to be set)?

Definition at line 473 of file OccupancyOcTreeBase.h.

bool octomap::OccupancyOcTreeBase< OcTreeNode >::use_change_detection
protectedinherited

Definition at line 479 of file OccupancyOcTreeBase.h.




Page generated by Doxygen 1.8.11 for MRPT 1.4.0 SVN: at Sun Aug 14 23:58:29 UTC 2016