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>

Public Member Functions

virtual void clear ()
 Clear the roadmap by deleting nodes and edges. More...
 
NodePtr_t addNode (const ConfigurationPtr_t &config)
 Add a node with given configuration. More...
 
NodePtr_t nearestNode (const ConfigurationPtr_t &configuration, value_type &minDistance)
 Get nearest node to a configuration in the roadmap. More...
 
NodePtr_t nearestNode (const ConfigurationPtr_t &configuration, const ConnectedComponentPtr_t &connectedComponent, value_type &minDistance)
 Get nearest node to a configuration in a connected component. More...
 
NodePtr_t addNodeAndEdges (const NodePtr_t from, const ConfigurationPtr_t &to, const PathPtr_t path)
 Add a node and two edges. More...
 
void addGoalNode (const ConfigurationPtr_t &config)
 Add a goal configuration. More...
 
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. More...
 
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. More...
 
std::ostream & print (std::ostream &os) const
 Print roadmap in a stream. More...
 
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. More...
 

Protected Member Functions

 Roadmap (const DistancePtr_t &distance, const DevicePtr_t &robot)
 Constructor. More...
 
void addConnectedComponent (const NodePtr_t &node)
 Add a new connected component in the roadmap. More...
 
bool canReach (const ConnectedComponentPtr_t &cc)
 Whether nodes of cc can be reached by nodes of this. More...
 
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". More...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ ~Roadmap()

virtual hpp::core::Roadmap::~Roadmap ( )
virtual

◆ Roadmap()

hpp::core::Roadmap::Roadmap ( const DistancePtr_t distance,
const DevicePtr_t robot 
)
protected

Constructor.

Parameters
distancedistance function for nearest neighbor computations

Member Function Documentation

◆ addConnectedComponent()

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.

◆ addEdge()

EdgePtr_t hpp::core::Roadmap::addEdge ( const NodePtr_t n1,
const NodePtr_t n2,
const PathPtr_t path 
)

Add an edge between two nodes.

◆ addGoalNode()

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.

◆ addNode()

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.

◆ addNodeAndEdges()

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.

◆ canReach()

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.

◆ clear()

virtual void hpp::core::Roadmap::clear ( )
virtual

Clear the roadmap by deleting nodes and edges.

◆ connectedComponents()

const ConnectedComponents_t& hpp::core::Roadmap::connectedComponents ( ) const

◆ create()

static RoadmapPtr_t hpp::core::Roadmap::create ( const DistancePtr_t distance,
const DevicePtr_t robot 
)
static

Return shared pointer to new instance.

◆ distance()

const DistancePtr_t& hpp::core::Roadmap::distance ( ) const

◆ edges()

const Edges_t& hpp::core::Roadmap::edges ( ) const
inline

◆ goalNodes()

const Nodes_t& hpp::core::Roadmap::goalNodes ( ) const
inline

◆ initNode() [1/2]

void hpp::core::Roadmap::initNode ( const ConfigurationPtr_t config)
inline

◆ initNode() [2/2]

NodePtr_t hpp::core::Roadmap::initNode ( ) const
inline

◆ nearestNode() [1/2]

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.

◆ nearestNode() [2/2]

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.

◆ nodes()

const Nodes_t& hpp::core::Roadmap::nodes ( ) const
inline

◆ pathExists()

bool hpp::core::Roadmap::pathExists ( ) const

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

◆ print()

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

Print roadmap in a stream.

◆ push_node()

virtual void hpp::core::Roadmap::push_node ( const NodePtr_t n)
inlineprotectedvirtual

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

References hpp::core::operator<<().

◆ resetGoalNodes()

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