RobWorkProject  23.9.11-
Public Types | Public Member Functions | Static Public Member Functions | List of all members
RRTTree< X > Class Template Reference

Tree data type for RRT based planners. More...

#include <RRTTree.hpp>

Public Types

typedef X value_type
 The type of a value.
 
typedef RRTNode< X > node_type
 The type of a node.
 
typedef std::vector< node_type * >::const_iterator const_iterator
 Type of an iterator for iterating though the nodes in the tree.
 

Public Member Functions

 RRTTree (const value_type &value)
 Construct new tree. More...
 
node_typegetRoot () const
 Get the root node of the tree. More...
 
node_typegetLast () const
 Get the last node added to the tree. More...
 
void add (const value_type &value, node_type *parent)
 Create a new node. More...
 
rw::core::iter_pair< const_iteratorgetNodes () const
 Get all nodes in the tree. More...
 
 ~RRTTree ()
 Destructor.
 
size_t size () const
 Get the number of nodes in the tree. More...
 

Static Public Member Functions

static void getRootPath (node_type &last, std::vector< value_type > &path)
 Get the path from the given node to the root ndoe. More...
 

Detailed Description

template<class X>
class rwlibs::pathplanners::RRTTree< X >

Tree data type for RRT based planners.

Constructor & Destructor Documentation

◆ RRTTree()

RRTTree ( const value_type value)
inline

Construct new tree.

Parameters
value[in] value of the root node.

Member Function Documentation

◆ add()

void add ( const value_type value,
node_type parent 
)
inline

Create a new node.

Parameters
value[in] value of the node.
parent[in] the parent of the node.

◆ getLast()

node_type& getLast ( ) const
inline

Get the last node added to the tree.

Returns
the last node.

◆ getNodes()

rw::core::iter_pair<const_iterator> getNodes ( ) const
inline

Get all nodes in the tree.

Returns
a pair of iterators for the first and last node in the tree respectively.

◆ getRoot()

node_type& getRoot ( ) const
inline

Get the root node of the tree.

Returns
the root node.

◆ getRootPath()

static void getRootPath ( node_type last,
std::vector< value_type > &  path 
)
inlinestatic

Get the path from the given node to the root ndoe.

Parameters
last[in] the node to find path for.
path[out] the path.

◆ size()

size_t size ( ) const
inline

Get the number of nodes in the tree.

Returns
the size of the tree.

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