Main MRPT website > C++ reference
MRPT logo
List of all members | Public Types | Public Member Functions | Public Attributes | Static Public Attributes
mrpt::nav::TMoveTree< MOVE_TYPE > Class Template Reference

Detailed Description

template<class MOVE_TYPE>
class mrpt::nav::TMoveTree< MOVE_TYPE >

This class contains motions and motions tree structures for the hybrid navigation algorithm.

Usage:

Note
: this class inheredit mrpt::graphs::CDirectedTree, please refer to inheritance for detail about generic tree methods

About the algorithm:

Changes history

Definition at line 36 of file TMotions.h.

#include <mrpt/nav/planners/TMotions.h>

Inheritance diagram for mrpt::nav::TMoveTree< MOVE_TYPE >:
Inheritance graph
[legend]

Public Types

typedef std::list< TEdgeInfo > TListEdges
 
typedef std::map< TNodeID, TListEdgesTMapNode2ListEdges
 

Public Member Functions

bool initializeMoveTree ()
 Initialize variables and the list of edges for the tree. More...
 
void setReverse (bool _reverse)
 this allow the user to set the reverse mode in the tree - false as default More...
 
void addEdge (const MOVE_TYPE &parent_, const MOVE_TYPE &new_motion)
 addEdge (from, to) have to be implemented in the following way: IN-> from MOVE_TYPE parent_ to MOVE_TYPE new_motion More...
 
TNodeID searchIDinTree (const MOVE_TYPE &mov)
 return the Node_ID of a specific motion. More...
 
TNodeID getNearestMove (const MOVE_TYPE &TMove_)
 return the TEdgeInfo of the nearest neighbor to a specific motion. More...
 
Utilities
void clear ()
 Empty all edge data and set "root" to INVALID_NODEID. More...
 
void visitDepthFirst (const TNodeID root, Visitor &user_visitor, const size_t root_depth_level=0) const
 Depth-first visit of all children nodes of a given root (itself excluded from the visit), invoking a user-provided function for each node/edge. More...
 
void visitBreadthFirst (const TNodeID root, Visitor &user_visitor, const size_t root_depth_level=0) const
 Breadth-first visit of all children nodes of a given root (itself excluded from the visit), invoking a user-provided function for each node/edge. More...
 
std::string getAsTextDescription () const
 Return a text representation of the tree spanned in a depth-first view, as in this example: More...
 

Public Attributes

mrpt::utils::TNodeID id_child
 child id will change according to the parent level More...
 
bool reverse_
 flag for forward of backward tree exploration - default = false i.e. forward More...
 
bool treeInitialized
 flag for checking if the tree is correctly initialized More...
 
TMoveTree::TListEdges my_list_of_edges
 structure for the list of edges More...
 
Data
TNodeID root
 The root of the tree. More...
 
TMapNode2ListEdges edges_to_children
 The edges of each node. More...
 

Static Public Attributes

static const mrpt::utils::TNodeID id_root = 0
 set ID of the root node always 0 More...
 

Member Typedef Documentation

typedef std::list<TEdgeInfo> mrpt::graphs::CDirectedTree< MOVE_TYPE >::TListEdges
inherited

Definition at line 63 of file CDirectedTree.h.

typedef std::map<TNodeID,TListEdges> mrpt::graphs::CDirectedTree< MOVE_TYPE >::TMapNode2ListEdges
inherited

Definition at line 64 of file CDirectedTree.h.

Member Function Documentation

template<class MOVE_TYPE >
void mrpt::nav::TMoveTree< MOVE_TYPE >::addEdge ( const MOVE_TYPE &  parent_,
const MOVE_TYPE &  new_motion 
)
inline

addEdge (from, to) have to be implemented in the following way: IN-> from MOVE_TYPE parent_ to MOVE_TYPE new_motion

inside this method a search method have to be called to find the TNodeID of parent_ (tree_depth_level) then new_motion will be added at the next level of parent_

Note
please call initializeMoveTree first

Definition at line 78 of file TMotions.h.

References ASSERTMSG_, and mrpt::nav::TMoveTree< MOVE_TYPE >::searchIDinTree().

void mrpt::graphs::CDirectedTree< MOVE_TYPE >::clear ( void  )
inlineinherited

Empty all edge data and set "root" to INVALID_NODEID.

Definition at line 76 of file CDirectedTree.h.

References INVALID_NODEID.

std::string mrpt::graphs::CDirectedTree< MOVE_TYPE >::getAsTextDescription ( ) const
inlineinherited

Return a text representation of the tree spanned in a depth-first view, as in this example:

0
-> 1
-> 2
-> 4
-> 5
-> 3

Definition at line 129 of file CDirectedTree.h.

References mrpt::graphs::CDirectedTree< TYPE_EDGES >::TEdgeInfo::id, mrpt::graphs::CDirectedTree< TYPE_EDGES >::TEdgeInfo::reverse, and mrpt::graphs::CDirectedTree< TYPE_EDGES >::visitDepthFirst().

template<class MOVE_TYPE >
TNodeID mrpt::nav::TMoveTree< MOVE_TYPE >::getNearestMove ( const MOVE_TYPE &  TMove_)
inline

return the TEdgeInfo of the nearest neighbor to a specific motion.

Note
: is this better to go into CDirectedTree.h ?

Definition at line 105 of file TMotions.h.

References MRPT_TODO.

template<class MOVE_TYPE >
bool mrpt::nav::TMoveTree< MOVE_TYPE >::initializeMoveTree ( )
inline

Initialize variables and the list of edges for the tree.

DOESN'T COMPILE with [id_root], why?

< just initialize the id_child as the first after the root

Definition at line 50 of file TMotions.h.

References mrpt::graphs::CDirectedTree< MOVE_TYPE >::edges_to_children, and mrpt::nav::TMoveTree< MOVE_TYPE >::treeInitialized.

template<class MOVE_TYPE >
TNodeID mrpt::nav::TMoveTree< MOVE_TYPE >::searchIDinTree ( const MOVE_TYPE &  mov)
inline

return the Node_ID of a specific motion.

Note
: Node_ID corresponds to the depth of the tree for a specific edge

Definition at line 93 of file TMotions.h.

References mrpt::nav::TMoveTree< MOVE_TYPE >::id_child, and MRPT_TODO.

Referenced by mrpt::nav::TMoveTree< MOVE_TYPE >::addEdge().

template<class MOVE_TYPE >
void mrpt::nav::TMoveTree< MOVE_TYPE >::setReverse ( bool  _reverse)
inline

this allow the user to set the reverse mode in the tree - false as default

Definition at line 66 of file TMotions.h.

void mrpt::graphs::CDirectedTree< MOVE_TYPE >::visitBreadthFirst ( const TNodeID  root,
Visitor &  user_visitor,
const size_t  root_depth_level = 0 
) const
inlineinherited

Breadth-first visit of all children nodes of a given root (itself excluded from the visit), invoking a user-provided function for each node/edge.

See also
visitDepthFirst

Definition at line 107 of file CDirectedTree.h.

References mrpt::graphs::CDirectedTree< TYPE_EDGES >::visitDepthFirst().

void mrpt::graphs::CDirectedTree< MOVE_TYPE >::visitDepthFirst ( const TNodeID  root,
Visitor &  user_visitor,
const size_t  root_depth_level = 0 
) const
inlineinherited

Depth-first visit of all children nodes of a given root (itself excluded from the visit), invoking a user-provided function for each node/edge.

See also
visitBreadthFirst

Definition at line 93 of file CDirectedTree.h.

References mrpt::graphs::CDirectedTree< TYPE_EDGES >::visitDepthFirst().

Member Data Documentation

TMapNode2ListEdges mrpt::graphs::CDirectedTree< MOVE_TYPE >::edges_to_children
inherited

The edges of each node.

Definition at line 69 of file CDirectedTree.h.

Referenced by mrpt::nav::TMoveTree< MOVE_TYPE >::initializeMoveTree().

template<class MOVE_TYPE >
mrpt::utils::TNodeID mrpt::nav::TMoveTree< MOVE_TYPE >::id_child

child id will change according to the parent level

Definition at line 42 of file TMotions.h.

Referenced by mrpt::nav::TMoveTree< MOVE_TYPE >::searchIDinTree().

template<class MOVE_TYPE >
const mrpt::utils::TNodeID mrpt::nav::TMoveTree< MOVE_TYPE >::id_root = 0
static

set ID of the root node always 0

Definition at line 41 of file TMotions.h.

template<class MOVE_TYPE >
TMoveTree::TListEdges mrpt::nav::TMoveTree< MOVE_TYPE >::my_list_of_edges

structure for the list of edges

Definition at line 45 of file TMotions.h.

template<class MOVE_TYPE >
bool mrpt::nav::TMoveTree< MOVE_TYPE >::reverse_

flag for forward of backward tree exploration - default = false i.e. forward

Definition at line 43 of file TMotions.h.

TNodeID mrpt::graphs::CDirectedTree< MOVE_TYPE >::root
inherited

The root of the tree.

Definition at line 68 of file CDirectedTree.h.

template<class MOVE_TYPE >
bool mrpt::nav::TMoveTree< MOVE_TYPE >::treeInitialized

flag for checking if the tree is correctly initialized

Definition at line 44 of file TMotions.h.

Referenced by mrpt::nav::TMoveTree< MOVE_TYPE >::initializeMoveTree().




Page generated by Doxygen 1.8.9.1 for MRPT 1.3.0 SVN: at Sun Sep 13 03:55:12 UTC 2015