octomap  1.8.0
 All Data Structures Namespaces Files Functions Variables Typedefs Friends Macros Pages
octomap::OcTreeStamped Class Reference
+ Inheritance diagram for octomap::OcTreeStamped:
+ Collaboration diagram for octomap::OcTreeStamped:

Data Structures

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

Public Types

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

Public Member Functions

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...
 
key_type adjustKeyAtDepth (key_type 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 bbxSet () const
 
iterator begin (unsigned char maxDepth=0) const
 
leaf_iterator begin_leafs (unsigned char maxDepth=0) 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
 
tree_iterator begin_tree (unsigned char maxDepth=0) const
 
size_t calcNumNodes () const
 Traverses the tree to calculate the total number of nodes. 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...
 
KeyBoolMap::const_iterator changedKeysBegin () const
 Iterator to traverse all keys of changed nodes. More...
 
KeyBoolMap::const_iterator changedKeysEnd () const
 Iterator to traverse all keys of changed nodes. More...
 
void clear ()
 Deletes the complete tree structure. More...
 
void clearKeyRays ()
 Clear KeyRay vector to minimize unneeded memory. More...
 
void computeDiscreteUpdate (const Pointcloud &scan, const octomap::point3d &origin, KeySet &free_cells, KeySet &occupied_cells, double maxrange)
 Helper for insertPointCloud(). 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...
 
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...
 
void computeUpdate (const Pointcloud &scan, const octomap::point3d &origin, KeySet &free_cells, KeySet &occupied_cells, double maxrange)
 Helper for insertPointCloud(). More...
 
key_type coordToKey (double coordinate) const
 Converts from a single coordinate into a discrete key. More...
 
key_type 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...
 
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, key_type &key) const
 Converts a single coordinate into a discrete addressing key, with boundary checking. More...
 
bool coordToKeyChecked (double coordinate, unsigned depth, key_type &key) const
 Converts a single coordinate into a discrete addressing key, with boundary checking. More...
 
OcTreeStampedcreate () const
 virtual constructor: creates a new object of same type (Covariant return type requires an up-to-date compiler) More...
 
OcTreeNodeStampedcreateNodeChild (OcTreeNodeStamped *node, unsigned int childIdx)
 Creates (allocates) the i-th child of the node. More...
 
void degradeOutdatedNodes (unsigned int time_thres)
 
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 deleteNodeChild (OcTreeNodeStamped *node, unsigned int childIdx)
 Deletes the i-th child of the node. More...
 
void enableChangeDetection (bool enable)
 track or ignore changes while inserting scans (default: ignore) More...
 
const iterator end () const
 
const leaf_iterator end_leafs () const
 
const leaf_bbx_iterator end_leafs_bbx () const
 
const tree_iterator end_tree () const
 
virtual void expand ()
 Expands all pruned nodes (reverse of prune()) More...
 
virtual void expandNode (OcTreeNodeStamped *node)
 Expands a node (reverse of pruning): All children are created and their occupancy probability is set to the node's value. More...
 
point3d getBBXBounds () const
 
point3d getBBXCenter () const
 
point3d getBBXMax () const
 
point3d getBBXMin () const
 
double getClampingThresMax () const
 
float getClampingThresMaxLog () const
 
double getClampingThresMin () const
 
float getClampingThresMinLog () const
 
unsigned int getLastUpdateTime ()
 
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...
 
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 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...
 
OcTreeNodeStampedgetNodeChild (OcTreeNodeStamped *node, unsigned int childIdx) const
 
const OcTreeNodeStampedgetNodeChild (const OcTreeNodeStamped *node, unsigned int childIdx) const
 
double getNodeSize (unsigned depth) const
 
bool getNormals (const point3d &point, std::vector< point3d > &normals, bool unknownStatus=true) const
 Performs a step of the marching cubes surface reconstruction algorithm to retreive the normal of the triangles that fall in the cube formed by the voxels located at the vertex of a given voxel. More...
 
size_t getNumLeafNodes () const
 Traverses the tree to calculate the total number of leaf nodes. More...
 
double getOccupancyThres () const
 
float getOccupancyThresLog () const
 
double getProbHit () const
 
float getProbHitLog () const
 
double getProbMiss () const
 
float getProbMissLog () const
 
virtual bool getRayIntersection (const point3d &origin, const point3d &direction, const point3d &center, point3d &intersection, double delta=0.0) const
 Retrieves the entry point of a ray into a voxel. More...
 
double getResolution () const
 
OcTreeNodeStampedgetRoot () const
 
unsigned int getTreeDepth () const
 
std::string getTreeType () const
 returns actual class name as string for identification More...
 
void getUnknownLeafCenters (point3d_list &node_centers, point3d pmin, point3d pmax, unsigned int depth=0) const
 return centers of leafs that do NOT exist (but could) in a given bounding box More...
 
bool inBBX (const point3d &p) const
 
bool inBBX (const OcTreeKey &key) const
 
virtual void insertPointCloud (const Pointcloud &scan, const octomap::point3d &sensor_origin, double maxrange=-1., bool lazy_eval=false, bool discretize=false)
 Integrate a Pointcloud (in global reference frame), parallelized with OpenMP. More...
 
virtual void insertPointCloud (const Pointcloud &scan, const point3d &sensor_origin, const pose6d &frame_origin, double maxrange=-1., bool lazy_eval=false, bool discretize=false)
 Integrate a 3d scan (transform scan before tree update), parallelized with OpenMP. More...
 
virtual void insertPointCloud (const ScanNode &scan, double maxrange=-1., bool lazy_eval=false, bool discretize=false)
 Insert a 3d scan (given as a ScanNode) into the tree, parallelized with OpenMP. More...
 
virtual void insertPointCloudRays (const Pointcloud &scan, const point3d &sensor_origin, double maxrange=-1., bool lazy_eval=false)
 Integrate a Pointcloud (in global reference frame), parallelized with OpenMP. 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 void integrateHit (OcTreeNodeStamped *occupancyNode) const
 integrate a "hit" measurement according to the tree's sensor model More...
 
virtual void integrateMiss (OcTreeNodeStamped *occupancyNode) const
 integrate a "miss" measurement according to the tree's sensor model More...
 
void integrateMissNoTime (OcTreeNodeStamped *node) const
 
bool isChangeDetectionEnabled () const
 
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...
 
virtual bool isNodeCollapsible (const OcTreeNodeStamped *node) const
 A node is collapsible if all children exist, don't have children of their own and have the same occupancy value. 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...
 
double keyToCoord (key_type 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 (key_type 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...
 
unsigned long long memoryFullGrid () const
 
virtual size_t memoryUsage () const
 
virtual size_t memoryUsageNode () const
 
bool nodeChildExists (const OcTreeNodeStamped *node, unsigned int childIdx) const
 Safe test if node has a child at index childIdx. More...
 
bool nodeHasChildren (const OcTreeNodeStamped *node) const
 Safe test if node has any children. More...
 
virtual void nodeToMaxLikelihood (OcTreeNodeStamped *occupancyNode) const
 converts the node to the maximum likelihood value according to the tree's parameter for "occupancy" More...
 
virtual void nodeToMaxLikelihood (OcTreeNodeStamped &occupancyNode) const
 converts the node to the maximum likelihood value according to the tree's parameter for "occupancy" More...
 
size_t numChangesDetected () const
 Number of changes since last reset. More...
 
 OcTreeStamped (double resolution)
 Default constructor, sets resolution of leafs. More...
 
bool operator== (const OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree > &rhs) const
 Comparison between two octrees, all meta data, all nodes, and the structure must be identical. More...
 
virtual void prune ()
 Lossless compression of the octree: A node will replace all of its eight children if they have identical values. More...
 
virtual bool pruneNode (OcTreeNodeStamped *node)
 Prunes a node when it is collapsible. 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...
 
std::istream & readBinaryData (std::istream &s)
 Reads only the data (=complete tree structure) from the input stream. More...
 
std::istream & readBinaryNode (std::istream &s, OcTreeNodeStamped *node)
 Read node from binary stream (max-likelihood value), recursively continue with all children. 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...
 
void resetChangeDetection ()
 Reset the set of changed keys. Call this after you obtained all changed nodes. More...
 
OcTreeNodeStampedsearch (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...
 
OcTreeNodeStampedsearch (const point3d &value, unsigned int depth=0) const
 Search node at specified depth given a 3d point (depth=0: search full tree depth) You need to check if the returned node is NULL, since it can be in unknown space. More...
 
OcTreeNodeStampedsearch (const OcTreeKey &key, unsigned int depth=0) const
 Search a node at specified depth given an addressing key (depth=0: search full tree depth) You need to check if the returned node is NULL, since it can be in unknown space. More...
 
void setBBXMax (point3d &max)
 sets the maximum for a query bounding box to use More...
 
void setBBXMin (point3d &min)
 sets the minimum for a query bounding box to use More...
 
void setClampingThresMax (double thresProb)
 sets the maximum threshold for occupancy clamping (sensor model) More...
 
void setClampingThresMin (double thresProb)
 sets the minimum threshold for occupancy clamping (sensor model) More...
 
virtual OcTreeNodeStampedsetNodeValue (const OcTreeKey &key, float log_odds_value, bool lazy_eval=false)
 Set log_odds value of voxel to log_odds_value. More...
 
virtual OcTreeNodeStampedsetNodeValue (const point3d &value, float log_odds_value, bool lazy_eval=false)
 Set log_odds value of voxel to log_odds_value. More...
 
virtual OcTreeNodeStampedsetNodeValue (double x, double y, double z, float log_odds_value, bool lazy_eval=false)
 Set log_odds value of voxel to log_odds_value. More...
 
void setOccupancyThres (double prob)
 sets the threshold for occupancy (sensor model) More...
 
void setProbHit (double prob)
 sets the probability for a "hit" (will be converted to logodds) - sensor model More...
 
void setProbMiss (double prob)
 sets the probability for a "miss" (will be converted to logodds) - sensor model More...
 
void setResolution (double r)
 Change the resolution of the octree, scaling all voxels. This will not preserve the (metric) scale! More...
 
virtual size_t size () const
 
void swapContent (OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree > &rhs)
 Swap contents of two octrees, i.e., only the underlying pointer / tree structure. 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...
 
void updateInnerOccupancy ()
 Updates the occupancy of all inner nodes to reflect their children's occupancy. More...
 
virtual OcTreeNodeStampedupdateNode (const OcTreeKey &key, float log_odds_update, bool lazy_eval=false)
 Manipulate log_odds value of a voxel by changing it by log_odds_update (relative). More...
 
virtual OcTreeNodeStampedupdateNode (const point3d &value, float log_odds_update, bool lazy_eval=false)
 Manipulate log_odds value of a voxel by changing it by log_odds_update (relative). More...
 
virtual OcTreeNodeStampedupdateNode (double x, double y, double z, float log_odds_update, bool lazy_eval=false)
 Manipulate log_odds value of a voxel by changing it by log_odds_update (relative). More...
 
virtual OcTreeNodeStampedupdateNode (const OcTreeKey &key, bool occupied, bool lazy_eval=false)
 Integrate occupancy measurement. More...
 
virtual OcTreeNodeStampedupdateNode (const point3d &value, bool occupied, bool lazy_eval=false)
 Integrate occupancy measurement. More...
 
virtual OcTreeNodeStampedupdateNode (double x, double y, double z, bool occupied, bool lazy_eval=false)
 Integrate occupancy measurement. More...
 
virtual void updateNodeLogOdds (OcTreeNodeStamped *node, const float &update) const
 update logodds value of node by adding to the current value. More...
 
void useBBXLimit (bool enable)
 use or ignore BBX limit (default: ignore) More...
 
double volume ()
 
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...
 
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...
 
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...
 
std::ostream & writeBinaryNode (std::ostream &s, const OcTreeNodeStamped *node) const
 Write node to binary stream (max-likelihood value), recursively continue with all children. More...
 
std::ostream & writeData (std::ostream &s) const
 Write complete state of tree to stream (without file header) unmodified. Pruning the tree first produces smaller files (lossless compression) 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. This creates a new octree which you need to delete yourself. More...
 

Protected Member Functions

void allocNodeChildren (OcTreeNodeStamped *node)
 
void calcMinMax ()
 recalculates min and max in x, y, z. Does nothing when tree size didn't change. More...
 
void calcNumNodesRecurs (OcTreeNodeStamped *node, size_t &num_nodes) const
 
void deleteNodeRecurs (OcTreeNodeStamped *node)
 recursive delete of node and all children (deallocates memory) More...
 
bool deleteNodeRecurs (OcTreeNodeStamped *node, unsigned int depth, unsigned int max_depth, const OcTreeKey &key)
 recursive call of deleteNode() More...
 
void expandRecurs (OcTreeNodeStamped *node, unsigned int depth, unsigned int max_depth)
 recursive call of expand() More...
 
size_t getNumLeafNodesRecurs (const OcTreeNodeStamped *parent) const
 
void init ()
 initialize non-trivial members, helper for constructors More...
 
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...
 
void pruneRecurs (OcTreeNodeStamped *node, unsigned int depth, unsigned int max_depth, unsigned int &num_pruned)
 recursive call of prune() More...
 
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...
 
std::istream & readNodesRecurs (OcTreeNodeStamped *, std::istream &s)
 recursive call of readData() More...
 
OcTreeNodeStampedsetNodeValueRecurs (OcTreeNodeStamped *node, bool node_just_created, const OcTreeKey &key, unsigned int depth, const float &log_odds_value, bool lazy_eval=false)
 
void toMaxLikelihoodRecurs (OcTreeNodeStamped *node, unsigned int depth, unsigned int max_depth)
 
void updateInnerOccupancyRecurs (OcTreeNodeStamped *node, unsigned int depth)
 
OcTreeNodeStampedupdateNodeRecurs (OcTreeNodeStamped *node, bool node_just_created, const OcTreeKey &key, unsigned int depth, const float &log_odds_update, bool lazy_eval=false)
 
std::ostream & writeNodesRecurs (const OcTreeNodeStamped *, std::ostream &s) const
 recursive call of writeData() 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

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

Static Protected Attributes

static const std::string binaryFileHeader = "# Octomap OcTree binary file"
 
static const std::string fileHeader = "# Octomap OcTree file"
 
static StaticMemberInitializer ocTreeStampedMemberInit
 to ensure static initialization (only once) More...
 

Member Typedef Documentation

Make the templated NODE type available from the outside.

Constructor & Destructor Documentation

octomap::OcTreeStamped::OcTreeStamped ( double  resolution)

Member Function Documentation

OcTreeKey octomap::OcTreeBaseImpl< OcTreeNodeStamped , 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

References octomap::OcTreeBaseImpl< NODE, INTERFACE >::adjustKeyAtDepth(), and octomap::OcTreeBaseImpl< NODE, INTERFACE >::tree_depth.

key_type octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::adjustKeyAtDepth ( key_type  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
void octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::allocNodeChildren ( OcTreeNodeStamped node)
protectedinherited
iterator octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::begin ( unsigned char  maxDepth = 0) const
inlineinherited
Returns
beginning of the tree as leaf iterator
leaf_iterator octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::begin_leafs ( unsigned char  maxDepth = 0) const
inlineinherited
Returns
beginning of the tree as leaf iterator

Referenced by degradeOutdatedNodes().

leaf_bbx_iterator octomap::OcTreeBaseImpl< OcTreeNodeStamped , 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
leaf_bbx_iterator octomap::OcTreeBaseImpl< OcTreeNodeStamped , 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
tree_iterator octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::begin_tree ( unsigned char  maxDepth = 0) const
inlineinherited
Returns
beginning of the tree as iterator to all nodes (incl. inner)
void octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::calcMinMax ( )
protectedinherited

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

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

Traverses the tree to calculate the total number of nodes.

void octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::calcNumNodesRecurs ( OcTreeNodeStamped node,
size_t &  num_nodes 
) const
protectedinherited
virtual bool octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::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().

Can be called in parallel e.g. with OpenMP for a speedup.

A ray is cast from 'origin' with a given direction, the first non-free cell is returned in 'end' (as center coordinate). This could also be the origin node if it is occupied or unknown. castRay() returns true if an occupied node was hit by the raycast. If the raycast returns false you can search() the node at 'end' and see whether it's unknown space.

Parameters
[in]originstarting coordinate of ray
[in]directionA vector pointing in the direction of the raycast (NOT a point in space). Does not need to be normalized.
[out]endreturns the center of the last cell on the ray. If the function returns true, it is occupied.
[in]ignoreUnknownCellswhether unknown cells are ignored (= treated as free). If false (default), the raycast aborts when an unknown cell is hit and returns false.
[in]maxRangeMaximum range after which the raycast is aborted (<= 0: no limit, default)
Returns
true if an occupied cell was hit, false if the maximum range or octree bounds are reached, or if an unknown node was hit.
KeyBoolMap::const_iterator octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::changedKeysBegin ( ) const
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)

References octomap::OccupancyOcTreeBase< NODE >::changed_keys.

KeyBoolMap::const_iterator octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::changedKeysEnd ( ) const
inlineinherited

Iterator to traverse all keys of changed nodes.

References octomap::OccupancyOcTreeBase< NODE >::changed_keys.

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

Deletes the complete tree structure.

Implements octomap::AbstractOcTree.

void octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::clearKeyRays ( )
inlineinherited

Clear KeyRay vector to minimize unneeded memory.

This is only useful for the StaticMemberInitializer classes, don't call it for an octree that is actually used.

References octomap::OcTreeBaseImpl< NODE, INTERFACE >::keyrays.

void octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::computeDiscreteUpdate ( const Pointcloud scan,
const octomap::point3d origin,
KeySet free_cells,
KeySet occupied_cells,
double  maxrange 
)
inherited

Helper for insertPointCloud().

Computes all octree nodes affected by the point cloud integration at once. Here, occupied nodes have a preference over free ones. This function first discretizes the scan with the octree grid, which results in fewer raycasts (=speedup) but a slightly different result than computeUpdate().

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)
bool octomap::OcTreeBaseImpl< OcTreeNodeStamped , 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< OcTreeNodeStamped , 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< OcTreeNodeStamped >::computeUpdate ( const Pointcloud scan,
const octomap::point3d origin,
KeySet free_cells,
KeySet occupied_cells,
double  maxrange 
)
inherited

Helper for insertPointCloud().

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)
key_type octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::coordToKey ( double  coordinate) const
inlineinherited
key_type octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::coordToKey ( double  coordinate,
unsigned  depth 
) const
inherited

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

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

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

References octomap::OcTreeBaseImpl< NODE, INTERFACE >::coordToKey().

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

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

References octomap::OcTreeBaseImpl< NODE, INTERFACE >::coordToKey().

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

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

References octomap::OcTreeBaseImpl< NODE, INTERFACE >::coordToKey(), and octomap::OcTreeBaseImpl< NODE, INTERFACE >::tree_depth.

OcTreeKey octomap::OcTreeBaseImpl< OcTreeNodeStamped , 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.

References octomap::OcTreeBaseImpl< NODE, INTERFACE >::coordToKey(), and octomap::OcTreeBaseImpl< NODE, INTERFACE >::tree_depth.

bool octomap::OcTreeBaseImpl< OcTreeNodeStamped , 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< OcTreeNodeStamped , 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< OcTreeNodeStamped , 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< OcTreeNodeStamped , 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< OcTreeNodeStamped , AbstractOccupancyOcTree >::coordToKeyChecked ( double  coordinate,
key_type 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< OcTreeNodeStamped , AbstractOccupancyOcTree >::coordToKeyChecked ( double  coordinate,
unsigned  depth,
key_type 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
OcTreeStamped* octomap::OcTreeStamped::create ( ) const
inlinevirtual

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

Implements octomap::AbstractOcTree.

References OcTreeStamped().

OcTreeNodeStamped * octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::createNodeChild ( OcTreeNodeStamped node,
unsigned int  childIdx 
)
inherited

Creates (allocates) the i-th child of the node.

Returns
ptr to newly create NODE
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!

References OCTOMAP_ERROR, and octomap::AbstractOcTree::setResolution().

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

bool octomap::OcTreeBaseImpl< OcTreeNodeStamped , 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< OcTreeNodeStamped , 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< OcTreeNodeStamped , 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.

void octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::deleteNodeChild ( OcTreeNodeStamped node,
unsigned int  childIdx 
)
inherited

Deletes the i-th child of the node.

void octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::deleteNodeRecurs ( OcTreeNodeStamped node)
protectedinherited

recursive delete of node and all children (deallocates memory)

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

recursive call of deleteNode()

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

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

References octomap::OccupancyOcTreeBase< NODE >::use_change_detection.

Returns
end of the tree as leaf iterator

References octomap::OcTreeBaseImpl< NODE, INTERFACE >::leaf_iterator_end.

Referenced by degradeOutdatedNodes().

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

References octomap::OcTreeBaseImpl< NODE, INTERFACE >::leaf_iterator_end.

Referenced by degradeOutdatedNodes().

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

References octomap::OcTreeBaseImpl< NODE, INTERFACE >::leaf_iterator_bbx_end.

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

References octomap::OcTreeBaseImpl< NODE, INTERFACE >::tree_iterator_end.

virtual void octomap::OcTreeBaseImpl< OcTreeNodeStamped , 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.

virtual void octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::expandNode ( OcTreeNodeStamped node)
virtualinherited

Expands a node (reverse of pruning): All children are created and their occupancy probability is set to the node's value.

You need to verify that this is indeed a pruned node (i.e. not a leaf at the lowest level)

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

recursive call of expand()

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

References octomap::OccupancyOcTreeBase< NODE >::bbx_max.

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

References octomap::OccupancyOcTreeBase< NODE >::bbx_min.

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

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

Referenced by main().

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

References octomap::AbstractOccupancyOcTree::clamping_thres_max.

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

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

Referenced by main().

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

References octomap::AbstractOccupancyOcTree::clamping_thres_min.

unsigned int octomap::OcTreeStamped::getLastUpdateTime ( )
virtual void octomap::OcTreeBaseImpl< OcTreeNodeStamped , 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< OcTreeNodeStamped , 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< OcTreeNodeStamped , 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< OcTreeNodeStamped , 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< OcTreeNodeStamped , 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< OcTreeNodeStamped , AbstractOccupancyOcTree >::getMetricSize ( double &  x,
double &  y,
double &  z 
) const
virtualinherited

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

OcTreeNodeStamped * octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::getNodeChild ( OcTreeNodeStamped node,
unsigned int  childIdx 
) const
inherited
Returns
ptr to child number childIdx of node
const OcTreeNodeStamped * octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::getNodeChild ( const OcTreeNodeStamped node,
unsigned int  childIdx 
) const
inherited
Returns
const ptr to child number childIdx of node
bool octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::getNormals ( const point3d point,
std::vector< point3d > &  normals,
bool  unknownStatus = true 
) const
inherited

Performs a step of the marching cubes surface reconstruction algorithm to retreive the normal of the triangles that fall in the cube formed by the voxels located at the vertex of a given voxel.

Parameters
[in]voxelfor which retreive the normals
[out]trianglesnormals
[in]unknownStatusconsider unknown cells as free (false) or occupied (default, true).
Returns
True if the input voxel is known in the occupancy grid, and false if it is unknown.
size_t octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::getNumLeafNodes ( ) const
inherited

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

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

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

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

References octomap::AbstractOccupancyOcTree::occ_prob_thres_log.

double octomap::AbstractOccupancyOcTree::getProbHit ( ) const
inlineinherited
Returns
probability for a "hit" in the sensor model (probability)

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

Referenced by main().

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

References octomap::AbstractOccupancyOcTree::prob_hit_log.

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

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

Referenced by main().

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

References octomap::AbstractOccupancyOcTree::prob_miss_log.

virtual bool octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::getRayIntersection ( const point3d origin,
const point3d direction,
const point3d center,
point3d intersection,
double  delta = 0.0 
) const
virtualinherited

Retrieves the entry point of a ray into a voxel.

This is the closest intersection point of the ray originating from origin and a plane of the axis aligned cube.

Parameters
[in]originStarting point of ray
[in]directionA vector pointing in the direction of the raycast. Does not need to be normalized.
[in]centerThe center of the voxel where the ray terminated. This is the output of castRay.
[out]intersectionThe entry point of the ray into the voxel, on the voxel surface.
[in]deltaA small increment to avoid ambiguity of beeing exactly on a voxel surface. A positive value will get the point out of the hit voxel, while a negative valuewill get it inside.
Returns
Whether or not an intesection point has been found. Either, the ray never cross the voxel or the ray is exactly parallel to the only surface it intersect.
Returns
Pointer to the root node of the tree. This pointer should not be modified or deleted externally, the OcTree manages its memory itself. In an empty tree, root is NULL.

References octomap::OcTreeBaseImpl< NODE, INTERFACE >::root.

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

returns actual class name as string for identification

Implements octomap::AbstractOcTree.

Referenced by main().

void octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::getUnknownLeafCenters ( point3d_list node_centers,
point3d  pmin,
point3d  pmax,
unsigned int  depth = 0 
) const
inherited

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

bool octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::inBBX ( const point3d p) const
inherited
Returns
true if point is in the currently set bounding box
bool octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::inBBX ( const OcTreeKey key) const
inherited
Returns
true if key is in the currently set bounding box
void octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::init ( )
protectedinherited

initialize non-trivial members, helper for constructors

virtual void octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::insertPointCloud ( const Pointcloud scan,
const octomap::point3d sensor_origin,
double  maxrange = -1.,
bool  lazy_eval = false,
bool  discretize = false 
)
virtualinherited

Integrate a Pointcloud (in global reference frame), parallelized with OpenMP.

Special care is taken that each voxel in the map is updated only once, and occupied nodes have a preference over free ones. This avoids holes in the floor from mutual deletion and is more efficient than the plain ray insertion in insertPointCloudRays().

Note
replaces insertScan()
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)
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.
discretizewhether the scan is discretized first into octree key cells (default: false). This reduces the number of raycasts using computeDiscreteUpdate(), resulting in a potential speedup.*
virtual void octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::insertPointCloud ( const Pointcloud scan,
const point3d sensor_origin,
const pose6d frame_origin,
double  maxrange = -1.,
bool  lazy_eval = false,
bool  discretize = false 
)
virtualinherited

Integrate a 3d scan (transform scan before tree update), parallelized with OpenMP.

Special care is taken that each voxel in the map is updated only once, and occupied nodes have a preference over free ones. This avoids holes in the floor from mutual deletion and is more efficient than the plain ray insertion in insertPointCloudRays().

Note
replaces insertScan()
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)
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.
discretizewhether the scan is discretized first into octree key cells (default: false). This reduces the number of raycasts using computeDiscreteUpdate(), resulting in a potential speedup.*
virtual void octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::insertPointCloud ( const ScanNode scan,
double  maxrange = -1.,
bool  lazy_eval = false,
bool  discretize = false 
)
virtualinherited

Insert a 3d scan (given as a ScanNode) into the tree, parallelized with OpenMP.

Note
replaces insertScan
Parameters
scanScanNode contains Pointcloud data and frame/sensor origin
maxrangemaximum range for how long individual beams are inserted (default -1: complete beam)
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.
discretizewhether the scan is discretized first into octree key cells (default: false). This reduces the number of raycasts using computeDiscreteUpdate(), resulting in a potential speedup.
virtual void octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::insertPointCloudRays ( const Pointcloud scan,
const point3d sensor_origin,
double  maxrange = -1.,
bool  lazy_eval = false 
)
virtualinherited

Integrate a Pointcloud (in global reference frame), parallelized with OpenMP.

This function simply inserts all rays of the point clouds as batch operation. Discretization effects can lead to the deletion of occupied space, it is usually recommended to use insertPointCloud() instead.

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)
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 bool octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::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. It is usually more efficient to insert complete pointcloudsm with insertPointCloud() or insertPointCloudRays().

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< OcTreeNodeStamped >::integrateHit ( OcTreeNodeStamped occupancyNode) const
virtualinherited

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

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

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

void octomap::OcTreeStamped::integrateMissNoTime ( OcTreeNodeStamped node) const
bool octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::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::OccupancyOcTreeBase< OcTreeNodeStamped >::isChangeDetectionEnabled ( ) const
inlineinherited
bool octomap::AbstractOccupancyOcTree::isNodeAtThreshold ( const OcTreeNode occupancyNode) const
inlineinherited

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

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

Referenced by calcThresholdedNodes().

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

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

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

virtual bool octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::isNodeCollapsible ( const OcTreeNodeStamped node) const
virtualinherited

A node is collapsible if all children exist, don't have children of their own and have the same occupancy value.

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

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

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

Referenced by degradeOutdatedNodes(), getLeafNodesRecurs(), main(), printChanges(), and octomap::ColorOcTree::writeColorHistogram().

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

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

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

double octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::keyToCoord ( key_type  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< OcTreeNodeStamped , AbstractOccupancyOcTree >::keyToCoord ( key_type  key) const
inlineinherited

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

References octomap::OcTreeBaseImpl< NODE, INTERFACE >::resolution, and octomap::OcTreeBaseImpl< NODE, INTERFACE >::tree_max_val.

point3d octomap::OcTreeBaseImpl< OcTreeNodeStamped , 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

References octomap::OcTreeBaseImpl< NODE, INTERFACE >::keyToCoord().

point3d octomap::OcTreeBaseImpl< OcTreeNodeStamped , 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

References octomap::OcTreeBaseImpl< NODE, INTERFACE >::keyToCoord().

unsigned long long octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::memoryFullGrid ( ) const
inherited
Returns
Memory usage of a full grid of the same size as the OcTree in bytes (for comparison)
Note
this can be larger than the adressable memory - size_t may not be enough to hold it!
virtual size_t octomap::OcTreeBaseImpl< OcTreeNodeStamped , 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< OcTreeNodeStamped , AbstractOccupancyOcTree >::memoryUsageNode ( ) const
inlinevirtualinherited
Returns
Memory usage of a single octree node

Implements octomap::AbstractOcTree.

bool octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::nodeChildExists ( const OcTreeNodeStamped node,
unsigned int  childIdx 
) const
inherited

Safe test if node has a child at index childIdx.

First tests if there are any children. Replaces node->childExists(...)

Returns
true if the child at childIdx exists
bool octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::nodeHasChildren ( const OcTreeNodeStamped node) const
inherited

Safe test if node has any children.

Replaces node->hasChildren(...)

Returns
true if node has at least one child
virtual void octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::nodeToMaxLikelihood ( OcTreeNodeStamped occupancyNode) const
virtualinherited

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

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

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

size_t octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::numChangesDetected ( ) const
inlineinherited

Number of changes since last reset.

References octomap::OccupancyOcTreeBase< NODE >::changed_keys.

Comparison between two octrees, all meta data, all nodes, and the structure must be identical.

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

Lossless compression of the octree: A node will replace all of its eight children if they have identical values.

You usually don't have to call prune() after a regular occupancy update, updateNode() incrementally prunes all affected nodes.

Implements octomap::AbstractOcTree.

virtual bool octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::pruneNode ( OcTreeNodeStamped node)
virtualinherited

Prunes a node when it is collapsible.

Returns
true if pruning was successful
void octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::pruneRecurs ( OcTreeNodeStamped node,
unsigned int  depth,
unsigned int  max_depth,
unsigned int &  num_pruned 
)
protectedinherited

recursive call of prune()

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);

References OCTOMAP_ERROR_STR.

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.

References octomap::AbstractOcTree::createTree(), octomap::AbstractOcTree::fileHeader, OCTOMAP_DEBUG_STR, OCTOMAP_ERROR_STR, octomap::AbstractOcTree::readData(), octomap::AbstractOcTree::readHeader(), and octomap::AbstractOcTree::size().

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

References OCTOMAP_ERROR_STR, and octomap::AbstractOccupancyOcTree::readBinary().

std::istream& octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::readBinaryData ( std::istream &  s)
virtualinherited

Reads only the data (=complete 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.

References octomap::AbstractOcTree::clear(), OCTOMAP_ERROR, OCTOMAP_ERROR_STR, and OCTOMAP_WARNING_STR.

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

std::istream& octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::readBinaryNode ( std::istream &  s,
OcTreeNodeStamped node 
)
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.

std::istream& octomap::OcTreeBaseImpl< OcTreeNodeStamped , 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.

bool octomap::AbstractOcTree::readHeader ( std::istream &  s,
std::string &  id,
unsigned &  size,
double &  res 
)
staticprotectedinherited
std::istream& octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::readNodesRecurs ( OcTreeNodeStamped ,
std::istream &  s 
)
protectedinherited

recursive call of readData()

void octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::resetChangeDetection ( )
inlineinherited

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

References octomap::OccupancyOcTreeBase< NODE >::changed_keys.

OcTreeNodeStamped * octomap::OcTreeBaseImpl< OcTreeNodeStamped , 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).

You need to check if the returned node is NULL, since it can be in unknown space.

Returns
pointer to node if found, NULL otherwise
OcTreeNodeStamped * octomap::OcTreeBaseImpl< OcTreeNodeStamped , 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) You need to check if the returned node is NULL, since it can be in unknown space.

Returns
pointer to node if found, NULL otherwise
OcTreeNodeStamped * octomap::OcTreeBaseImpl< OcTreeNodeStamped , 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) You need to check if the returned node is NULL, since it can be in unknown space.

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

sets the maximum for a query bounding box to use

void octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::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)

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

Referenced by octomap::AbstractOccupancyOcTree::AbstractOccupancyOcTree(), and main().

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

sets the minimum threshold for occupancy clamping (sensor model)

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

Referenced by octomap::AbstractOccupancyOcTree::AbstractOccupancyOcTree(), and main().

virtual OcTreeNodeStamped * octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::setNodeValue ( const OcTreeKey key,
float  log_odds_value,
bool  lazy_eval = false 
)
virtualinherited

Set log_odds value of voxel to log_odds_value.

This only works if key is at the lowest octree level

Parameters
keyOcTreeKey of the NODE that is to be updated
log_odds_valuevalue to be set as the log_odds value of the 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 OcTreeNodeStamped * octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::setNodeValue ( const point3d value,
float  log_odds_value,
bool  lazy_eval = false 
)
virtualinherited

Set log_odds value of voxel to log_odds_value.

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

Parameters
value3d coordinate of the NODE that is to be updated
log_odds_valuevalue to be set as the log_odds value of the 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 OcTreeNodeStamped * octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::setNodeValue ( double  x,
double  y,
double  z,
float  log_odds_value,
bool  lazy_eval = false 
)
virtualinherited

Set log_odds value of voxel to log_odds_value.

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

Parameters
x
y
z
log_odds_valuevalue to be set as the log_odds value of the 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
OcTreeNodeStamped * octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::setNodeValueRecurs ( OcTreeNodeStamped node,
bool  node_just_created,
const OcTreeKey key,
unsigned int  depth,
const float &  log_odds_value,
bool  lazy_eval = false 
)
protectedinherited
void octomap::AbstractOccupancyOcTree::setOccupancyThres ( double  prob)
inlineinherited
void octomap::AbstractOccupancyOcTree::setProbHit ( double  prob)
inlineinherited

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

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

Referenced by octomap::AbstractOccupancyOcTree::AbstractOccupancyOcTree(), and main().

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

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

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

Referenced by octomap::AbstractOccupancyOcTree::AbstractOccupancyOcTree(), and main().

void octomap::OcTreeBaseImpl< OcTreeNodeStamped , 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< OcTreeNodeStamped , AbstractOccupancyOcTree >::size ( ) const
inlinevirtualinherited
Returns
The number of nodes in the tree

Implements octomap::AbstractOcTree.

References octomap::OcTreeBaseImpl< NODE, INTERFACE >::tree_size.

Swap contents of two octrees, i.e., only the underlying pointer / tree structure.

You have to ensure yourself that the metadata (resolution etc) matches. No memory is cleared in this function

virtual void octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::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< OcTreeNodeStamped >::toMaxLikelihoodRecurs ( OcTreeNodeStamped node,
unsigned int  depth,
unsigned int  max_depth 
)
protectedinherited
void octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::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< OcTreeNodeStamped >::updateInnerOccupancyRecurs ( OcTreeNodeStamped node,
unsigned int  depth 
)
protectedinherited
virtual OcTreeNodeStamped * octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::updateNode ( const OcTreeKey key,
float  log_odds_update,
bool  lazy_eval = false 
)
virtualinherited

Manipulate log_odds value of a voxel by changing it by log_odds_update (relative).

This only works if key is at the lowest octree level

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 OcTreeNodeStamped * octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::updateNode ( const point3d value,
float  log_odds_update,
bool  lazy_eval = false 
)
virtualinherited

Manipulate log_odds value of a voxel by changing it by log_odds_update (relative).

Looks up the OcTreeKey corresponding to the coordinate and then calls updateNode() 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 OcTreeNodeStamped * octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::updateNode ( double  x,
double  y,
double  z,
float  log_odds_update,
bool  lazy_eval = false 
)
virtualinherited

Manipulate log_odds value of a voxel by changing it by log_odds_update (relative).

Looks up the OcTreeKey corresponding to the coordinate and then calls updateNode() 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 OcTreeNodeStamped * octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::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 OcTreeNodeStamped * octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::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 OcTreeNodeStamped * octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::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
void octomap::OcTreeStamped::updateNodeLogOdds ( OcTreeNodeStamped occupancyNode,
const float &  update 
) const
virtual

update logodds value of node by adding to the current value.

Reimplemented from octomap::OccupancyOcTreeBase< OcTreeNodeStamped >.

References octomap::OccupancyOcTreeBase< NODE >::updateNodeLogOdds(), and octomap::OcTreeNodeStamped::updateTimestamp().

OcTreeNodeStamped * octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::updateNodeRecurs ( OcTreeNodeStamped node,
bool  node_just_created,
const OcTreeKey key,
unsigned int  depth,
const float &  log_odds_update,
bool  lazy_eval = false 
)
protectedinherited
void octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::useBBXLimit ( bool  enable)
inlineinherited

use or ignore BBX limit (default: ignore)

References octomap::OccupancyOcTreeBase< NODE >::use_bbx_limit.

bool octomap::AbstractOcTree::write ( const std::string &  filename) const
inherited

Write file header and complete tree to file (serialization)

References OCTOMAP_ERROR_STR.

Referenced by main().

bool octomap::AbstractOcTree::write ( std::ostream &  s) const
inherited
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

References OCTOMAP_ERROR_STR.

Referenced by main().

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

References octomap::AbstractOcTree::prune(), octomap::AbstractOccupancyOcTree::toMaxLikelihood(), and octomap::AbstractOccupancyOcTree::writeBinaryConst().

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

References OCTOMAP_ERROR_STR.

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

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

References octomap::AbstractOccupancyOcTree::binaryFileHeader, octomap::AbstractOcTree::getResolution(), octomap::AbstractOcTree::getTreeType(), OCTOMAP_DEBUG, OCTOMAP_WARNING_STR, octomap::AbstractOcTree::size(), and octomap::AbstractOccupancyOcTree::writeBinaryData().

std::ostream& octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::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< OcTreeNodeStamped >::writeBinaryNode ( std::ostream &  s,
const OcTreeNodeStamped 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< OcTreeNodeStamped , 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.

std::ostream& octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::writeNodesRecurs ( const OcTreeNodeStamped ,
std::ostream &  s 
) const
protectedinherited

recursive call of writeData()

Field Documentation

point3d octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::bbx_max
protectedinherited
OcTreeKey octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::bbx_max_key
protectedinherited
point3d octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::bbx_min
protectedinherited
OcTreeKey octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::bbx_min_key
protectedinherited
const std::string octomap::AbstractOccupancyOcTree::binaryFileHeader = "# Octomap OcTree binary file"
staticprotectedinherited
KeyBoolMap octomap::OccupancyOcTreeBase< OcTreeNodeStamped >::changed_keys
protectedinherited

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

const std::string octomap::AbstractOcTree::fileHeader = "# Octomap OcTree file"
staticprotectedinherited
std::vector<KeyRay> octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::keyrays
protectedinherited

data structure for ray casting, array for multithreading

const leaf_bbx_iterator octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::leaf_iterator_bbx_end
protectedinherited
const leaf_iterator octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::leaf_iterator_end
protectedinherited
double octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::max_value[3]
protectedinherited

max in x, y, z

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

min in x, y, z contains the size of a voxel at level i (0: root node). tree_depth+1 levels (incl. 0)

OcTreeStamped::StaticMemberInitializer octomap::OcTreeStamped::ocTreeStampedMemberInit
staticprotected

to ensure static initialization (only once)

Referenced by OcTreeStamped().

double octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::resolution
protectedinherited

in meters

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

= 1. / resolution

Pointer to the root NODE, NULL for empty tree.

Referenced by getLastUpdateTime().

bool octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::size_changed
protectedinherited
std::vector<double> octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::sizeLookupTable
protectedinherited
const unsigned int octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::tree_depth
protectedinherited

Maximum tree depth is fixed to 16 currently.

const tree_iterator octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::tree_iterator_end
protectedinherited
const unsigned int octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::tree_max_val
protectedinherited
size_t octomap::OcTreeBaseImpl< OcTreeNodeStamped , AbstractOccupancyOcTree >::tree_size
protectedinherited

number of nodes in tree flag to denote whether the octree extent changed (for lazy min/max eval)

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

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

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

The documentation for this class was generated from the following files: