coal 3.0.2
Coal, The Collision Detection Library. Previously known as HPP-FCL, fork of FCL -- The Flexible Collision Library
Loading...
Searching...
No Matches
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:
coal::CollisionGeometryboost::serialization::internal::OcTreeAccessor

Public Types

typedef octomap::OcTreeNode OcTreeNode

Public Member Functions

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

Protected Attributes

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

Additional Inherited Members

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

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(CoalScalarresolution)
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()

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

◆ getFreeThres()

CoalScalar 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 intchildIdx ) const
inline
Returns
const ptr to child number childIdx of node

◆ getNodeChild() [2/2]

OcTreeNode * coal::OcTree::getNodeChild(OcTreeNode *node,
unsigned intchildIdx )
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()

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

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

◆ getResolution()

CoalScalar 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 intchildIdx ) 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(CoalScalard)
inline

◆ setFreeThres()

void coal::OcTree::setFreeThres(CoalScalard)
inline

◆ setOccupancyThres()

void coal::OcTree::setOccupancyThres(CoalScalard)
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

CoalScalar coal::OcTree::default_occupancy
protected

◆ free_threshold

CoalScalar coal::OcTree::free_threshold
protected

◆ occupancy_threshold

CoalScalar 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: