Main MRPT website > C++ reference for MRPT 1.5.9
List of all members | Classes | Public Types | Public Member Functions | Private Attributes
mrpt::nav::TMoveTree< NODE_TYPE_DATA, EDGE_TYPE, MAPS_IMPLEMENTATION > Class Template Reference

Detailed Description

template<class NODE_TYPE_DATA, class EDGE_TYPE, class MAPS_IMPLEMENTATION = mrpt::utils::map_traits_map_as_vector>
class mrpt::nav::TMoveTree< NODE_TYPE_DATA, EDGE_TYPE, MAPS_IMPLEMENTATION >

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

Changes history

Definition at line 52 of file TMoveTree.h.

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

Inheritance diagram for mrpt::nav::TMoveTree< NODE_TYPE_DATA, EDGE_TYPE, MAPS_IMPLEMENTATION >:
Inheritance graph

Classes

struct  node_t
 

Public Types

typedef mrpt::graphs::CDirectedTree< EDGE_TYPE > base_t
 
typedef EDGE_TYPE edge_t
 
typedef MAPS_IMPLEMENTATION::template map< mrpt::utils::TNodeID, node_tnode_map_t
 Map: TNode_ID => Node info. More...
 
typedef std::list< node_tpath_t
 A topological path up-tree. More...
 
typedef std::list< TEdgeInfo > TListEdges
 
typedef std::map< TNodeID, TListEdgesTMapNode2ListEdges
 

Public Member Functions

template<class NODE_TYPE_FOR_METRIC >
mrpt::utils::TNodeID getNearestNode (const NODE_TYPE_FOR_METRIC &query_pt, const PoseDistanceMetric< NODE_TYPE_FOR_METRIC > &distanceMetricEvaluator, double *out_distance=NULL, const std::set< mrpt::utils::TNodeID > *ignored_nodes=NULL) const
 Finds the nearest node to a given pose, using the given metric. More...
 
void insertNodeAndEdge (const mrpt::utils::TNodeID parent_id, const mrpt::utils::TNodeID new_child_id, const NODE_TYPE_DATA &new_child_node_data, const EDGE_TYPE &new_edge_data)
 
void insertNode (const mrpt::utils::TNodeID node_id, const NODE_TYPE_DATA &node_data)
 Insert a node without edges (should be used only for a tree root node) More...
 
mrpt::utils::TNodeID getNextFreeNodeID () const
 
const node_map_tgetAllNodes () const
 
void backtrackPath (const mrpt::utils::TNodeID target_node, path_t &out_path) const
 Builds the path (sequence of nodes, with info about next edge) up-tree from a target_node towards the root Nodes are ordered in the direction ROOT -> start_node. 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

Data
TNodeID root
 The root of the tree. More...
 
TMapNode2ListEdges edges_to_children
 The edges of each node. More...
 

Private Attributes

node_map_t m_nodes
 Info per node. More...
 

Member Typedef Documentation

◆ base_t

template<class NODE_TYPE_DATA , class EDGE_TYPE , class MAPS_IMPLEMENTATION = mrpt::utils::map_traits_map_as_vector>
typedef mrpt::graphs::CDirectedTree<EDGE_TYPE> mrpt::nav::TMoveTree< NODE_TYPE_DATA, EDGE_TYPE, MAPS_IMPLEMENTATION >::base_t

Definition at line 69 of file TMoveTree.h.

◆ edge_t

template<class NODE_TYPE_DATA , class EDGE_TYPE , class MAPS_IMPLEMENTATION = mrpt::utils::map_traits_map_as_vector>
typedef EDGE_TYPE mrpt::nav::TMoveTree< NODE_TYPE_DATA, EDGE_TYPE, MAPS_IMPLEMENTATION >::edge_t

Definition at line 70 of file TMoveTree.h.

◆ node_map_t

template<class NODE_TYPE_DATA , class EDGE_TYPE , class MAPS_IMPLEMENTATION = mrpt::utils::map_traits_map_as_vector>
typedef MAPS_IMPLEMENTATION::template map<mrpt::utils::TNodeID, node_t> mrpt::nav::TMoveTree< NODE_TYPE_DATA, EDGE_TYPE, MAPS_IMPLEMENTATION >::node_map_t

Map: TNode_ID => Node info.

Definition at line 71 of file TMoveTree.h.

◆ path_t

template<class NODE_TYPE_DATA , class EDGE_TYPE , class MAPS_IMPLEMENTATION = mrpt::utils::map_traits_map_as_vector>
typedef std::list<node_t> mrpt::nav::TMoveTree< NODE_TYPE_DATA, EDGE_TYPE, MAPS_IMPLEMENTATION >::path_t

A topological path up-tree.

Definition at line 72 of file TMoveTree.h.

◆ TListEdges

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

Definition at line 61 of file CDirectedTree.h.

◆ TMapNode2ListEdges

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

Definition at line 62 of file CDirectedTree.h.

Member Function Documentation

◆ backtrackPath()

template<class NODE_TYPE_DATA , class EDGE_TYPE , class MAPS_IMPLEMENTATION = mrpt::utils::map_traits_map_as_vector>
void mrpt::nav::TMoveTree< NODE_TYPE_DATA, EDGE_TYPE, MAPS_IMPLEMENTATION >::backtrackPath ( const mrpt::utils::TNodeID  target_node,
path_t out_path 
) const
inline

Builds the path (sequence of nodes, with info about next edge) up-tree from a target_node towards the root Nodes are ordered in the direction ROOT -> start_node.

Definition at line 131 of file TMoveTree.h.

References INVALID_NODEID, mrpt::nav::TMoveTree< NODE_TYPE_DATA, EDGE_TYPE, MAPS_IMPLEMENTATION >::m_nodes, and mrpt::nav::TMoveTree< NODE_TYPE_DATA, EDGE_TYPE, MAPS_IMPLEMENTATION >::node_t::parent_id.

Referenced by mrpt::nav::PlannerRRT_SE2_TPS::solve().

◆ clear()

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

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

Definition at line 74 of file CDirectedTree.h.

References mrpt::graphs::CDirectedTree< TYPE_EDGES >::edges_to_children, INVALID_NODEID, and mrpt::graphs::CDirectedTree< TYPE_EDGES >::root.

◆ getAllNodes()

template<class NODE_TYPE_DATA , class EDGE_TYPE , class MAPS_IMPLEMENTATION = mrpt::utils::map_traits_map_as_vector>
const node_map_t& mrpt::nav::TMoveTree< NODE_TYPE_DATA, EDGE_TYPE, MAPS_IMPLEMENTATION >::getAllNodes ( ) const
inline

◆ getAsTextDescription()

std::string mrpt::graphs::CDirectedTree< EDGE_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 127 of file CDirectedTree.h.

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

◆ getNearestNode()

template<class NODE_TYPE_DATA , class EDGE_TYPE , class MAPS_IMPLEMENTATION = mrpt::utils::map_traits_map_as_vector>
template<class NODE_TYPE_FOR_METRIC >
mrpt::utils::TNodeID mrpt::nav::TMoveTree< NODE_TYPE_DATA, EDGE_TYPE, MAPS_IMPLEMENTATION >::getNearestNode ( const NODE_TYPE_FOR_METRIC &  query_pt,
const PoseDistanceMetric< NODE_TYPE_FOR_METRIC > &  distanceMetricEvaluator,
double *  out_distance = NULL,
const std::set< mrpt::utils::TNodeID > *  ignored_nodes = NULL 
) const
inline

Finds the nearest node to a given pose, using the given metric.

Definition at line 76 of file TMoveTree.h.

References ASSERT_, INVALID_NODEID, and mrpt::nav::TMoveTree< NODE_TYPE_DATA, EDGE_TYPE, MAPS_IMPLEMENTATION >::m_nodes.

Referenced by mrpt::nav::PlannerRRT_SE2_TPS::solve().

◆ getNextFreeNodeID()

template<class NODE_TYPE_DATA , class EDGE_TYPE , class MAPS_IMPLEMENTATION = mrpt::utils::map_traits_map_as_vector>
mrpt::utils::TNodeID mrpt::nav::TMoveTree< NODE_TYPE_DATA, EDGE_TYPE, MAPS_IMPLEMENTATION >::getNextFreeNodeID ( ) const
inline

◆ insertNode()

template<class NODE_TYPE_DATA , class EDGE_TYPE , class MAPS_IMPLEMENTATION = mrpt::utils::map_traits_map_as_vector>
void mrpt::nav::TMoveTree< NODE_TYPE_DATA, EDGE_TYPE, MAPS_IMPLEMENTATION >::insertNode ( const mrpt::utils::TNodeID  node_id,
const NODE_TYPE_DATA &  node_data 
)
inline

Insert a node without edges (should be used only for a tree root node)

Definition at line 119 of file TMoveTree.h.

References INVALID_NODEID, and mrpt::nav::TMoveTree< NODE_TYPE_DATA, EDGE_TYPE, MAPS_IMPLEMENTATION >::m_nodes.

Referenced by mrpt::nav::PlannerRRT_SE2_TPS::solve().

◆ insertNodeAndEdge()

template<class NODE_TYPE_DATA , class EDGE_TYPE , class MAPS_IMPLEMENTATION = mrpt::utils::map_traits_map_as_vector>
void mrpt::nav::TMoveTree< NODE_TYPE_DATA, EDGE_TYPE, MAPS_IMPLEMENTATION >::insertNodeAndEdge ( const mrpt::utils::TNodeID  parent_id,
const mrpt::utils::TNodeID  new_child_id,
const NODE_TYPE_DATA &  new_child_node_data,
const EDGE_TYPE &  new_edge_data 
)
inline

◆ visitBreadthFirst()

void mrpt::graphs::CDirectedTree< EDGE_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 105 of file CDirectedTree.h.

References mrpt::graphs::CDirectedTree< TYPE_EDGES >::edges_to_children, mrpt::graphs::CDirectedTree< TYPE_EDGES >::root, and mrpt::graphs::CDirectedTree< TYPE_EDGES >::visitDepthFirst().

◆ visitDepthFirst()

void mrpt::graphs::CDirectedTree< EDGE_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 91 of file CDirectedTree.h.

References mrpt::graphs::CDirectedTree< TYPE_EDGES >::edges_to_children, mrpt::graphs::CDirectedTree< TYPE_EDGES >::root, and mrpt::graphs::CDirectedTree< TYPE_EDGES >::visitDepthFirst().

Member Data Documentation

◆ edges_to_children

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

◆ m_nodes

template<class NODE_TYPE_DATA , class EDGE_TYPE , class MAPS_IMPLEMENTATION = mrpt::utils::map_traits_map_as_vector>
node_map_t mrpt::nav::TMoveTree< NODE_TYPE_DATA, EDGE_TYPE, MAPS_IMPLEMENTATION >::m_nodes
private

◆ root

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

The root of the tree.

Definition at line 66 of file CDirectedTree.h.




Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020