hpp-core
4.9.0
Implement basic classes for canonical path planning for kinematic chains.
|
#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) |
NodePtr_t | addNode (const Configuration_t &config) |
NodePtr_t | nearestNode (const Configuration_t &configuration, value_type &minDistance, bool reverse=false) |
NodePtr_t | nearestNode (const ConfigurationPtr_t &configuration, value_type &minDistance, bool reverse=false) |
NodePtr_t | nearestNode (const Configuration_t &configuration, const ConnectedComponentPtr_t &connectedComponent, value_type &minDistance, bool reverse=false) |
NodePtr_t | nearestNode (const ConfigurationPtr_t &configuration, const ConnectedComponentPtr_t &connectedComponent, value_type &minDistance, bool reverse=false) |
Nodes_t | nearestNodes (const Configuration_t &configuration, size_type k) |
Nodes_t | nearestNodes (const ConfigurationPtr_t &configuration, size_type k) |
Nodes_t | nearestNodes (const Configuration_t &configuration, const ConnectedComponentPtr_t &connectedComponent, size_type k) |
Nodes_t | nearestNodes (const ConfigurationPtr_t &configuration, const ConnectedComponentPtr_t &connectedComponent, size_type k) |
NodePtr_t | addNodeAndEdges (const NodePtr_t from, const ConfigurationPtr_t &to, const PathPtr_t path) |
NodePtr_t | addNodeAndEdge (const NodePtr_t from, const ConfigurationPtr_t &to, const PathPtr_t path) |
NodePtr_t | addNodeAndEdge (const ConfigurationPtr_t &from, const NodePtr_t to, const PathPtr_t path) |
EdgePtr_t | addEdge (const NodePtr_t &n1, const NodePtr_t &n2, const PathPtr_t &path) |
Add an edge between two nodes. More... | |
void | addEdges (const NodePtr_t from, const NodePtr_t &to, const PathPtr_t &path) |
NodePtr_t | addGoalNode (const ConfigurationPtr_t &config) |
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_t & | nodes () const |
const Edges_t & | edges () const |
NodePtr_t | initNode () const |
const NodeVector_t & | goalNodes () const |
const ConnectedComponents_t & | connectedComponents () const |
Get list of connected component of the roadmap. More... | |
NearestNeighborPtr_t | nearestNeighbor () |
Get nearestNeighbor object. More... | |
void | nearestNeighbor (NearestNeighborPtr_t nearestNeighbor) |
Set new NearestNeighbor (roadmap must be empty) More... | |
std::ostream & | print (std::ostream &os) const |
Distance used for nearest neighbor search | |
Get distance function | |
const DistancePtr_t & | distance () 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) | |
void | addConnectedComponent (const NodePtr_t &node) |
virtual void | push_node (const NodePtr_t &n) |
virtual void | addEdge (const EdgePtr_t &e) |
virtual NodePtr_t | createNode (const ConfigurationPtr_t &configuration) const |
void | init (RoadmapWkPtr_t weak) |
Store weak pointer to itself. More... | |
Roadmap built by random path planning methods Nodes are configurations, paths are collision-free paths.
|
virtual |
|
protected |
Constructor
distance | distance function for nearest neighbor computations |
|
protected |
Add a new connected component in the roadmap.
node | node pointing to 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.
|
protectedvirtual |
Give child class the opportunity to get the event "An edge has been added to the roadmap"
void hpp::core::Roadmap::addEdges | ( | const NodePtr_t | from, |
const NodePtr_t & | to, | ||
const PathPtr_t & | path | ||
) |
Add two edges between two nodes
from | first node |
to | second node |
path | path going from from to to . the reverse edge is added with the reverse path. |
NodePtr_t hpp::core::Roadmap::addGoalNode | ( | const ConfigurationPtr_t & | config | ) |
Add a goal configuration
config | configuration 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
config | configuration |
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.
|
inline |
NodePtr_t hpp::core::Roadmap::addNodeAndEdge | ( | const NodePtr_t | from, |
const ConfigurationPtr_t & | to, | ||
const PathPtr_t | path | ||
) |
Add a node and one edge
from | node from which the edge starts, |
to | configuration to which the edge stops |
path | path between both configurations |
to
. Add the oriented edge (from -> to) from
. NodePtr_t hpp::core::Roadmap::addNodeAndEdge | ( | const ConfigurationPtr_t & | from, |
const NodePtr_t | to, | ||
const PathPtr_t | path | ||
) |
Add a node and one edge
from | configuration from which the edge starts, |
to | node to which the edge stops |
path | path between both configurations |
from
. Add the oriented edge (from -> to) to
. NodePtr_t hpp::core::Roadmap::addNodeAndEdges | ( | const NodePtr_t | from, |
const ConfigurationPtr_t & | to, | ||
const PathPtr_t | path | ||
) |
Add a node and two edges
from | node from which the edge starts, |
to | configuration to which the edge stops |
path | path between both configurations |
to
. Add the symmetric edge with reverse path. from
.
|
virtual |
Clear the roadmap by deleting nodes and edges.
const ConnectedComponents_t& hpp::core::Roadmap::connectedComponents | ( | ) | const |
Get list of connected component of the roadmap.
|
static |
Return shared pointer to new instance.
|
protectedvirtual |
const DistancePtr_t& hpp::core::Roadmap::distance | ( | ) | const |
|
inline |
|
inline |
|
protected |
Store weak pointer to itself.
|
inline |
|
inline |
NearestNeighborPtr_t hpp::core::Roadmap::nearestNeighbor | ( | ) |
Get nearestNeighbor object.
void hpp::core::Roadmap::nearestNeighbor | ( | NearestNeighborPtr_t | nearestNeighbor | ) |
Set new NearestNeighbor (roadmap must be empty)
NodePtr_t hpp::core::Roadmap::nearestNode | ( | const Configuration_t & | configuration, |
value_type & | minDistance, | ||
bool | reverse = false |
||
) |
Get nearest node to a configuration in the roadmap.
configuration | configuration |
reverse | if true, compute distance from given configuration to nodes in roadmap, if false from nodes in roadmap to given configuration |
distance | to the nearest node. |
|
inline |
NodePtr_t hpp::core::Roadmap::nearestNode | ( | const Configuration_t & | configuration, |
const ConnectedComponentPtr_t & | connectedComponent, | ||
value_type & | minDistance, | ||
bool | reverse = false |
||
) |
Get nearest node to a configuration in a connected component.
configuration | configuration |
connectedComponent | the connected component |
reverse | if true, compute distance from given configuration to nodes in roadmap, if false from nodes in roadmap to given configuration |
distance | to the nearest node. |
|
inline |
Nodes_t hpp::core::Roadmap::nearestNodes | ( | const Configuration_t & | configuration, |
size_type | k | ||
) |
Get nearest node to a configuration in the roadmap.
configuration | configuration |
k | number of nearest nodes to return if false from nodes in roadmap to given configuration |
|
inline |
Nodes_t hpp::core::Roadmap::nearestNodes | ( | const Configuration_t & | configuration, |
const ConnectedComponentPtr_t & | connectedComponent, | ||
size_type | k | ||
) |
Get nearest node to a configuration in a connected component.
configuration | configuration |
connectedComponent | the connected component |
k | number of nearest nodes to return if false from nodes in roadmap to given configuration |
|
inline |
|
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
|
inlineprotectedvirtual |
Give child class the opportunity to get the event "A node has been added to the roadmap"
|
inline |