hpp::core::Roadmap Class Reference

Roadmap built by random path planning methods Nodes are configurations, paths are collision-free paths. More...

#include <hpp/core/roadmap.hh>

List of all members.

Public Member Functions

virtual void clear ()
 Clear the roadmap by deleting nodes and edges.
NodePtr_t addNode (const ConfigurationPtr_t &config)
 Add a node with given configuration.
NodePtr_t nearestNode (const ConfigurationPtr_t &configuration, value_type &minDistance)
 Get nearest node to a configuration in the roadmap.
NodePtr_t nearestNode (const ConfigurationPtr_t &configuration, const ConnectedComponentPtr_t &connectedComponent, value_type &minDistance)
 Get nearest node to a configuration in a connected component.
NodePtr_t addNodeAndEdges (const NodePtr_t from, const ConfigurationPtr_t &to, const PathPtr_t path)
 Add a node and two edges.
void addGoalNode (const ConfigurationPtr_t &config)
 Add a goal configuration.
void resetGoalNodes ()
void initNode (const ConfigurationPtr_t &config)
virtual ~Roadmap ()
bool pathExists () const
 Check that a path exists between the initial node and one goal node.
const Nodes_tnodes () const
const Edges_tedges () const
NodePtr_t initNode () const
const Nodes_tgoalNodes () const
const ConnectedComponents_tconnectedComponents () const
EdgePtr_t addEdge (const NodePtr_t &n1, const NodePtr_t &n2, const PathPtr_t &path)
 Add an edge between two nodes.
std::ostream & print (std::ostream &os) const
 Print roadmap in a stream.
Distance used for nearest neighbor search

Get distance function

const DistancePtr_tdistance () const

Static Public Member Functions

static RoadmapPtr_t create (const DistancePtr_t &distance, const DevicePtr_t &robot)
 Return shared pointer to new instance.

Protected Member Functions

 Roadmap (const DistancePtr_t &distance, const DevicePtr_t &robot)
 Constructor.
void addConnectedComponent (const NodePtr_t &node)
 Add a new connected component in the roadmap.
bool canReach (const ConnectedComponentPtr_t &cc)
 Whether nodes of cc can be reached by nodes of this.
virtual void push_node (const NodePtr_t &n)
 Give child class the opportunity to get the event "A node has been added to the roadmap".

Detailed Description

Roadmap built by random path planning methods Nodes are configurations, paths are collision-free paths.


Constructor & Destructor Documentation

virtual hpp::core::Roadmap::~Roadmap ( ) [virtual]
hpp::core::Roadmap::Roadmap ( const DistancePtr_t distance,
const DevicePtr_t robot 
) [protected]

Constructor.

Parameters:
distancedistance function for nearest neighbor computations

Member Function Documentation

void hpp::core::Roadmap::addConnectedComponent ( const NodePtr_t node) [protected]

Add a new connected component in the roadmap.

Parameters:
nodenode pointing to the connected component.
Note:
The node is added in the connected component.
EdgePtr_t hpp::core::Roadmap::addEdge ( const NodePtr_t n1,
const NodePtr_t n2,
const PathPtr_t path 
)

Add an edge between two nodes.

void hpp::core::Roadmap::addGoalNode ( const ConfigurationPtr_t config)

Add a goal configuration.

Parameters:
configconfiguration If configuration is already in the roadmap, tag corresponding node as goal node. Otherwise create a new node.
NodePtr_t hpp::core::Roadmap::addNode ( const ConfigurationPtr_t config)

Add a node with given configuration.

Parameters:
configconfiguration

If configuration is alread in the roadmap, return the node containing the configuration. Otherwise, create a new node and a new connected component with this node.

NodePtr_t hpp::core::Roadmap::addNodeAndEdges ( const NodePtr_t  from,
const ConfigurationPtr_t to,
const PathPtr_t  path 
)

Add a node and two edges.

Parameters:
fromnode from which the edge starts,
toconfiguration to which the edge stops
pathpath between both configurations
Returns:
node containing configuration to. Add the symmetric edge with reverse path.
Note:
this function simplifies the management of connected components since it adds the new node in the connected component of from.
bool hpp::core::Roadmap::canReach ( const ConnectedComponentPtr_t cc) [protected]

Whether nodes of cc can be reached by nodes of this.

Parameters:
cca connected component.
virtual void hpp::core::Roadmap::clear ( ) [virtual]

Clear the roadmap by deleting nodes and edges.

const ConnectedComponents_t& hpp::core::Roadmap::connectedComponents ( ) const
static RoadmapPtr_t hpp::core::Roadmap::create ( const DistancePtr_t distance,
const DevicePtr_t robot 
) [static]

Return shared pointer to new instance.

const DistancePtr_t& hpp::core::Roadmap::distance ( ) const
const Edges_t& hpp::core::Roadmap::edges ( ) const [inline]
const Nodes_t& hpp::core::Roadmap::goalNodes ( ) const [inline]
void hpp::core::Roadmap::initNode ( const ConfigurationPtr_t config) [inline]
NodePtr_t hpp::core::Roadmap::initNode ( ) const [inline]
NodePtr_t hpp::core::Roadmap::nearestNode ( const ConfigurationPtr_t configuration,
value_type minDistance 
)

Get nearest node to a configuration in the roadmap.

Parameters:
configurationconfiguration
Return values:
distanceto the nearest node.
NodePtr_t hpp::core::Roadmap::nearestNode ( const ConfigurationPtr_t configuration,
const ConnectedComponentPtr_t connectedComponent,
value_type minDistance 
)

Get nearest node to a configuration in a connected component.

Parameters:
configurationconfiguration
connectedComponentthe connected component
Return values:
distanceto the nearest node.
const Nodes_t& hpp::core::Roadmap::nodes ( ) const [inline]
bool hpp::core::Roadmap::pathExists ( ) const

Check that a path exists between the initial node and one goal node.

std::ostream& hpp::core::Roadmap::print ( std::ostream &  os) const

Print roadmap in a stream.

virtual void hpp::core::Roadmap::push_node ( const NodePtr_t n) [inline, protected, virtual]

Give child class the opportunity to get the event "A node has been added to the roadmap".

void hpp::core::Roadmap::resetGoalNodes ( ) [inline]