Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
tesseract_geometry::Octree Class Reference

#include <octree.h>

Inheritance diagram for tesseract_geometry::Octree:
Inheritance graph
[legend]
Collaboration diagram for tesseract_geometry::Octree:
Collaboration graph
[legend]

Public Types

enum  SubType { BOX , SPHERE_INSIDE , SPHERE_OUTSIDE }
 
using Ptr = std::shared_ptr< Octree >
 
using ConstPtr = std::shared_ptr< const Octree >
 
- Public Types inherited from tesseract_geometry::Geometry
using Ptr = std::shared_ptr< Geometry >
 
using ConstPtr = std::shared_ptr< const Geometry >
 

Public Member Functions

 Octree (std::shared_ptr< const octomap::OcTree > octree, const SubType sub_type)
 
template<typename PointT >
 Octree (const PointT &point_cloud, const double resolution, const SubType sub_type, const bool prune, const bool binary=true)
 
 Octree ()=default
 
 ~Octree () override=default
 
const std::shared_ptr< const octomap::OcTree > & getOctree () const
 
SubType getSubType () const
 
bool getPruned () const
 
Geometry::Ptr clone () const override final
 Create a copy of this shape. More...
 
bool operator== (const Octree &rhs) const
 
bool operator!= (const Octree &rhs) const
 
void update ()
 Octrees are typically generated from 3D sensor data so this method should be used to efficiently update the collision shape. More...
 
long calcNumSubShapes () const
 Calculate the number of sub shapes that would get generated for this octree. More...
 
- Public Member Functions inherited from tesseract_geometry::Geometry
 Geometry (GeometryType type=GeometryType::UNINITIALIZED)
 
virtual ~Geometry ()=default
 
 Geometry (const Geometry &)=default
 
Geometryoperator= (const Geometry &)=default
 
 Geometry (Geometry &&)=default
 
Geometryoperator= (Geometry &&)=default
 
virtual Geometry::Ptr clone () const =0
 Create a copy of this shape. More...
 
GeometryType getType () const
 
bool operator== (const Geometry &rhs) const
 
bool operator!= (const Geometry &rhs) const
 

Static Public Member Functions

static void prune (octomap::OcTree &octree)
 A custom octree prune which will prune if all children are above the occupancy threshold. More...
 

Private Member Functions

template<class Archive >
void save (Archive &ar, const unsigned int version) const
 
template<class Archive >
void load (Archive &ar, const unsigned int version)
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Static Private Member Functions

static bool isNodeCollapsible (octomap::OcTree &octree, octomap::OcTreeNode *node)
 
static bool pruneNode (octomap::OcTree &octree, octomap::OcTreeNode *node)
 
static void pruneRecurs (octomap::OcTree &octree, octomap::OcTreeNode *node, unsigned int depth, unsigned int max_depth, unsigned int &num_pruned)
 

Private Attributes

std::shared_ptr< const octomap::OcTree > octree_
 
SubType sub_type_ { SubType::BOX }
 
double resolution_ { 0.01 }
 
bool pruned_ { false }
 
bool binary_octree_ { false }
 

Friends

class boost::serialization::access
 

Member Typedef Documentation

◆ ConstPtr

using tesseract_geometry::Octree::ConstPtr = std::shared_ptr<const Octree>

◆ Ptr

using tesseract_geometry::Octree::Ptr = std::shared_ptr<Octree>

Member Enumeration Documentation

◆ SubType

Enumerator
BOX 
SPHERE_INSIDE 
SPHERE_OUTSIDE 

Constructor & Destructor Documentation

◆ Octree() [1/3]

tesseract_geometry::Octree::Octree ( std::shared_ptr< const octomap::OcTree >  octree,
const SubType  sub_type 
)
inline

◆ Octree() [2/3]

template<typename PointT >
tesseract_geometry::Octree::Octree ( const PointT &  point_cloud,
const double  resolution,
const SubType  sub_type,
const bool  prune,
const bool  binary = true 
)
inline

◆ Octree() [3/3]

tesseract_geometry::Octree::Octree ( )
default

◆ ~Octree()

tesseract_geometry::Octree::~Octree ( )
overridedefault

Member Function Documentation

◆ calcNumSubShapes()

long tesseract_geometry::Octree::calcNumSubShapes ( ) const
inline

Calculate the number of sub shapes that would get generated for this octree.

This is expensive and should not be called multiple times

Returns
number of sub shapes

◆ clone()

Geometry::Ptr tesseract_geometry::Octree::clone ( ) const
inlinefinaloverridevirtual

Create a copy of this shape.

Implements tesseract_geometry::Geometry.

◆ getOctree()

const std::shared_ptr< const octomap::OcTree > & tesseract_geometry::Octree::getOctree ( ) const
inline

◆ getPruned()

bool tesseract_geometry::Octree::getPruned ( ) const
inline

◆ getSubType()

SubType tesseract_geometry::Octree::getSubType ( ) const
inline

◆ isNodeCollapsible()

static bool tesseract_geometry::Octree::isNodeCollapsible ( octomap::OcTree &  octree,
octomap::OcTreeNode *  node 
)
inlinestaticprivate

◆ load()

template<class Archive >
void tesseract_geometry::Octree::load ( Archive &  ar,
const unsigned int  version 
)
private

◆ operator!=()

bool tesseract_geometry::Octree::operator!= ( const Octree rhs) const

◆ operator==()

bool tesseract_geometry::Octree::operator== ( const Octree rhs) const

◆ prune()

static void tesseract_geometry::Octree::prune ( octomap::OcTree &  octree)
inlinestatic

A custom octree prune which will prune if all children are above the occupancy threshold.

This is different from the octomap::OcTree::prune which requires all children to have the same occupancy to be collapsed.

Parameters
octreeThe octree to be pruned.

◆ pruneNode()

static bool tesseract_geometry::Octree::pruneNode ( octomap::OcTree &  octree,
octomap::OcTreeNode *  node 
)
inlinestaticprivate

◆ pruneRecurs()

static void tesseract_geometry::Octree::pruneRecurs ( octomap::OcTree &  octree,
octomap::OcTreeNode *  node,
unsigned int  depth,
unsigned int  max_depth,
unsigned int &  num_pruned 
)
inlinestaticprivate

◆ save()

template<class Archive >
void tesseract_geometry::Octree::save ( Archive &  ar,
const unsigned int  version 
) const
private

◆ serialize()

template<class Archive >
void tesseract_geometry::Octree::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ update()

void tesseract_geometry::Octree::update ( )
inline

Octrees are typically generated from 3D sensor data so this method should be used to efficiently update the collision shape.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Member Data Documentation

◆ binary_octree_

bool tesseract_geometry::Octree::binary_octree_ { false }
private

◆ octree_

std::shared_ptr<const octomap::OcTree> tesseract_geometry::Octree::octree_
private

◆ pruned_

bool tesseract_geometry::Octree::pruned_ { false }
private

◆ resolution_

double tesseract_geometry::Octree::resolution_ { 0.01 }
private

◆ sub_type_

SubType tesseract_geometry::Octree::sub_type_ { SubType::BOX }
private

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