|
octomap 1.9.8
|
Base implementation for Occupancy Octrees (e.g. More...
#include <OccupancyOcTreeBase.h>
Public Types | |
| typedef leaf_iterator | iterator |
| typedef NODE | NodeType |
| Make the templated NODE type available from the outside. | |
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) | |
| 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 |
| tree_iterator | begin_tree (unsigned char maxDepth=0) const |
| size_t | calcNumNodes () const |
| Traverses the tree to calculate the total number of nodes. | |
| 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(). | |
| KeyBoolMap::const_iterator | changedKeysBegin () const |
| Iterator to traverse all keys of changed nodes. | |
| KeyBoolMap::const_iterator | changedKeysEnd () const |
| Iterator to traverse all keys of changed nodes. | |
| void | clear () |
| Deletes the complete tree structure. | |
| void | clearKeyRays () |
| Clear KeyRay vector to minimize unneeded memory. | |
| void | computeDiscreteUpdate (const Pointcloud &scan, const octomap::point3d &origin, KeySet &free_cells, KeySet &occupied_cells, double maxrange) |
| Helper for insertPointCloud(). | |
| 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. | |
| 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. | |
| void | computeUpdate (const Pointcloud &scan, const octomap::point3d &origin, KeySet &free_cells, KeySet &occupied_cells, double maxrange) |
| Helper for insertPointCloud(). | |
| key_type | coordToKey (double coordinate) const |
| Converts from a single coordinate into a discrete key. | |
| bool | coordToKeyChecked (const point3d &coord, OcTreeKey &key) const |
| Converts a 3D coordinate into a 3D OcTreeKey, with boundary checking. | |
| virtual AbstractOcTree * | create () const =0 |
| virtual constructor: creates a new object of same type | |
| NODE * | createNodeChild (NODE *node, unsigned int childIdx) |
| Creates (allocates) the i-th child of the node. | |
| bool | deleteNode (double x, double y, double z, unsigned int depth=0) |
| Delete a node (if exists) given a 3d point. | |
| void | deleteNodeChild (NODE *node, unsigned int childIdx) |
| Deletes the i-th child of the node. | |
| void | enableChangeDetection (bool enable) |
| track or ignore changes while inserting scans (default: ignore) | |
| 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()) | |
| virtual void | expandNode (NODE *node) |
| Expands a node (reverse of pruning): All children are created and their occupancy probability is set to the node's value. | |
| point3d | getBBXBounds () const |
| point3d | getBBXCenter () const |
| point3d | getBBXMax () const |
| point3d | getBBXMin () const |
| double | getClampingThresMax () const |
| float | getClampingThresMaxLog () const |
| double | getClampingThresMin () const |
| float | getClampingThresMinLog () const |
| virtual void | getMetricMax (double &x, double &y, double &z) const =0 |
| virtual void | getMetricMax (double &x, double &y, double &z) |
| maximum value of the bounding box of all known space in x, y, z | |
| virtual void | getMetricMin (double &x, double &y, double &z) const =0 |
| virtual void | getMetricMin (double &x, double &y, double &z) |
| minimum value of the bounding box of all known space in x, y, z | |
| virtual void | getMetricSize (double &x, double &y, double &z) |
| Size of OcTree (all known space) in meters for x, y and z dimension. | |
| NODE * | getNodeChild (NODE *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 retrieve the normal of the triangles that fall in the cube formed by the voxels located at the vertex of a given voxel. | |
| size_t | getNumLeafNodes () const |
| Traverses the tree to calculate the total number of leaf nodes. | |
| 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 ¢er, point3d &intersection, double delta=0.0) const |
| Retrieves the entry point of a ray into a voxel. | |
| double | getResolution () const |
| NODE * | getRoot () const |
| unsigned int | getTreeDepth () const |
| std::string | getTreeType () const |
| 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 | |
| bool | inBBX (const OcTreeKey &key) const |
| bool | inBBX (const point3d &p) 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| virtual void | integrateHit (NODE *occupancyNode) const |
| integrate a "hit" measurement according to the tree's sensor model | |
| virtual void | integrateMiss (NODE *occupancyNode) const |
| integrate a "miss" measurement according to the tree's sensor model | |
| bool | isChangeDetectionEnabled () const |
| bool | isNodeAtThreshold (const OcTreeNode &occupancyNode) const |
| queries whether a node is at the clamping threshold according to the tree's parameter | |
| bool | isNodeAtThreshold (const OcTreeNode *occupancyNode) const |
| queries whether a node is at the clamping threshold according to the tree's parameter | |
| virtual bool | isNodeCollapsible (const NODE *node) const |
| A node is collapsible if all children exist, don't have children of their own and have the same occupancy value. | |
| bool | isNodeOccupied (const OcTreeNode &occupancyNode) const |
| queries whether a node is occupied according to the tree's parameter for "occupancy" | |
| bool | isNodeOccupied (const OcTreeNode *occupancyNode) const |
| queries whether a node is occupied according to the tree's parameter for "occupancy" | |
| 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 | |
| unsigned long long | memoryFullGrid () const |
| virtual size_t | memoryUsage () const |
| virtual size_t | memoryUsageNode () const |
| bool | nodeChildExists (const NODE *node, unsigned int childIdx) const |
| Safe test if node has a child at index childIdx. | |
| bool | nodeHasChildren (const NODE *node) const |
| Safe test if node has any children. | |
| virtual void | nodeToMaxLikelihood (NODE &occupancyNode) const |
| converts the node to the maximum likelihood value according to the tree's parameter for "occupancy" | |
| virtual void | nodeToMaxLikelihood (NODE *occupancyNode) const |
| converts the node to the maximum likelihood value according to the tree's parameter for "occupancy" | |
| size_t | numChangesDetected () const |
| Number of changes since last reset. | |
| OccupancyOcTreeBase (const OccupancyOcTreeBase< NODE > &rhs) | |
| Copy constructor. | |
| OccupancyOcTreeBase (double resolution) | |
| Default constructor, sets resolution of leafs. | |
| bool | operator== (const OcTreeBaseImpl< NODE, AbstractOccupancyOcTree > &rhs) const |
| Comparison between two octrees, all meta data, all nodes, and the structure must be identical. | |
| virtual void | prune () |
| Lossless compression of the octree: A node will replace all of its eight children if they have identical values. | |
| virtual bool | pruneNode (NODE *node) |
| Prunes a node when it is collapsible. | |
| bool | readBinary (const std::string &filename) |
| Reads OcTree from a binary file. | |
| bool | readBinary (std::istream &s) |
| Reads an OcTree from an input stream. | |
| std::istream & | readBinaryData (std::istream &s) |
| Reads only the data (=complete tree structure) from the input stream. | |
| std::istream & | readBinaryNode (std::istream &s, NODE *node) |
| Read node from binary stream (max-likelihood value), recursively continue with all children. | |
| 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. | |
| void | resetChangeDetection () |
| Reset the set of changed keys. Call this after you obtained all changed nodes. | |
| NODE * | search (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). | |
| void | setBBXMax (const point3d &max) |
| sets the maximum for a query bounding box to use | |
| void | setBBXMin (const point3d &min) |
| sets the minimum for a query bounding box to use | |
| void | setClampingThresMax (double thresProb) |
| sets the maximum threshold for occupancy clamping (sensor model) | |
| void | setClampingThresMin (double thresProb) |
| sets the minimum threshold for occupancy clamping (sensor model) | |
| virtual NODE * | setNodeValue (const OcTreeKey &key, float log_odds_value, bool lazy_eval=false) |
| Set log_odds value of voxel to log_odds_value. | |
| virtual NODE * | setNodeValue (const point3d &value, float log_odds_value, bool lazy_eval=false) |
| Set log_odds value of voxel to log_odds_value. | |
| virtual NODE * | setNodeValue (double x, double y, double z, float log_odds_value, bool lazy_eval=false) |
| Set log_odds value of voxel to log_odds_value. | |
| void | setOccupancyThres (double prob) |
| sets the threshold for occupancy (sensor model) | |
| void | setProbHit (double prob) |
| sets the probability for a "hit" (will be converted to logodds) - sensor model | |
| void | setProbMiss (double prob) |
| sets the probability for a "miss" (will be converted to logodds) - sensor model | |
| void | setResolution (double r) |
| Change the resolution of the octree, scaling all voxels. This will not preserve the (metric) scale! | |
| virtual size_t | size () const |
| void | swapContent (OcTreeBaseImpl< NODE, AbstractOccupancyOcTree > &rhs) |
| Swap contents of two octrees, i.e., only the underlying pointer / tree structure. | |
| virtual void | toMaxLikelihood () |
| Creates the maximum likelihood map by calling toMaxLikelihood on all tree nodes, setting their occupancy to the corresponding occupancy thresholds. | |
| void | updateInnerOccupancy () |
| Updates the occupancy of all inner nodes to reflect their children's occupancy. | |
| virtual NODE * | updateNode (const OcTreeKey &key, bool occupied, bool lazy_eval=false) |
| Integrate occupancy measurement. | |
| virtual NODE * | updateNode (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). | |
| virtual NODE * | updateNode (const point3d &value, bool occupied, bool lazy_eval=false) |
| Integrate occupancy measurement. | |
| virtual NODE * | updateNode (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). | |
| virtual NODE * | updateNode (double x, double y, double z, bool occupied, bool lazy_eval=false) |
| Integrate occupancy measurement. | |
| virtual NODE * | updateNode (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). | |
| virtual void | updateNodeLogOdds (NODE *occupancyNode, const float &update) const |
| update logodds value of node by adding to the current value. | |
| void | useBBXLimit (bool enable) |
| use or ignore BBX limit (default: ignore) | |
| double | volume () |
| bool | write (const std::string &filename) const |
| Write file header and complete tree to file (serialization) | |
| bool | write (std::ostream &s) const |
| Write file header and complete tree to stream (serialization) | |
| bool | writeBinary (const std::string &filename) |
| Writes OcTree to a binary file using writeBinary(). | |
| bool | writeBinary (std::ostream &s) |
| Writes compressed maximum likelihood OcTree to a binary stream. | |
| bool | writeBinaryConst (const std::string &filename) const |
| Writes OcTree to a binary file using writeBinaryConst(). | |
| bool | writeBinaryConst (std::ostream &s) const |
| Writes the maximum likelihood OcTree to a binary stream (const variant). | |
| std::ostream & | writeBinaryData (std::ostream &s) const |
| Writes the data of the tree (without header) to the stream, recursively calling writeBinaryNode (starting with root) | |
| std::ostream & | writeBinaryNode (std::ostream &s, const NODE *node) const |
| Write node to binary stream (max-likelihood value), recursively continue with all children. | |
| 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) | |
| virtual | ~OccupancyOcTreeBase () |
Static Public Member Functions | |
| static AbstractOcTree * | createTree (const std::string id, double res) |
| Creates a certain OcTree (factory pattern) | |
| static AbstractOcTree * | read (const std::string &filename) |
| Read the file header, create the appropriate class and deserialize. | |
| static AbstractOcTree * | read (std::istream &s) |
| Read the file header, create the appropriate class and deserialize. This creates a new octree which you need to delete yourself. | |
Protected Member Functions | |
| void | allocNodeChildren (NODE *node) |
| void | calcMinMax () |
| recalculates min and max in x, y, z. Does nothing when tree size didn't change. | |
| void | calcNumNodesRecurs (NODE *node, size_t &num_nodes) const |
| void | deleteNodeRecurs (NODE *node) |
| Recursively delete a node and all children. Deallocates memory but does NOT set the node ptr to NULL nor updates tree size. | |
| void | expandRecurs (NODE *node, unsigned int depth, unsigned int max_depth) |
| recursive call of expand() | |
| size_t | getNumLeafNodesRecurs (const NODE *parent) const |
| void | init () |
| initialize non-trivial members, helper for constructors | |
| 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. | |
| OccupancyOcTreeBase (double resolution, unsigned int tree_depth, unsigned int tree_max_val) | |
| Constructor to enable derived classes to change tree constants. This usually requires a re-implementation of some core tree-traversal functions as well! | |
| void | pruneRecurs (NODE *node, unsigned int depth, unsigned int max_depth, unsigned int &num_pruned) |
| recursive call of prune() | |
| 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. | |
| std::istream & | readNodesRecurs (NODE *, std::istream &s) |
| recursive call of readData() | |
| NODE * | setNodeValueRecurs (NODE *node, bool node_just_created, const OcTreeKey &key, unsigned int depth, const float &log_odds_value, bool lazy_eval=false) |
| void | toMaxLikelihoodRecurs (NODE *node, unsigned int depth, unsigned int max_depth) |
| void | updateInnerOccupancyRecurs (NODE *node, unsigned int depth) |
| NODE * | updateNodeRecurs (NODE *node, bool node_just_created, const OcTreeKey &key, unsigned int depth, const float &log_odds_update, bool lazy_eval=false) |
| std::ostream & | writeNodesRecurs (const NODE *, std::ostream &s) const |
| recursive call of writeData() | |
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. | |
| float | clamping_thres_max |
| float | clamping_thres_min |
| std::vector< KeyRay > | keyrays |
| data structure for ray casting, array for multithreading | |
| const leaf_bbx_iterator | leaf_iterator_bbx_end |
| const leaf_iterator | leaf_iterator_end |
| double | max_value [3] |
| max in x, y, z | |
| 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) | |
| float | occ_prob_thres_log |
| float | prob_hit_log |
| float | prob_miss_log |
| double | resolution |
| in meters | |
| double | resolution_factor |
| = 1. / resolution | |
| NODE * | root |
| Pointer to the root NODE, NULL for empty tree. | |
| bool | size_changed |
| std::vector< double > | sizeLookupTable |
| point3d | tree_center |
| const unsigned int | tree_depth |
| Maximum tree depth is fixed to 16 currently. | |
| 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) | |
| bool | use_bbx_limit |
| use bounding box for queries (needs to be set)? | |
| bool | use_change_detection |
Static Protected Attributes | |
| static const std::string | binaryFileHeader = "# Octomap OcTree binary file" |
| static const std::string | fileHeader = "# Octomap OcTree file" |
Base implementation for Occupancy Octrees (e.g.
for mapping). AbstractOccupancyOcTree serves as a common base interface for all these classes. Each class used as NODE type needs to be derived from OccupancyOcTreeNode.
This tree implementation has a maximum depth of 16. At a resolution of 1 cm, values have to be < +/- 327.68 meters (2^15)
This limitation enables the use of an efficient key generation method which uses the binary representation of the data.
| NODE | Node class to be used in tree (usually derived from OcTreeDataNode) |
|
inherited |
|
inherited |
Make the templated NODE type available from the outside.
| octomap::OccupancyOcTreeBase< NODE >::OccupancyOcTreeBase | ( | double | resolution | ) |
Default constructor, sets resolution of leafs.
References octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::OcTreeBaseImpl(), use_bbx_limit, and use_change_detection.
Referenced by OccupancyOcTreeBase().
|
virtual |
| octomap::OccupancyOcTreeBase< NODE >::OccupancyOcTreeBase | ( | const OccupancyOcTreeBase< NODE > & | rhs | ) |
Copy constructor.
References bbx_max, bbx_max_key, bbx_min, bbx_min_key, changed_keys, octomap::AbstractOccupancyOcTree::clamping_thres_max, octomap::AbstractOccupancyOcTree::clamping_thres_min, octomap::AbstractOccupancyOcTree::occ_prob_thres_log, OccupancyOcTreeBase(), octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::OcTreeBaseImpl(), octomap::AbstractOccupancyOcTree::prob_hit_log, octomap::AbstractOccupancyOcTree::prob_miss_log, use_bbx_limit, and use_change_detection.
|
protected |
Constructor to enable derived classes to change tree constants. This usually requires a re-implementation of some core tree-traversal functions as well!
References octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::OcTreeBaseImpl(), use_bbx_limit, and use_change_detection.
|
inlineinherited |
Adjusts a 3D key from the lowest level to correspond to a higher depth (by shifting the key values)
| key | Input key, at the lowest tree level |
| depth | Target depth level for the new key |
|
protectedinherited |
|
inline |
References use_bbx_limit.
|
inlineinherited |
Referenced by boundingBoxTest(), octomap::OccupancyOcTreeBase< NODE >::integrateMissOnRay(), and main().
|
inlineinherited |
Referenced by boundingBoxTest(), and main().
|
inlineinherited |
Referenced by boundingBoxTest(), and main().
|
inlineinherited |
Referenced by calcThresholdedNodes(), main(), and printChanges().
|
protectedinherited |
recalculates min and max in x, y, z. Does nothing when tree size didn't change.
|
inherited |
|
protectedinherited |
|
virtual |
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.
| [in] | origin | starting coordinate of ray |
| [in] | direction | A vector pointing in the direction of the raycast (NOT a point in space). Does not need to be normalized. |
| [out] | end | returns the center of the last cell on the ray. If the function returns true, it is occupied. |
| [in] | ignoreUnknownCells | whether unknown cells are ignored (= treated as free). If false (default), the raycast aborts when an unknown cell is hit and returns false. |
| [in] | maxRange | Maximum range after which the raycast is aborted (<= 0: no limit, default) |
-------— see OcTreeBase::computeRayKeys --------—
References octomap::OcTreeBaseImpl< NODE, INTERFACE >::coordToKeyChecked(), octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::end(), octomap::AbstractOccupancyOcTree::isNodeOccupied(), octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::keyToCoord(), octomath::Vector3::normalized(), OCTOMAP_ERROR, OCTOMAP_WARNING, OCTOMAP_WARNING_STR, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::resolution, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::search(), and octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::tree_max_val.
Referenced by main().
|
inline |
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 changed_keys.
Referenced by printChanges().
|
inline |
Iterator to traverse all keys of changed nodes.
References changed_keys.
Referenced by printChanges().
|
virtualinherited |
|
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.
Referenced by octomap::OcTree::StaticMemberInitializer::StaticMemberInitializer(), and octomap::OcTreeStamped::StaticMemberInitializer::StaticMemberInitializer().
| void octomap::OccupancyOcTreeBase< NODE >::computeDiscreteUpdate | ( | const Pointcloud & | scan, |
| const octomap::point3d & | origin, | ||
| KeySet & | free_cells, | ||
| KeySet & | occupied_cells, | ||
| double | maxrange ) |
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().
| scan | point cloud measurement to be integrated |
| origin | origin of the sensor for ray casting |
| free_cells | keys of nodes to be cleared |
| occupied_cells | keys of nodes to be marked occupied |
| maxrange | maximum range for raycasting (-1: unlimited) |
References octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::coordToKey(), octomap::Pointcloud::reserve(), and octomap::Pointcloud::size().
Referenced by insertPointCloud().
|
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()).
| origin | start coordinate of ray |
| end | end coordinate of ray |
| ray | KeyRay structure that holds the keys of all nodes traversed by the ray, excluding "end" |
|
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()).
| origin | start coordinate of ray |
| end | end coordinate of ray |
| ray | KeyRay structure that holds the keys of all nodes traversed by the ray, excluding "end" |
Referenced by octomap::OccupancyOcTreeBase< NODE >::computeUpdate(), octomap::OccupancyOcTreeBase< NODE >::insertPointCloudRays(), and octomap::OccupancyOcTreeBase< NODE >::integrateMissOnRay().
| void octomap::OccupancyOcTreeBase< NODE >::computeUpdate | ( | const Pointcloud & | scan, |
| const octomap::point3d & | origin, | ||
| KeySet & | free_cells, | ||
| KeySet & | occupied_cells, | ||
| double | maxrange ) |
Helper for insertPointCloud().
Computes all octree nodes affected by the point cloud integration at once. Here, occupied nodes have a preference over free ones.
| scan | point cloud measurement to be integrated |
| origin | origin of the sensor for ray casting |
| free_cells | keys of nodes to be cleared |
| occupied_cells | keys of nodes to be marked occupied |
| maxrange | maximum range for raycasting (-1: unlimited) |
References octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::computeRayKeys(), octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::keyrays, octomap::Pointcloud::size(), and use_bbx_limit.
Referenced by insertPointCloud(), and main().
|
inlineinherited |
Converts from a single coordinate into a discrete key.
Referenced by octomap::OccupancyOcTreeBase< NODE >::computeDiscreteUpdate().
|
inherited |
Converts a 3D coordinate into a 3D OcTreeKey, with boundary checking.
| coord | 3d coordinate of a point |
| key | values that will be computed, an array of fixed size 3. |
Referenced by boundingBoxTest(), main(), main(), octomap::OccupancyOcTreeBase< NODE >::setBBXMax(), octomap::OccupancyOcTreeBase< NODE >::setBBXMin(), octomap::OccupancyOcTreeBase< NODE >::setNodeValue(), octomap::OccupancyOcTreeBase< NODE >::setNodeValue(), octomap::OccupancyOcTreeBase< NODE >::updateNode(), octomap::OccupancyOcTreeBase< NODE >::updateNode(), and octomap::OccupancyOcTreeBase< NODE >::updateNode().
|
pure virtualinherited |
virtual constructor: creates a new object of same type
Implemented in octomap::ColorOcTree, octomap::OcTree, octomap::OcTreeBase< NODE >, octomap::OcTreeBase< CountingOcTreeNode >, and octomap::OcTreeStamped.
References AbstractOcTree().
|
inherited |
Creates (allocates) the i-th child of the node.
Referenced by main(), and octomap::OccupancyOcTreeBase< NODE >::readBinaryNode().
|
staticinherited |
Creates a certain OcTree (factory pattern)
References AbstractOcTree(), OCTOMAP_ERROR, and setResolution().
|
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.
|
inherited |
Deletes the i-th child of the node.
Referenced by main().
|
protectedinherited |
Recursively delete a node and all children. Deallocates memory but does NOT set the node ptr to NULL nor updates tree size.
|
inline |
track or ignore changes while inserting scans (default: ignore)
References use_change_detection.
Referenced by main().
|
inlineinherited |
Referenced by boundingBoxTest(), octomap::OccupancyOcTreeBase< NODE >::castRay(), octomap::OccupancyOcTreeBase< NODE >::insertRay(), octomap::OccupancyOcTreeBase< NODE >::integrateMissOnRay(), and main().
|
inlineinherited |
Referenced by boundingBoxTest(), and main().
|
inlineinherited |
Referenced by boundingBoxTest(), and main().
|
inlineinherited |
Referenced by calcThresholdedNodes(), main(), and printChanges().
|
virtualinherited |
Expands all pruned nodes (reverse of prune())
Implements octomap::AbstractOcTree.
Referenced by boundingBoxTest(), main(), main(), and printChanges().
|
virtualinherited |
|
protectedinherited |
recursive call of expand()
| point3d octomap::OccupancyOcTreeBase< NODE >::getBBXBounds | ( | ) | const |
| point3d octomap::OccupancyOcTreeBase< NODE >::getBBXCenter | ( | ) | const |
|
inline |
References bbx_max.
|
inline |
References bbx_min.
|
inlineinherited |
References clamping_thres_max, and octomap::probability().
Referenced by main().
|
inlineinherited |
References clamping_thres_max.
|
inlineinherited |
References clamping_thres_min, and octomap::probability().
Referenced by main().
|
inlineinherited |
References clamping_thres_min.
|
pure virtualinherited |
|
virtualinherited |
maximum value of the bounding box of all known space in x, y, z
Implements octomap::AbstractOcTree.
Referenced by boundingBoxTest().
|
pure virtualinherited |
|
virtualinherited |
minimum value of the bounding box of all known space in x, y, z
Implements octomap::AbstractOcTree.
Referenced by boundingBoxTest().
|
virtualinherited |
Size of OcTree (all known space) in meters for x, y and z dimension.
Implements octomap::AbstractOcTree.
Referenced by main(), and outputStatistics().
|
inherited |
Referenced by getLeafNodesRecurs(), getVoxelsRecurs(), octomap::OccupancyOcTreeBase< NODE >::readBinaryNode(), octomap::OccupancyOcTreeBase< NODE >::toMaxLikelihoodRecurs(), octomap::OccupancyOcTreeBase< NODE >::updateInnerOccupancyRecurs(), and octomap::OccupancyOcTreeBase< NODE >::writeBinaryNode().
|
inlineinherited |
| bool octomap::OccupancyOcTreeBase< NODE >::getNormals | ( | const point3d & | point, |
| std::vector< point3d > & | normals, | ||
| bool | unknownStatus = true ) const |
Performs a step of the marching cubes surface reconstruction algorithm to retrieve the normal of the triangles that fall in the cube formed by the voxels located at the vertex of a given voxel.
| [in] | point | voxel for which retrieve the normals |
| [out] | normals | normals of the triangles |
| [in] | unknownStatus | consider unknown cells as free (false) or occupied (default, true). |
References octomap::OcTreeBaseImpl< NODE, INTERFACE >::coordToKeyChecked(), octomath::Vector3::cross(), octomap::edgeTable, octomap::AbstractOccupancyOcTree::isNodeOccupied(), octomath::Vector3::normalize(), OCTOMAP_WARNING_STR, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::search(), octomap::triTable, and octomap::vertexList.
Referenced by main().
|
inherited |
Traverses the tree to calculate the total number of leaf nodes.
Referenced by main(), and outputStatistics().
|
protectedinherited |
|
inlineinherited |
References occ_prob_thres_log, and octomap::probability().
|
inlineinherited |
References occ_prob_thres_log.
|
inlineinherited |
References prob_hit_log, and octomap::probability().
Referenced by main().
|
inlineinherited |
References prob_hit_log.
|
inlineinherited |
References prob_miss_log, and octomap::probability().
Referenced by main().
|
inlineinherited |
References prob_miss_log.
|
virtual |
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.
| [in] | origin | Starting point of ray |
| [in] | direction | A vector pointing in the direction of the raycast. Does not need to be normalized. |
| [in] | center | The center of the voxel where the ray terminated. This is the output of castRay. |
| [out] | intersection | The entry point of the ray into the voxel, on the voxel surface. |
| [in] | delta | A 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. |
References octomath::Vector3::dot(), and octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::resolution.
Referenced by main().
|
inlinevirtualinherited |
Implements octomap::AbstractOcTree.
Referenced by getLeafNodesRecurs(), getVoxelsRecurs(), and main().
|
inlineinherited |
|
inlineinherited |
|
inlinevirtualinherited |
Implements octomap::AbstractOcTree.
|
inherited |
return centers of leafs that do NOT exist (but could) in a given bounding box
| bool octomap::OccupancyOcTreeBase< NODE >::inBBX | ( | const OcTreeKey & | key | ) | const |
References bbx_max_key, and bbx_min_key.
| bool octomap::OccupancyOcTreeBase< NODE >::inBBX | ( | const point3d & | p | ) | const |
References bbx_max, bbx_min, octomath::Vector3::x(), octomath::Vector3::y(), and octomath::Vector3::z().
|
protectedinherited |
initialize non-trivial members, helper for constructors
|
virtual |
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().
| scan | Pointcloud (measurement endpoints), in global reference frame |
| sensor_origin | measurement origin in global reference frame |
| maxrange | maximum range for how long individual beams are inserted (default -1: complete beam) |
| lazy_eval | whether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done. |
| discretize | whether the scan is discretized first into octree key cells (default: false). This reduces the number of raycasts using computeDiscreteUpdate(), resulting in a potential speedup.* |
References computeDiscreteUpdate(), and computeUpdate().
Referenced by insertPointCloud(), insertPointCloud(), main(), and main().
|
virtual |
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().
| scan | Pointcloud (measurement endpoints) relative to frame origin |
| sensor_origin | origin of sensor relative to frame origin |
| frame_origin | origin of reference frame, determines transform to be applied to cloud and sensor origin |
| maxrange | maximum range for how long individual beams are inserted (default -1: complete beam) |
| lazy_eval | whether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done. |
| discretize | whether the scan is discretized first into octree key cells (default: false). This reduces the number of raycasts using computeDiscreteUpdate(), resulting in a potential speedup.* |
References insertPointCloud(), octomap::Pointcloud::transform(), and octomath::Pose6D::transform().
|
virtual |
Insert a 3d scan (given as a ScanNode) into the tree, parallelized with OpenMP.
| scan | ScanNode contains Pointcloud data and frame/sensor origin |
| maxrange | maximum range for how long individual beams are inserted (default -1: complete beam) |
| lazy_eval | whether 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. |
| discretize | whether the scan is discretized first into octree key cells (default: false). This reduces the number of raycasts using computeDiscreteUpdate(), resulting in a potential speedup. |
References insertPointCloud(), octomath::Pose6D::inv(), octomap::ScanNode::pose, octomap::ScanNode::scan, octomath::Pose6D::trans(), and octomath::Pose6D::transform().
|
virtual |
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.
| scan | Pointcloud (measurement endpoints), in global reference frame |
| sensor_origin | measurement origin in global reference frame |
| maxrange | maximum range for how long individual beams are inserted (default -1: complete beam) |
| lazy_eval | whether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done. |
References octomap::KeyRay::begin(), octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::computeRayKeys(), octomap::KeyRay::end(), octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::keyrays, octomap::Pointcloud::size(), and updateNode().
Referenced by main().
|
virtual |
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().
| origin | origin of sensor in global coordinates |
| end | endpoint of measurement in global coordinates |
| maxrange | maximum range after which the raycast should be aborted |
| lazy_eval | whether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done. |
References octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::end(), integrateMissOnRay(), and updateNode().
Referenced by generateSphereTree(), main(), and main().
|
virtual |
integrate a "hit" measurement according to the tree's sensor model
References octomap::AbstractOccupancyOcTree::prob_hit_log, and updateNodeLogOdds().
|
virtual |
integrate a "miss" measurement according to the tree's sensor model
References octomap::AbstractOccupancyOcTree::prob_miss_log, and updateNodeLogOdds().
|
inlineprotected |
Traces a ray from origin to end and updates all voxels on the way as free.
The volume containing "end" is not updated.
References octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::begin(), octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::computeRayKeys(), octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::end(), octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::keyrays, and updateNode().
Referenced by insertRay().
|
inline |
References use_change_detection.
|
inlineinherited |
queries whether a node is at the clamping threshold according to the tree's parameter
References octomap::OcTreeNode::getLogOdds().
|
inlineinherited |
queries whether a node is at the clamping threshold according to the tree's parameter
References octomap::OcTreeNode::getLogOdds().
Referenced by calcThresholdedNodes().
|
virtualinherited |
A node is collapsible if all children exist, don't have children of their own and have the same occupancy value.
|
inlineinherited |
queries whether a node is occupied according to the tree's parameter for "occupancy"
References octomap::OcTreeNode::getLogOdds().
|
inlineinherited |
queries whether a node is occupied according to the tree's parameter for "occupancy"
References octomap::OcTreeNode::getLogOdds().
Referenced by octomap::OccupancyOcTreeBase< NODE >::castRay(), getLeafNodesRecurs(), octomap::OccupancyOcTreeBase< NODE >::getNormals(), main(), main(), octomap::OccupancyOcTreeBase< NODE >::nodeToMaxLikelihood(), octomap::OccupancyOcTreeBase< NODE >::nodeToMaxLikelihood(), printChanges(), and octomap::OccupancyOcTreeBase< NODE >::writeBinaryNode().
|
inherited |
converts from a discrete key at a given depth into a coordinate corresponding to the key's center
Referenced by octomap::OccupancyOcTreeBase< NODE >::castRay(), and main().
|
inherited |
Referenced by main(), and outputStatistics().
|
virtualinherited |
Implements octomap::AbstractOcTree.
Referenced by main(), and outputStatistics().
|
inlinevirtualinherited |
Implements octomap::AbstractOcTree.
|
inherited |
Safe test if node has a child at index childIdx.
First tests if there are any children. Replaces node->childExists(...)
Referenced by getLeafNodesRecurs(), getVoxelsRecurs(), main(), octomap::OccupancyOcTreeBase< NODE >::readBinaryNode(), octomap::OccupancyOcTreeBase< NODE >::toMaxLikelihoodRecurs(), octomap::OccupancyOcTreeBase< NODE >::updateInnerOccupancyRecurs(), octomap::OccupancyOcTreeBase< NODE >::updateNodeRecurs(), and octomap::OccupancyOcTreeBase< NODE >::writeBinaryNode().
|
inherited |
Safe test if node has any children.
Replaces node->hasChildren(...)
Referenced by boundingBoxTest(), getLeafNodesRecurs(), getVoxelsRecurs(), main(), octomap::OccupancyOcTreeBase< NODE >::updateInnerOccupancyRecurs(), and octomap::OccupancyOcTreeBase< NODE >::writeBinaryNode().
|
virtual |
converts the node to the maximum likelihood value according to the tree's parameter for "occupancy"
References octomap::AbstractOccupancyOcTree::clamping_thres_max, octomap::AbstractOccupancyOcTree::clamping_thres_min, and octomap::AbstractOccupancyOcTree::isNodeOccupied().
|
virtual |
converts the node to the maximum likelihood value according to the tree's parameter for "occupancy"
References octomap::AbstractOccupancyOcTree::clamping_thres_max, octomap::AbstractOccupancyOcTree::clamping_thres_min, and octomap::AbstractOccupancyOcTree::isNodeOccupied().
Referenced by toMaxLikelihood(), and toMaxLikelihoodRecurs().
|
inline |
Number of changes since last reset.
References changed_keys.
|
inherited |
Comparison between two octrees, all meta data, all nodes, and the structure must be identical.
|
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.
Referenced by main(), main(), and printChanges().
|
virtualinherited |
|
protectedinherited |
recursive call of prune()
|
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:
References AbstractOcTree(), OCTOMAP_ERROR_STR, and read().
|
staticinherited |
Read the file header, create the appropriate class and deserialize. This creates a new octree which you need to delete yourself.
References AbstractOcTree(), fileHeader, OCTOMAP_DEBUG_STR, OCTOMAP_ERROR_STR, readHeader(), and size().
|
inherited |
Reads OcTree from a binary file.
Existing nodes of the tree are deleted before the tree is read.
References OCTOMAP_ERROR_STR, and readBinary().
|
inherited |
Reads an OcTree from an input stream.
Existing nodes of the tree are deleted before the tree is read.
References binaryFileHeader, octomap::AbstractOcTree::clear(), OCTOMAP_DEBUG_STR, OCTOMAP_ERROR, OCTOMAP_ERROR_STR, OCTOMAP_WARNING_STR, readBinaryData(), readBinaryLegacyHeader(), octomap::AbstractOcTree::readHeader(), octomap::AbstractOcTree::setResolution(), and octomap::AbstractOcTree::size().
Referenced by main(), and readBinary().
|
virtual |
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.
References octomap::OcTreeBaseImpl< NODE, INTERFACE >::calcNumNodes(), OCTOMAP_ERROR_STR, readBinaryNode(), octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::root, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::size_changed, and octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::tree_size.
|
protectedinherited |
Try to read the old binary format for conversion, will be removed in the future.
References octomap::AbstractOcTree::size().
Referenced by readBinary().
| std::istream & octomap::OccupancyOcTreeBase< NODE >::readBinaryNode | ( | std::istream & | s, |
| NODE * | node ) |
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.
References octomap::AbstractOccupancyOcTree::clamping_thres_max, octomap::AbstractOccupancyOcTree::clamping_thres_min, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::createNodeChild(), octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::getNodeChild(), octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::nodeChildExists(), and readBinaryNode().
Referenced by readBinaryData(), and readBinaryNode().
|
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.
|
staticprotectedinherited |
References size().
Referenced by read(), and octomap::AbstractOccupancyOcTree::readBinary().
|
protectedinherited |
recursive call of readData()
|
staticprotectedinherited |
References AbstractOcTree(), and getTreeType().
Referenced by octomap::ColorOcTree::StaticMemberInitializer::StaticMemberInitializer(), octomap::CountingOcTree::StaticMemberInitializer::StaticMemberInitializer(), octomap::OcTree::StaticMemberInitializer::StaticMemberInitializer(), and octomap::OcTreeStamped::StaticMemberInitializer::StaticMemberInitializer().
|
inline |
Reset the set of changed keys. Call this after you obtained all changed nodes.
References changed_keys.
|
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.
Referenced by boundingBoxTest(), octomap::OccupancyOcTreeBase< NODE >::castRay(), octomap::OccupancyOcTreeBase< NODE >::getNormals(), main(), main(), printChanges(), and octomap::OccupancyOcTreeBase< NODE >::updateNode().
| void octomap::OccupancyOcTreeBase< NODE >::setBBXMax | ( | const point3d & | max | ) |
sets the maximum for a query bounding box to use
References bbx_max, bbx_max_key, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::coordToKeyChecked(), and OCTOMAP_ERROR.
Referenced by main().
| void octomap::OccupancyOcTreeBase< NODE >::setBBXMin | ( | const point3d & | min | ) |
sets the minimum for a query bounding box to use
References bbx_min, bbx_min_key, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::coordToKeyChecked(), and OCTOMAP_ERROR.
Referenced by main().
|
inlineinherited |
sets the maximum threshold for occupancy clamping (sensor model)
References clamping_thres_max, and octomap::logodds().
Referenced by AbstractOccupancyOcTree(), and main().
|
inlineinherited |
sets the minimum threshold for occupancy clamping (sensor model)
References clamping_thres_min, and octomap::logodds().
Referenced by AbstractOccupancyOcTree(), and main().
|
virtual |
Set log_odds value of voxel to log_odds_value.
This only works if key is at the lowest octree level
| key | OcTreeKey of the NODE that is to be updated |
| log_odds_value | value to be set as the log_odds value of the node |
| lazy_eval | whether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done. |
References octomap::AbstractOccupancyOcTree::clamping_thres_max, octomap::AbstractOccupancyOcTree::clamping_thres_min, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::root, and octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::tree_size.
Referenced by setNodeValue().
|
virtual |
Set log_odds value of voxel to log_odds_value.
Looks up the OcTreeKey corresponding to the coordinate and then calls setNodeValue() with it.
| value | 3d coordinate of the NODE that is to be updated |
| log_odds_value | value to be set as the log_odds value of the node |
| lazy_eval | whether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done. |
References octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::coordToKeyChecked(), and setNodeValue().
|
virtual |
Set log_odds value of voxel to log_odds_value.
Looks up the OcTreeKey corresponding to the coordinate and then calls setNodeValue() with it.
| x | |
| y | |
| z | |
| log_odds_value | value to be set as the log_odds value of the node |
| lazy_eval | whether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done. |
References octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::coordToKeyChecked().
|
protected |
|
inlineinherited |
sets the threshold for occupancy (sensor model)
References octomap::logodds(), and occ_prob_thres_log.
Referenced by AbstractOccupancyOcTree(), and main().
|
inlineinherited |
sets the probability for a "hit" (will be converted to logodds) - sensor model
References octomap::logodds(), and prob_hit_log.
Referenced by AbstractOccupancyOcTree(), and main().
|
inlineinherited |
sets the probability for a "miss" (will be converted to logodds) - sensor model
References octomap::logodds(), and prob_miss_log.
Referenced by AbstractOccupancyOcTree(), and main().
|
virtualinherited |
Change the resolution of the octree, scaling all voxels. This will not preserve the (metric) scale!
Implements octomap::AbstractOcTree.
Referenced by main().
|
inlinevirtualinherited |
Implements octomap::AbstractOcTree.
Referenced by main(), main(), outputStatistics(), and octomap::OccupancyOcTreeBase< NODE >::writeBinaryData().
|
inherited |
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
Referenced by main().
|
virtual |
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.
References nodeToMaxLikelihood(), octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::root, and toMaxLikelihoodRecurs().
Referenced by main().
|
protected |
| void octomap::OccupancyOcTreeBase< NODE >::updateInnerOccupancy | ( | ) |
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.
References octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::root, and updateInnerOccupancyRecurs().
Referenced by main().
|
protected |
References octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::getNodeChild(), octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::nodeChildExists(), octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::nodeHasChildren(), octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::tree_depth, and updateInnerOccupancyRecurs().
Referenced by updateInnerOccupancy(), and updateInnerOccupancyRecurs().
|
virtual |
Integrate occupancy measurement.
| key | OcTreeKey of the NODE that is to be updated |
| occupied | true if the node was measured occupied, else false |
| lazy_eval | whether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done. |
Implements octomap::AbstractOccupancyOcTree.
References octomap::AbstractOccupancyOcTree::prob_hit_log, octomap::AbstractOccupancyOcTree::prob_miss_log, and updateNode().
|
virtual |
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
| key | OcTreeKey of the NODE that is to be updated |
| log_odds_update | value to be added (+) to log_odds value of node |
| lazy_eval | whether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done. |
Implements octomap::AbstractOccupancyOcTree.
References octomap::AbstractOccupancyOcTree::clamping_thres_min, and octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::search().
Referenced by insertPointCloudRays(), insertRay(), integrateMissOnRay(), main(), main(), updateNode(), updateNode(), updateNode(), and updateNode().
|
virtual |
Integrate occupancy measurement.
Looks up the OcTreeKey corresponding to the coordinate and then calls udpateNode() with it.
| value | 3d coordinate of the NODE that is to be updated |
| occupied | true if the node was measured occupied, else false |
| lazy_eval | whether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done. |
Implements octomap::AbstractOccupancyOcTree.
References octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::coordToKeyChecked(), and updateNode().
|
virtual |
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.
| value | 3d coordinate of the NODE that is to be updated |
| log_odds_update | value to be added (+) to log_odds value of node |
| lazy_eval | whether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done. |
Implements octomap::AbstractOccupancyOcTree.
References octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::coordToKeyChecked(), and updateNode().
|
virtual |
Integrate occupancy measurement.
Looks up the OcTreeKey corresponding to the coordinate and then calls udpateNode() with it.
| x | |
| y | |
| z | |
| occupied | true if the node was measured occupied, else false |
| lazy_eval | whether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done. |
References octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::coordToKeyChecked(), and updateNode().
|
virtual |
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.
| x | |
| y | |
| z | |
| log_odds_update | value to be added (+) to log_odds value of node |
| lazy_eval | whether 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 |
update logodds value of node by adding to the current value.
References octomap::AbstractOccupancyOcTree::clamping_thres_max, and octomap::AbstractOccupancyOcTree::clamping_thres_min.
Referenced by integrateHit(), integrateMiss(), octomap::OcTreeStamped::integrateMissNoTime(), and octomap::OcTreeStamped::updateNodeLogOdds().
|
protected |
|
inline |
|
inherited |
|
inherited |
Write file header and complete tree to file (serialization)
References OCTOMAP_ERROR_STR, and write().
|
inherited |
Write file header and complete tree to stream (serialization)
References fileHeader, getResolution(), getTreeType(), size(), and writeData().
|
inherited |
Writes OcTree to a binary file using writeBinary().
The OcTree is first converted to the maximum likelihood estimate and pruned.
References OCTOMAP_ERROR_STR, and writeBinary().
Referenced by main(), main(), and writeBinary().
|
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.
References octomap::AbstractOcTree::prune(), toMaxLikelihood(), and writeBinaryConst().
|
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.
Referenced by writeBinary().
|
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.
|
virtual |
Writes the data of the tree (without header) to the stream, recursively calling writeBinaryNode (starting with root)
Implements octomap::AbstractOccupancyOcTree.
References OCTOMAP_DEBUG, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::root, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::size(), and writeBinaryNode().
| std::ostream & octomap::OccupancyOcTreeBase< NODE >::writeBinaryNode | ( | std::ostream & | s, |
| const NODE * | node ) const |
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.
| s | |
| node | OcTreeNode to write out, will recurse to all children |
References octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::getNodeChild(), octomap::AbstractOccupancyOcTree::isNodeOccupied(), octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::nodeChildExists(), octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >::nodeHasChildren(), and writeBinaryNode().
Referenced by writeBinaryData(), and writeBinaryNode().
|
virtualinherited |
Write complete state of tree to stream (without file header) unmodified. Pruning the tree first produces smaller files (lossless compression)
Implements octomap::AbstractOcTree.
|
protectedinherited |
recursive call of writeData()
|
protected |
Referenced by getBBXBounds(), getBBXCenter(), getBBXMax(), inBBX(), OccupancyOcTreeBase(), and setBBXMax().
|
protected |
Referenced by inBBX(), OccupancyOcTreeBase(), and setBBXMax().
|
protected |
Referenced by getBBXBounds(), getBBXCenter(), getBBXMin(), inBBX(), OccupancyOcTreeBase(), and setBBXMin().
|
protected |
Referenced by inBBX(), OccupancyOcTreeBase(), and setBBXMin().
|
staticprotectedinherited |
Referenced by readBinary().
|
protected |
Set of leaf keys (lowest level) which changed since last resetChangeDetection.
Referenced by changedKeysBegin(), changedKeysEnd(), numChangesDetected(), OccupancyOcTreeBase(), and resetChangeDetection().
|
protectedinherited |
Referenced by getClampingThresMax(), getClampingThresMaxLog(), octomap::OccupancyOcTreeBase< NODE >::nodeToMaxLikelihood(), octomap::OccupancyOcTreeBase< NODE >::nodeToMaxLikelihood(), octomap::OccupancyOcTreeBase< NODE >::OccupancyOcTreeBase(), octomap::OccupancyOcTreeBase< NODE >::readBinaryNode(), setClampingThresMax(), octomap::OccupancyOcTreeBase< NODE >::setNodeValue(), and octomap::OccupancyOcTreeBase< NODE >::updateNodeLogOdds().
|
protectedinherited |
Referenced by getClampingThresMin(), getClampingThresMinLog(), octomap::OccupancyOcTreeBase< NODE >::nodeToMaxLikelihood(), octomap::OccupancyOcTreeBase< NODE >::nodeToMaxLikelihood(), octomap::OccupancyOcTreeBase< NODE >::OccupancyOcTreeBase(), octomap::OccupancyOcTreeBase< NODE >::readBinaryNode(), setClampingThresMin(), octomap::OccupancyOcTreeBase< NODE >::setNodeValue(), octomap::OccupancyOcTreeBase< NODE >::updateNode(), and octomap::OccupancyOcTreeBase< NODE >::updateNodeLogOdds().
|
staticprotectedinherited |
|
protectedinherited |
data structure for ray casting, array for multithreading
Referenced by octomap::OccupancyOcTreeBase< NODE >::computeUpdate(), octomap::OccupancyOcTreeBase< NODE >::insertPointCloudRays(), and octomap::OccupancyOcTreeBase< NODE >::integrateMissOnRay().
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
max in x, y, z
|
protectedinherited |
min in x, y, z contains the size of a voxel at level i (0: root node). tree_depth+1 levels (incl. 0)
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
in meters
Referenced by octomap::OccupancyOcTreeBase< NODE >::castRay(), and octomap::OccupancyOcTreeBase< NODE >::getRayIntersection().
|
protectedinherited |
= 1. / resolution
|
protectedinherited |
Pointer to the root NODE, NULL for empty tree.
Referenced by octomap::OccupancyOcTreeBase< NODE >::readBinaryData(), octomap::OccupancyOcTreeBase< NODE >::setNodeValue(), octomap::OccupancyOcTreeBase< NODE >::toMaxLikelihood(), octomap::OccupancyOcTreeBase< NODE >::updateInnerOccupancy(), and octomap::OccupancyOcTreeBase< NODE >::writeBinaryData().
|
protectedinherited |
Referenced by octomap::OccupancyOcTreeBase< NODE >::readBinaryData().
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Maximum tree depth is fixed to 16 currently.
Referenced by octomap::OccupancyOcTreeBase< NODE >::updateInnerOccupancyRecurs(), and octomap::OccupancyOcTreeBase< NODE >::updateNodeRecurs().
|
protectedinherited |
|
protectedinherited |
Referenced by octomap::OccupancyOcTreeBase< NODE >::castRay().
|
protectedinherited |
number of nodes in tree flag to denote whether the octree extent changed (for lazy min/max eval)
Referenced by octomap::OccupancyOcTreeBase< NODE >::readBinaryData(), and octomap::OccupancyOcTreeBase< NODE >::setNodeValue().
|
protected |
use bounding box for queries (needs to be set)?
Referenced by bbxSet(), computeUpdate(), OccupancyOcTreeBase(), OccupancyOcTreeBase(), OccupancyOcTreeBase(), and useBBXLimit().
|
protected |