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]

Public Types

using ConstPtr = std::shared_ptr< const Octree >
 
using Ptr = std::shared_ptr< Octree >
 
- Public Types inherited from tesseract_geometry::Geometry
using ConstPtr = std::shared_ptr< const Geometry >
 
using Ptr = std::shared_ptr< Geometry >
 

Public Member Functions

long calcNumSubShapes () const
 Calculate the number of sub shapes that would get generated for this octree. More...
 
Geometry::Ptr clone () const override final
 Create a copy of this shape. More...
 
const std::shared_ptr< const octomap::OcTree > & getOctree () const
 
bool getPruned () const
 
OctreeSubType getSubType () const
 
 Octree ()=default
 
 Octree (std::shared_ptr< const octomap::OcTree > octree, OctreeSubType sub_type, bool pruned=false, bool binary_octree=false)
 
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...
 
 ~Octree () override=default
 
- Public Member Functions inherited from tesseract_geometry::Geometry
 Geometry (const Geometry &)=default
 
 Geometry (Geometry &&)=default
 
 Geometry (GeometryType type=GeometryType::UNINITIALIZED)
 
GeometryType getType () const
 Get the geometry type. More...
 
const boost::uuids::uuid & getUUID () const
 Get the geometry UUID. More...
 
bool operator!= (const Geometry &rhs) const
 
Geometryoperator= (const Geometry &)=default
 
Geometryoperator= (Geometry &&)=default
 
bool operator== (const Geometry &rhs) const
 
void setUUID (const boost::uuids::uuid &uuid)
 Set the geometry UUID. More...
 
virtual ~Geometry ()=default
 

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 load (Archive &ar, const unsigned int version)
 
template<class Archive >
void save (Archive &ar, const unsigned int version) const
 
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

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

Friends

class boost::serialization::access
 
struct tesseract_common::Serialization
 

Detailed Description

Definition at line 58 of file octree.h.

Member Typedef Documentation

◆ ConstPtr

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

Definition at line 62 of file octree.h.

◆ Ptr

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

Definition at line 61 of file octree.h.

Constructor & Destructor Documentation

◆ Octree() [1/2]

tesseract_geometry::Octree::Octree ( std::shared_ptr< const octomap::OcTree >  octree,
OctreeSubType  sub_type,
bool  pruned = false,
bool  binary_octree = false 
)

Definition at line 40 of file octree.cpp.

◆ Octree() [2/2]

tesseract_geometry::Octree::Octree ( )
default

◆ ~Octree()

tesseract_geometry::Octree::~Octree ( )
overridedefault

Member Function Documentation

◆ calcNumSubShapes()

long tesseract_geometry::Octree::calcNumSubShapes ( ) const

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

Definition at line 57 of file octree.cpp.

◆ clone()

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

Create a copy of this shape.

Implements tesseract_geometry::Geometry.

Definition at line 55 of file octree.cpp.

◆ getOctree()

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

Definition at line 49 of file octree.cpp.

◆ getPruned()

bool tesseract_geometry::Octree::getPruned ( ) const

Definition at line 53 of file octree.cpp.

◆ getSubType()

OctreeSubType tesseract_geometry::Octree::getSubType ( ) const

Definition at line 51 of file octree.cpp.

◆ isNodeCollapsible()

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

Definition at line 69 of file octree.cpp.

◆ load()

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

Definition at line 219 of file octree.cpp.

◆ operator!=()

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

Definition at line 192 of file octree.cpp.

◆ operator==()

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

Definition at line 158 of file octree.cpp.

◆ prune()

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

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.

Definition at line 144 of file octree.cpp.

◆ pruneNode()

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

Definition at line 97 of file octree.cpp.

◆ pruneRecurs()

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

Definition at line 115 of file octree.cpp.

◆ save()

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

Definition at line 195 of file octree.cpp.

◆ serialize()

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

Definition at line 251 of file octree.cpp.

◆ 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.

Definition at line 86 of file octree.h.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 115 of file octree.h.

◆ tesseract_common::Serialization

friend struct tesseract_common::Serialization
friend

Definition at line 116 of file octree.h.

Member Data Documentation

◆ binary_octree_

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

Definition at line 102 of file octree.h.

◆ octree_

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

Definition at line 98 of file octree.h.

◆ pruned_

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

Definition at line 101 of file octree.h.

◆ resolution_

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

Definition at line 100 of file octree.h.

◆ sub_type_

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

Definition at line 99 of file octree.h.


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


tesseract_geometry
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:01:46