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::CountingOcTree Class Reference

Detailed Description

An AbstractOcTree which stores an internal counter per node / volume.

Count is recursive, parent nodes have the summed count of their children.

Note
In our mapping system this data structure is used in the sensor model only. Do not use, e.g., insertScan.

Definition at line 103 of file CountingOcTree.h.

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

Inheritance diagram for octomap::CountingOcTree:
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 CountingOcTreeNode NodeType
 Make the templated NODE type available from the outside. More...
 
typedef leaf_iterator iterator
 

Public Member Functions

 CountingOcTree (double resolution)
 Default constructor, sets resolution of leafs. More...
 
virtual CountingOcTreeNodeupdateNode (const point3d &value)
 
CountingOcTreeNodeupdateNode (const OcTreeKey &k)
 
void getCentersMinHits (point3d_list &node_centers, unsigned int min_hits) const
 
OcTreeBase< CountingOcTreeNode > * create () 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...
 
bool operator== (const OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree > &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
 
CountingOcTreeNodegetRoot () const
 
CountingOcTreeNodesearch (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...
 
CountingOcTreeNodesearch (const point3d &value, unsigned int depth=0) const
 Search node at specified depth given a 3d point (depth=0: search full tree depth) More...
 
CountingOcTreeNodesearch (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...
 
 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...
 
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

void getCentersMinHitsRecurs (point3d_list &node_centers, unsigned int &min_hits, unsigned int max_depth, CountingOcTreeNode *node, unsigned int depth, const OcTreeKey &parent_key) const
 
void calcMinMax ()
 recalculates min and max in x, y, z. Does nothing when tree size didn't change. More...
 
void calcNumNodesRecurs (CountingOcTreeNode *node, size_t &num_nodes) const
 
bool deleteNodeRecurs (CountingOcTreeNode *node, unsigned int depth, unsigned int max_depth, const OcTreeKey &key)
 recursive call of deleteNode() More...
 
void pruneRecurs (CountingOcTreeNode *node, unsigned int depth, unsigned int max_depth, unsigned int &num_pruned)
 recursive call of prune() More...
 
void expandRecurs (CountingOcTreeNode *node, unsigned int depth, unsigned int max_depth)
 recursive call of expand() More...
 
size_t getNumLeafNodesRecurs (const CountingOcTreeNode *parent) const
 

Static Protected Member Functions

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

Protected Attributes

CountingOcTreeNoderoot
 
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
 

Static Protected Attributes

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

Member Typedef Documentation

typedef leaf_iterator octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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::CountingOcTree::CountingOcTree ( double  resolution)
inline

Default constructor, sets resolution of leafs.

Definition at line 107 of file CountingOcTree.h.

References octomap::OcTreeDataNode< unsigned int >::value.

Member Function Documentation

OcTreeKey octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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
iterator octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::calcMinMax ( )
protectedinherited

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

size_t octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::calcNumNodes ( ) const
inherited

Traverses the tree to calculate the total number of nodes.

void octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::calcNumNodesRecurs ( CountingOcTreeNode node,
size_t &  num_nodes 
) const
protectedinherited
void octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::clear ( void  )
virtualinherited

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

Implements octomap::AbstractOcTree.

bool octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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
unsigned short int octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::coordToKey ( double  coordinate,
unsigned  depth 
) const
inherited

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

OcTreeKey octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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
OcTreeBase<CountingOcTreeNode >* octomap::OcTreeBase< CountingOcTreeNode >::create ( ) const
inlinevirtualinherited

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

Implements octomap::AbstractOcTree.

Definition at line 63 of file OcTreeBase.h.

References octomap::OcTreeBaseImpl< NODE, AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::deleteNodeRecurs ( CountingOcTreeNode node,
unsigned int  depth,
unsigned int  max_depth,
const OcTreeKey key 
)
protectedinherited

recursive call of deleteNode()

octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::DEPRECATED ( bool genKey(const point3d &point, OcTreeKey &key)  const)
inlineinherited
Deprecated:
, replaced with coordToKeyChecked()

Definition at line 443 of file OcTreeBaseImpl.h.

octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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.

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

Definition at line 266 of file OcTreeBaseImpl.h.

const leaf_iterator octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::expandRecurs ( CountingOcTreeNode node,
unsigned int  depth,
unsigned int  max_depth 
)
protectedinherited

recursive call of expand()

void octomap::CountingOcTree::getCentersMinHits ( point3d_list node_centers,
unsigned int  min_hits 
) const
void octomap::CountingOcTree::getCentersMinHitsRecurs ( point3d_list node_centers,
unsigned int &  min_hits,
unsigned int  max_depth,
CountingOcTreeNode node,
unsigned int  depth,
const OcTreeKey parent_key 
) const
protected
virtual void octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::getNodeSize ( unsigned  depth) const
inlineinherited

Definition at line 111 of file OcTreeBaseImpl.h.

size_t octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::getNumLeafNodes ( ) const
inherited

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

size_t octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::getNumLeafNodesRecurs ( const CountingOcTreeNode parent) const
protectedinherited
double octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::getResolution ( ) const
inlinevirtualinherited

Implements octomap::AbstractOcTree.

Definition at line 107 of file OcTreeBaseImpl.h.

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< CountingOcTreeNode , AbstractOcTree >::getTreeDepth ( ) const
inlineinherited

Definition at line 109 of file OcTreeBaseImpl.h.

std::string octomap::OcTreeBase< CountingOcTreeNode >::getTreeType ( ) const
inlinevirtualinherited

returns actual class name as string for identification

Implements octomap::AbstractOcTree.

Definition at line 64 of file OcTreeBase.h.

void octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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

double octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::memoryUsage ( ) const
virtualinherited
Returns
Memory usage of the complete octree in bytes (may vary between architectures)

Implements octomap::AbstractOcTree.

virtual size_t octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::prune ( )
virtualinherited

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

Implements octomap::AbstractOcTree.

void octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::pruneRecurs ( CountingOcTreeNode 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.

std::istream& octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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
CountingOcTreeNode * octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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
CountingOcTreeNode * octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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
CountingOcTreeNode * octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::size ( ) const
inlinevirtualinherited
Returns
The number of nodes in the tree

Implements octomap::AbstractOcTree.

Definition at line 176 of file OcTreeBaseImpl.h.

virtual CountingOcTreeNode* octomap::CountingOcTree::updateNode ( const point3d value)
virtual
CountingOcTreeNode* octomap::CountingOcTree::updateNode ( const OcTreeKey k)
double octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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)

std::ostream& octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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

StaticMemberInitializer octomap::CountingOcTree::countingOcTreeMemberInit
staticprotected

static member to ensure static initialization (only once)

Definition at line 132 of file CountingOcTree.h.

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< CountingOcTreeNode , AbstractOcTree >::leaf_iterator_bbx_end
protectedinherited

Definition at line 547 of file OcTreeBaseImpl.h.

const leaf_iterator octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::leaf_iterator_end
protectedinherited

Definition at line 546 of file OcTreeBaseImpl.h.

double octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::max_value[3]
protectedinherited

max in x, y, z

Definition at line 539 of file OcTreeBaseImpl.h.

double octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::min_value[3]
protectedinherited

min in x, y, z

Definition at line 540 of file OcTreeBaseImpl.h.

double octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::resolution
protectedinherited

in meters

Definition at line 530 of file OcTreeBaseImpl.h.

double octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::resolution_factor
protectedinherited

= 1. / resolution

Definition at line 531 of file OcTreeBaseImpl.h.

Definition at line 525 of file OcTreeBaseImpl.h.

bool octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::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< CountingOcTreeNode , AbstractOcTree >::tree_center
protectedinherited

Definition at line 537 of file OcTreeBaseImpl.h.

const unsigned int octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::tree_depth
protectedinherited

Maximum tree depth is fixed to 16 currently.

Definition at line 528 of file OcTreeBaseImpl.h.

const tree_iterator octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::tree_iterator_end
protectedinherited

Definition at line 548 of file OcTreeBaseImpl.h.

const unsigned int octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::tree_max_val
protectedinherited

Definition at line 529 of file OcTreeBaseImpl.h.

size_t octomap::OcTreeBaseImpl< CountingOcTreeNode , AbstractOcTree >::tree_size
protectedinherited

number of nodes in tree

Definition at line 533 of file OcTreeBaseImpl.h.




Page generated by Doxygen 1.8.11 for MRPT 1.4.0 SVN:Unversioned directory at Tue Jun 28 11:46:25 UTC 2016