Public Types | Public Member Functions | Private Attributes | List of all members
collision_detection::OccMapTree Class Reference

#include <occupancy_map.h>

Inheritance diagram for collision_detection::OccMapTree:
Inheritance graph
[legend]

Public Types

using ReadLock = boost::shared_lock< boost::shared_mutex >
 
using WriteLock = boost::unique_lock< boost::shared_mutex >
 
- Public Types inherited from OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >
typedef leaf_iterator iterator
 
typedef OcTreeNode NodeType
 

Public Member Functions

void lockRead ()
 lock the underlying octree. it will not be read or written by the monitor until unlockTree() is called More...
 
void lockWrite ()
 lock the underlying octree. it will not be read or written by the monitor until unlockTree() is called More...
 
 OccMapTree (const std::string &filename)
 
 OccMapTree (double resolution)
 
ReadLock reading ()
 
void setUpdateCallback (const boost::function< void()> &update_callback)
 Set the callback to trigger when updates are received. More...
 
void triggerUpdateCallback ()
 
void unlockRead ()
 unlock the underlying octree. More...
 
void unlockWrite ()
 unlock the underlying octree. More...
 
WriteLock writing ()
 
- Public Member Functions inherited from octomap::OcTree
OcTreecreate () const
 
std::string getTreeType () const
 
 OcTree (double resolution)
 
 OcTree (std::string _filename)
 
virtual ~OcTree ()
 
- Public Member Functions inherited from OccupancyOcTreeBase< OcTreeNode >
bool bbxSet () const
 
virtual bool castRay (const point3d &origin, const point3d &direction, point3d &end, bool ignoreUnknownCells=false, double maxRange=-1.0) const
 
KeyBoolMap::const_iterator changedKeysBegin () const
 
KeyBoolMap::const_iterator changedKeysEnd () const
 
void computeDiscreteUpdate (const Pointcloud &scan, const octomap::point3d &origin, KeySet &free_cells, KeySet &occupied_cells, double maxrange)
 
void computeUpdate (const Pointcloud &scan, const octomap::point3d &origin, KeySet &free_cells, KeySet &occupied_cells, double maxrange)
 
void enableChangeDetection (bool enable)
 
point3d getBBXBounds () const
 
point3d getBBXCenter () const
 
point3d getBBXMax () const
 
point3d getBBXMin () const
 
bool getNormals (const point3d &point, std::vector< point3d > &normals, bool unknownStatus=true) const
 
virtual bool getRayIntersection (const point3d &origin, const point3d &direction, const point3d &center, point3d &intersection, double delta=0.0) const
 
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)
 
virtual void insertPointCloud (const Pointcloud &scan, const point3d &sensor_origin, const pose6d &frame_origin, double maxrange=-1., bool lazy_eval=false, bool discretize=false)
 
virtual void insertPointCloud (const ScanNode &scan, double maxrange=-1., bool lazy_eval=false, bool discretize=false)
 
virtual void insertPointCloudRays (const Pointcloud &scan, const point3d &sensor_origin, double maxrange=-1., bool lazy_eval=false)
 
virtual bool insertRay (const point3d &origin, const point3d &end, double maxrange=-1.0, bool lazy_eval=false)
 
virtual void integrateHit (OcTreeNode *occupancyNode) const
 
virtual void integrateMiss (OcTreeNode *occupancyNode) const
 
bool isChangeDetectionEnabled () const
 
virtual void nodeToMaxLikelihood (OcTreeNode &occupancyNode) const
 
virtual void nodeToMaxLikelihood (OcTreeNode *occupancyNode) const
 
size_t numChangesDetected () const
 
 OccupancyOcTreeBase (const OccupancyOcTreeBase< OcTreeNode > &rhs)
 
 OccupancyOcTreeBase (double resolution)
 
std::istream & readBinaryData (std::istream &s)
 
std::istream & readBinaryNode (std::istream &s, OcTreeNode *node)
 
void resetChangeDetection ()
 
void setBBXMax (const point3d &max)
 
void setBBXMin (const point3d &min)
 
virtual OcTreeNode * setNodeValue (const OcTreeKey &key, float log_odds_value, bool lazy_eval=false)
 
virtual OcTreeNode * setNodeValue (const point3d &value, float log_odds_value, bool lazy_eval=false)
 
virtual OcTreeNode * setNodeValue (double x, double y, double z, float log_odds_value, bool lazy_eval=false)
 
virtual void toMaxLikelihood ()
 
void updateInnerOccupancy ()
 
virtual OcTreeNode * updateNode (const OcTreeKey &key, bool occupied, bool lazy_eval=false)
 
virtual OcTreeNode * updateNode (const OcTreeKey &key, float log_odds_update, bool lazy_eval=false)
 
virtual OcTreeNode * updateNode (const point3d &value, bool occupied, bool lazy_eval=false)
 
virtual OcTreeNode * updateNode (const point3d &value, float log_odds_update, bool lazy_eval=false)
 
virtual OcTreeNode * updateNode (double x, double y, double z, bool occupied, bool lazy_eval=false)
 
virtual OcTreeNode * updateNode (double x, double y, double z, float log_odds_update, bool lazy_eval=false)
 
virtual void updateNodeLogOdds (OcTreeNode *occupancyNode, const float &update) const
 
void useBBXLimit (bool enable)
 
std::ostream & writeBinaryData (std::ostream &s) const
 
std::ostream & writeBinaryNode (std::ostream &s, const OcTreeNode *node) const
 
virtual ~OccupancyOcTreeBase ()
 
- Public Member Functions inherited from OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >
OcTreeKey adjustKeyAtDepth (const OcTreeKey &key, unsigned int depth) const
 
key_type adjustKeyAtDepth (key_type key, unsigned int depth) 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
 
void clear ()
 
void clearKeyRays ()
 
bool computeRay (const point3d &origin, const point3d &end, std::vector< point3d > &ray)
 
bool computeRayKeys (const point3d &origin, const point3d &end, KeyRay &ray) const
 
OcTreeKey coordToKey (const point3d &coord) const
 
OcTreeKey coordToKey (const point3d &coord, unsigned depth) const
 
key_type coordToKey (double coordinate) const
 
key_type coordToKey (double coordinate, unsigned depth) const
 
OcTreeKey coordToKey (double x, double y, double z) const
 
OcTreeKey coordToKey (double x, double y, double z, unsigned depth) const
 
bool coordToKeyChecked (const point3d &coord, OcTreeKey &key) const
 
bool coordToKeyChecked (const point3d &coord, unsigned depth, OcTreeKey &key) const
 
bool coordToKeyChecked (double coordinate, key_type &key) const
 
bool coordToKeyChecked (double coordinate, unsigned depth, key_type &key) const
 
bool coordToKeyChecked (double x, double y, double z, OcTreeKey &key) const
 
bool coordToKeyChecked (double x, double y, double z, unsigned depth, OcTreeKey &key) const
 
OcTreeNode * createNodeChild (OcTreeNode *node, unsigned int childIdx)
 
bool deleteNode (const OcTreeKey &key, unsigned int depth=0)
 
bool deleteNode (const point3d &value, unsigned int depth=0)
 
bool deleteNode (double x, double y, double z, unsigned int depth=0)
 
void deleteNodeChild (OcTreeNode *node, unsigned int childIdx)
 
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 ()
 
virtual void expandNode (OcTreeNode *node)
 
virtual void getMetricMax (double &x, double &y, double &z)
 
void getMetricMax (double &x, double &y, double &z) const
 
virtual void getMetricMin (double &x, double &y, double &z)
 
void getMetricMin (double &x, double &y, double &z) const
 
virtual void getMetricSize (double &x, double &y, double &z)
 
virtual void getMetricSize (double &x, double &y, double &z) const
 
const OcTreeNode * getNodeChild (const OcTreeNode *node, unsigned int childIdx) const
 
OcTreeNode * getNodeChild (OcTreeNode *node, unsigned int childIdx) const
 
double getNodeSize (unsigned depth) const
 
size_t getNumLeafNodes () const
 
double getResolution () const
 
OcTreeNode * 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
 
virtual bool isNodeCollapsible (const OcTreeNode *node) const
 
point3d keyToCoord (const OcTreeKey &key) const
 
point3d keyToCoord (const OcTreeKey &key, unsigned depth) const
 
double keyToCoord (key_type key) const
 
double keyToCoord (key_type key, unsigned depth) const
 
unsigned long long memoryFullGrid () const
 
virtual size_t memoryUsage () const
 
virtual size_t memoryUsageNode () const
 
bool nodeChildExists (const OcTreeNode *node, unsigned int childIdx) const
 
bool nodeHasChildren (const OcTreeNode *node) const
 
 OcTreeBaseImpl (const OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree > &rhs)
 
 OcTreeBaseImpl (double resolution)
 
bool operator== (const OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree > &rhs) const
 
virtual void prune ()
 
virtual bool pruneNode (OcTreeNode *node)
 
std::istream & readData (std::istream &s)
 
OcTreeNode * search (const OcTreeKey &key, unsigned int depth=0) const
 
OcTreeNode * search (const point3d &value, unsigned int depth=0) const
 
OcTreeNode * search (double x, double y, double z, unsigned int depth=0) const
 
void setResolution (double r)
 
virtual size_t size () const
 
void swapContent (OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree > &rhs)
 
double volume ()
 
std::ostream & writeData (std::ostream &s) const
 
virtual ~OcTreeBaseImpl ()
 
- Public Member Functions inherited from octomap::AbstractOccupancyOcTree
 AbstractOccupancyOcTree ()
 
double getClampingThresMax () const
 
float getClampingThresMaxLog () const
 
double getClampingThresMin () const
 
float getClampingThresMinLog () const
 
double getOccupancyThres () const
 
float getOccupancyThresLog () const
 
double getProbHit () const
 
float getProbHitLog () const
 
double getProbMiss () const
 
float getProbMissLog () const
 
bool isNodeAtThreshold (const OcTreeNode &occupancyNode) const
 
bool isNodeAtThreshold (const OcTreeNode *occupancyNode) const
 
bool isNodeOccupied (const OcTreeNode &occupancyNode) const
 
bool isNodeOccupied (const OcTreeNode *occupancyNode) const
 
bool readBinary (const std::string &filename)
 
bool readBinary (std::istream &s)
 
void setClampingThresMax (double thresProb)
 
void setClampingThresMin (double thresProb)
 
void setOccupancyThres (double prob)
 
void setProbHit (double prob)
 
void setProbMiss (double prob)
 
virtual OcTreeNodeupdateNode (const OcTreeKey &key, bool occupied, bool lazy_eval=false)=0
 
virtual OcTreeNodeupdateNode (const OcTreeKey &key, float log_odds_update, bool lazy_eval=false)=0
 
bool writeBinary (const std::string &filename)
 
bool writeBinary (std::ostream &s)
 
bool writeBinaryConst (const std::string &filename) const
 
bool writeBinaryConst (std::ostream &s) const
 
virtual ~AbstractOccupancyOcTree ()
 
- Public Member Functions inherited from octomap::AbstractOcTree
 AbstractOcTree ()
 
bool write (const std::string &filename) const
 
bool write (std::ostream &s) const
 
virtual ~AbstractOcTree ()
 

Private Attributes

boost::shared_mutex tree_mutex_
 
boost::function< void()> update_callback_
 

Additional Inherited Members

- Static Public Member Functions inherited from octomap::AbstractOcTree
static AbstractOcTreecreateTree (const std::string id, double res)
 
static AbstractOcTreeread (const std::string &filename)
 
static AbstractOcTreeread (std::istream &s)
 
- Protected Member Functions inherited from OccupancyOcTreeBase< OcTreeNode >
bool integrateMissOnRay (const point3d &origin, const point3d &end, bool lazy_eval=false)
 
 OccupancyOcTreeBase (double resolution, unsigned int tree_depth, unsigned int tree_max_val)
 
OcTreeNode * setNodeValueRecurs (OcTreeNode *node, bool node_just_created, const OcTreeKey &key, unsigned int depth, const float &log_odds_value, bool lazy_eval=false)
 
void toMaxLikelihoodRecurs (OcTreeNode *node, unsigned int depth, unsigned int max_depth)
 
void updateInnerOccupancyRecurs (OcTreeNode *node, unsigned int depth)
 
OcTreeNode * updateNodeRecurs (OcTreeNode *node, bool node_just_created, const OcTreeKey &key, unsigned int depth, const float &log_odds_update, bool lazy_eval=false)
 
- Protected Member Functions inherited from OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >
void allocNodeChildren (OcTreeNode *node)
 
void calcMinMax ()
 
void calcNumNodesRecurs (OcTreeNode *node, size_t &num_nodes) const
 
void deleteNodeRecurs (OcTreeNode *node)
 
bool deleteNodeRecurs (OcTreeNode *node, unsigned int depth, unsigned int max_depth, const OcTreeKey &key)
 
void expandRecurs (OcTreeNode *node, unsigned int depth, unsigned int max_depth)
 
size_t getNumLeafNodesRecurs (const OcTreeNode *parent) const
 
void init ()
 
 OcTreeBaseImpl (double resolution, unsigned int tree_depth, unsigned int tree_max_val)
 
void pruneRecurs (OcTreeNode *node, unsigned int depth, unsigned int max_depth, unsigned int &num_pruned)
 
std::istream & readNodesRecurs (OcTreeNode *, std::istream &s)
 
std::ostream & writeNodesRecurs (const OcTreeNode *, std::ostream &s) const
 
- Protected Member Functions inherited from octomap::AbstractOccupancyOcTree
bool readBinaryLegacyHeader (std::istream &s, unsigned int &size, double &res)
 
- Static Protected Member Functions inherited from octomap::AbstractOcTree
static bool readHeader (std::istream &s, std::string &id, unsigned &size, double &res)
 
static void registerTreeType (AbstractOcTree *tree)
 
- Protected Attributes inherited from OccupancyOcTreeBase< OcTreeNode >
point3d bbx_max
 
OcTreeKey bbx_max_key
 
point3d bbx_min
 
OcTreeKey bbx_min_key
 
KeyBoolMap changed_keys
 
bool use_bbx_limit
 
bool use_change_detection
 
- Protected Attributes inherited from OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >
std::vector< KeyRay > keyrays
 
const leaf_bbx_iterator leaf_iterator_bbx_end
 
const leaf_iterator leaf_iterator_end
 
double max_value [3]
 
double min_value [3]
 
double resolution
 
double resolution_factor
 
OcTreeNode * root
 
bool size_changed
 
std::vector< double > sizeLookupTable
 
point3d tree_center
 
const unsigned int tree_depth
 
const tree_iterator tree_iterator_end
 
const unsigned int tree_max_val
 
size_t tree_size
 
- Protected Attributes inherited from octomap::AbstractOccupancyOcTree
float clamping_thres_max
 
float clamping_thres_min
 
float occ_prob_thres_log
 
float prob_hit_log
 
float prob_miss_log
 
- Static Protected Attributes inherited from octomap::OcTree
static StaticMemberInitializer ocTreeMemberInit
 
- Static Protected Attributes inherited from octomap::AbstractOccupancyOcTree
static const std::string binaryFileHeader
 
- Static Protected Attributes inherited from octomap::AbstractOcTree
static const std::string fileHeader
 

Detailed Description

Definition at line 81 of file occupancy_map.h.

Member Typedef Documentation

◆ ReadLock

using collision_detection::OccMapTree::ReadLock = boost::shared_lock<boost::shared_mutex>

Definition at line 118 of file occupancy_map.h.

◆ WriteLock

using collision_detection::OccMapTree::WriteLock = boost::unique_lock<boost::shared_mutex>

Definition at line 119 of file occupancy_map.h.

Constructor & Destructor Documentation

◆ OccMapTree() [1/2]

collision_detection::OccMapTree::OccMapTree ( double  resolution)
inline

Definition at line 84 of file occupancy_map.h.

◆ OccMapTree() [2/2]

collision_detection::OccMapTree::OccMapTree ( const std::string &  filename)
inline

Definition at line 88 of file occupancy_map.h.

Member Function Documentation

◆ lockRead()

void collision_detection::OccMapTree::lockRead ( )
inline

lock the underlying octree. it will not be read or written by the monitor until unlockTree() is called

Definition at line 94 of file occupancy_map.h.

◆ lockWrite()

void collision_detection::OccMapTree::lockWrite ( )
inline

lock the underlying octree. it will not be read or written by the monitor until unlockTree() is called

Definition at line 107 of file occupancy_map.h.

◆ reading()

ReadLock collision_detection::OccMapTree::reading ( )
inline

Definition at line 121 of file occupancy_map.h.

◆ setUpdateCallback()

void collision_detection::OccMapTree::setUpdateCallback ( const boost::function< void()> &  update_callback)
inline

Set the callback to trigger when updates are received.

Definition at line 138 of file occupancy_map.h.

◆ triggerUpdateCallback()

void collision_detection::OccMapTree::triggerUpdateCallback ( )
inline

Definition at line 131 of file occupancy_map.h.

◆ unlockRead()

void collision_detection::OccMapTree::unlockRead ( )
inline

unlock the underlying octree.

Definition at line 100 of file occupancy_map.h.

◆ unlockWrite()

void collision_detection::OccMapTree::unlockWrite ( )
inline

unlock the underlying octree.

Definition at line 113 of file occupancy_map.h.

◆ writing()

WriteLock collision_detection::OccMapTree::writing ( )
inline

Definition at line 126 of file occupancy_map.h.

Member Data Documentation

◆ tree_mutex_

boost::shared_mutex collision_detection::OccMapTree::tree_mutex_
private

Definition at line 144 of file occupancy_map.h.

◆ update_callback_

boost::function<void()> collision_detection::OccMapTree::update_callback_
private

Definition at line 145 of file occupancy_map.h.


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


moveit_core
Author(s): Ioan Sucan , Sachin Chitta , Acorn Pooley
autogenerated on Thu Nov 21 2024 03:23:42