coal  3.0.1
Coal, The Collision Detection Library. Previously known as HPP-FCL, fork of FCL -- The Flexible Collision Library
coal::OcTree Class Reference

Octree is one type of collision geometry which can encode uncertainty information in the sensor data. More...

#include <coal/octree.h>

Inheritance diagram for coal::OcTree:
Collaboration diagram for coal::OcTree:

Public Types

typedef octomap::OcTreeNode OcTreeNode
 

Public Member Functions

 OcTree (Scalar resolution)
 construct octree with a given resolution More...
 
 OcTree (const shared_ptr< const octomap::OcTree > &tree_)
 construct octree from octomap More...
 
 OcTree (const OcTree &other)
   More...
 
OcTreeclone () const
 Clone *this into a new Octree. More...
 
shared_ptr< const octomap::OcTree > getTree () const
 Returns the tree associated to the underlying octomap OcTree. More...
 
void exportAsObjFile (const std::string &filename) const
 
void computeLocalAABB ()
 compute the AABB for the octree in its local coordinate system More...
 
AABB getRootBV () const
 get the bounding volume for the root More...
 
unsigned int getTreeDepth () const
 Returns the depth of the octree. More...
 
unsigned long size () const
 Returns the size of the octree. More...
 
Scalar getResolution () const
 Returns the resolution of the octree. More...
 
OcTreeNodegetRoot () const
 get the root node of the octree More...
 
bool isNodeOccupied (const OcTreeNode *node) const
 whether one node is completely occupied More...
 
bool isNodeFree (const OcTreeNode *node) const
 whether one node is completely free More...
 
bool isNodeUncertain (const OcTreeNode *node) const
 whether one node is uncertain More...
 
std::vector< Vec6stoBoxes () const
 transform the octree into a bunch of boxes; uncertainty information is kept in the boxes. However, we only keep the occupied boxes (i.e., the boxes whose occupied probability is higher enough). More...
 
std::vector< uint8_t > tobytes () const
 Returns a byte description of *this. More...
 
Scalar getOccupancyThres () const
 the threshold used to decide whether one node is occupied, this is NOT the octree occupied_thresold More...
 
Scalar getFreeThres () const
 the threshold used to decide whether one node is free, this is NOT the octree free_threshold More...
 
Scalar getDefaultOccupancy () const
 
void setCellDefaultOccupancy (Scalar d)
 
void setOccupancyThres (Scalar d)
 
void setFreeThres (Scalar d)
 
OcTreeNodegetNodeChild (OcTreeNode *node, unsigned int childIdx)
 
const OcTreeNodegetNodeChild (const OcTreeNode *node, unsigned int childIdx) const
 
bool nodeChildExists (const OcTreeNode *node, unsigned int childIdx) const
 return true if the child at childIdx exists More...
 
bool nodeHasChildren (const OcTreeNode *node) const
 return true if node has at least one child More...
 
OBJECT_TYPE getObjectType () const
 return object type, it is an octree More...
 
NODE_TYPE getNodeType () const
 return node type, it is an octree More...
 
- Public Member Functions inherited from coal::CollisionGeometry
 CollisionGeometry ()
 
 CollisionGeometry (const CollisionGeometry &other)=default
 Copy constructor. More...
 
virtual ~CollisionGeometry ()
 
bool operator== (const CollisionGeometry &other) const
 Equality operator. More...
 
bool operator!= (const CollisionGeometry &other) const
 Difference operator. More...
 
void * getUserData () const
 get user data in geometry More...
 
void setUserData (void *data)
 set user data in geometry More...
 
bool isOccupied () const
 whether the object is completely occupied More...
 
bool isFree () const
 whether the object is completely free More...
 
bool isUncertain () const
 whether the object has some uncertainty More...
 
virtual Vec3s computeCOM () const
 compute center of mass More...
 
virtual Matrix3s computeMomentofInertia () const
 compute the inertia matrix, related to the origin More...
 
virtual Scalar computeVolume () const
 compute the volume More...
 
virtual Matrix3s computeMomentofInertiaRelatedToCOM () const
 compute the inertia matrix, related to the com More...
 

Protected Attributes

shared_ptr< const octomap::OcTree > tree
 
Scalar default_occupancy
 
Scalar occupancy_threshold
 
Scalar free_threshold
 

Additional Inherited Members

- Public Attributes inherited from coal::CollisionGeometry
Vec3s aabb_center
 AABB center in local coordinate. More...
 
Scalar aabb_radius
 AABB radius. More...
 
AABB aabb_local
 AABB in local coordinate, used for tight AABB when only translation transform. More...
 
void * user_data
 pointer to user defined data specific to this object More...
 
Scalar cost_density
 collision cost for unit volume More...
 
Scalar threshold_occupied
 threshold for occupied ( >= is occupied) More...
 
Scalar threshold_free
 threshold for free (<= is free) More...
 

Detailed Description

Octree is one type of collision geometry which can encode uncertainty information in the sensor data.

Member Typedef Documentation

◆ OcTreeNode

typedef octomap::OcTreeNode coal::OcTree::OcTreeNode

Constructor & Destructor Documentation

◆ OcTree() [1/3]

coal::OcTree::OcTree ( Scalar  resolution)
inlineexplicit

construct octree with a given resolution

◆ OcTree() [2/3]

coal::OcTree::OcTree ( const shared_ptr< const octomap::OcTree > &  tree_)
inlineexplicit

construct octree from octomap

◆ OcTree() [3/3]

coal::OcTree::OcTree ( const OcTree other)
inline

 

Copy constructor

Member Function Documentation

◆ clone()

OcTree* coal::OcTree::clone ( ) const
inlinevirtual

Clone *this into a new Octree.

Implements coal::CollisionGeometry.

◆ computeLocalAABB()

void coal::OcTree::computeLocalAABB ( )
inlinevirtual

compute the AABB for the octree in its local coordinate system

Implements coal::CollisionGeometry.

◆ exportAsObjFile()

void coal::OcTree::exportAsObjFile ( const std::string &  filename) const

◆ getDefaultOccupancy()

Scalar coal::OcTree::getDefaultOccupancy ( ) const
inline

◆ getFreeThres()

Scalar coal::OcTree::getFreeThres ( ) const
inline

the threshold used to decide whether one node is free, this is NOT the octree free_threshold

◆ getNodeChild() [1/2]

const OcTreeNode* coal::OcTree::getNodeChild ( const OcTreeNode node,
unsigned int  childIdx 
) const
inline
Returns
const ptr to child number childIdx of node

◆ getNodeChild() [2/2]

OcTreeNode* coal::OcTree::getNodeChild ( OcTreeNode node,
unsigned int  childIdx 
)
inline
Returns
ptr to child number childIdx of node

◆ getNodeType()

NODE_TYPE coal::OcTree::getNodeType ( ) const
inlinevirtual

return node type, it is an octree

Reimplemented from coal::CollisionGeometry.

◆ getObjectType()

OBJECT_TYPE coal::OcTree::getObjectType ( ) const
inlinevirtual

return object type, it is an octree

Reimplemented from coal::CollisionGeometry.

◆ getOccupancyThres()

Scalar coal::OcTree::getOccupancyThres ( ) const
inline

the threshold used to decide whether one node is occupied, this is NOT the octree occupied_thresold

◆ getResolution()

Scalar coal::OcTree::getResolution ( ) const
inline

Returns the resolution of the octree.

◆ getRoot()

OcTreeNode* coal::OcTree::getRoot ( ) const
inline

get the root node of the octree

◆ getRootBV()

AABB coal::OcTree::getRootBV ( ) const
inline

get the bounding volume for the root

◆ getTree()

shared_ptr<const octomap::OcTree> coal::OcTree::getTree ( ) const
inline

Returns the tree associated to the underlying octomap OcTree.

◆ getTreeDepth()

unsigned int coal::OcTree::getTreeDepth ( ) const
inline

Returns the depth of the octree.

◆ isNodeFree()

bool coal::OcTree::isNodeFree ( const OcTreeNode node) const
inline

whether one node is completely free

◆ isNodeOccupied()

bool coal::OcTree::isNodeOccupied ( const OcTreeNode node) const
inline

whether one node is completely occupied

◆ isNodeUncertain()

bool coal::OcTree::isNodeUncertain ( const OcTreeNode node) const
inline

whether one node is uncertain

◆ nodeChildExists()

bool coal::OcTree::nodeChildExists ( const OcTreeNode node,
unsigned int  childIdx 
) const
inline

return true if the child at childIdx exists

◆ nodeHasChildren()

bool coal::OcTree::nodeHasChildren ( const OcTreeNode node) const
inline

return true if node has at least one child

◆ setCellDefaultOccupancy()

void coal::OcTree::setCellDefaultOccupancy ( Scalar  d)
inline

◆ setFreeThres()

void coal::OcTree::setFreeThres ( Scalar  d)
inline

◆ setOccupancyThres()

void coal::OcTree::setOccupancyThres ( Scalar  d)
inline

◆ size()

unsigned long coal::OcTree::size ( ) const
inline

Returns the size of the octree.

◆ toBoxes()

std::vector<Vec6s> coal::OcTree::toBoxes ( ) const
inline

transform the octree into a bunch of boxes; uncertainty information is kept in the boxes. However, we only keep the occupied boxes (i.e., the boxes whose occupied probability is higher enough).

◆ tobytes()

std::vector<uint8_t> coal::OcTree::tobytes ( ) const
inline

Returns a byte description of *this.

Member Data Documentation

◆ default_occupancy

Scalar coal::OcTree::default_occupancy
protected

◆ free_threshold

Scalar coal::OcTree::free_threshold
protected

◆ occupancy_threshold

Scalar coal::OcTree::occupancy_threshold
protected

◆ tree

shared_ptr<const octomap::OcTree> coal::OcTree::tree
protected

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