Classes |
Public Types |
Public Member Functions |
Protected Member Functions |
Protected Attributes |
Static Protected Attributes
ompl::geometric::LazyPRM Class Reference
Lazy Probabilistic RoadMap planner. More...
#include <ompl/geometric/planners/prm/LazyPRM.h>
Inheritance diagram for ompl::geometric::LazyPRM:

Classes | |
struct | edge_flags_t |
struct | vertex_component_t |
struct | vertex_flags_t |
struct | vertex_state_t |
Public Types | |
typedef boost::adjacency_list_traits < boost::vecS, boost::listS, boost::undirectedS > ::vertex_descriptor | Vertex |
The type for a vertex in the roadmap. | |
typedef boost::adjacency_list < boost::vecS, boost::listS, boost::undirectedS, boost::property < vertex_state_t, base::State *, boost::property < boost::vertex_index_t, unsigned long int, boost::property < vertex_flags_t, unsigned int, boost::property < vertex_component_t, unsigned long int, boost::property < boost::vertex_predecessor_t, Vertex, boost::property < boost::vertex_rank_t, unsigned long int > > > > > >, boost::property < boost::edge_weight_t, base::Cost, boost::property < edge_flags_t, unsigned int > > > | Graph |
The underlying roadmap graph. | |
typedef boost::graph_traits < Graph >::edge_descriptor | Edge |
The type for an edge in the roadmap. | |
typedef boost::shared_ptr < NearestNeighbors< Vertex > > | RoadmapNeighbors |
A nearest neighbors data structure for roadmap vertices. | |
typedef boost::function< const std::vector< Vertex > &(const Vertex)> | ConnectionStrategy |
A function returning the milestones that should be attempted to connect to. | |
typedef boost::function< bool(const Vertex &, const Vertex &)> | ConnectionFilter |
A function that can reject connections. | |
Public Member Functions | |
LazyPRM (const base::SpaceInformationPtr &si, bool starStrategy=false) | |
Constructor. | |
void | setRange (double distance) |
Set the maximum length of a motion to be added to the roadmap. | |
double | getRange () const |
Get the range the planner is using. | |
template<template< typename T > class NN> | |
void | setNearestNeighbors () |
Set a different nearest neighbors datastructure. | |
virtual void | setProblemDefinition (const base::ProblemDefinitionPtr &pdef) |
void | setConnectionStrategy (const ConnectionStrategy &connectionStrategy) |
Set the connection strategy function that specifies the milestones that connection attempts will be make to for a given milestone. | |
void | setMaxNearestNeighbors (unsigned int k) |
Convenience function that sets the connection strategy to the default one with k nearest neighbors. | |
void | setConnectionFilter (const ConnectionFilter &connectionFilter) |
Set the function that can reject a milestone connection. | |
unsigned long int | milestoneCount () const |
Return the number of milestones currently in the graph. | |
unsigned long int | edgeCount () const |
Return the number of edges currently in the graph. | |
virtual void | getPlannerData (base::PlannerData &data) const |
Get information about the current run of the motion planner. Repeated calls to this function will update data (only additions are made). This is useful to see what changed in the exploration datastructure, between calls to solve(), for example (without calling clear() in between). | |
virtual void | setup () |
Perform extra configuration steps, if needed. This call will also issue a call to ompl::base::SpaceInformation::setup() if needed. This must be called before solving. | |
virtual void | clear () |
Clear all internal datastructures. Planner settings are not affected. Subsequent calls to solve() will ignore all previous work. | |
void | clearQuery () |
Clear the query previously loaded from the ProblemDefinition. Subsequent calls to solve() will reuse the previously computed roadmap, but will clear the set of input states constructed by the previous call to solve(). This enables multi-query functionality for LazyPRM. | |
virtual base::PlannerStatus | solve (const base::PlannerTerminationCondition &ptc) |
Function that can solve the motion planning problem. This function can be called multiple times on the same problem, without calling clear() in between. This allows the planner to continue work for more time on an unsolved problem, for example. If this option is used, it is assumed the problem definition is not changed (unpredictable results otherwise). The only change in the problem definition that is accounted for is the addition of starting or goal states (but not changing previously added start/goal states). The function terminates if the call to ptc returns true. | |
Protected Member Functions | |
std::string | getIterationCount () const |
std::string | getBestCost () const |
std::string | getMilestoneCountString () const |
std::string | getEdgeCountString () const |
void | freeMemory () |
Free all the memory allocated by the planner. | |
Vertex | addMilestone (base::State *state) |
Construct a milestone for a given state (state), store it in the nearest neighbors data structure and then connect it to the roadmap in accordance to the connection strategy. | |
void | uniteComponents (Vertex a, Vertex b) |
void | markComponent (Vertex v, unsigned long int newComponent) |
long int | solutionComponent (std::pair< std::size_t, std::size_t > *startGoalPair) const |
Check if any pair of a start state and goal state are part of the same connected component. If so, return the id of that component. Otherwise, return -1. | |
ompl::base::PathPtr | constructSolution (const Vertex &start, const Vertex &goal) |
Given two milestones from the same connected component, construct a path connecting them and set it as the solution. | |
double | distanceFunction (const Vertex a, const Vertex b) const |
Compute distance between two milestones (this is simply distance between the states of the milestones) | |
base::Cost | costHeuristic (Vertex u, Vertex v) const |
Given two vertices, returns a heuristic on the cost of the path connecting them. This method wraps OptimizationObjective::motionCostHeuristic. | |
Protected Attributes | |
bool | starStrategy_ |
Flag indicating whether the default connection strategy is the Star strategy. | |
ConnectionStrategy | connectionStrategy_ |
Function that returns the milestones to attempt connections with. | |
ConnectionFilter | connectionFilter_ |
Function that can reject a milestone connection. | |
bool | userSetConnectionStrategy_ |
Flag indicating whether the employed connection strategy was set by the user (or defaults are assumed) | |
double | maxDistance_ |
The maximum length of a motion to be added to a tree. | |
base::StateSamplerPtr | sampler_ |
Sampler user for generating random in the state space. | |
RoadmapNeighbors | nn_ |
Nearest neighbors data structure. | |
Graph | g_ |
Connectivity graph. | |
std::vector< Vertex > | startM_ |
Array of start milestones. | |
std::vector< Vertex > | goalM_ |
Array of goal milestones. | |
boost::property_map< Graph, boost::vertex_index_t >::type | indexProperty_ |
Access to the internal base::state at each Vertex. | |
boost::property_map< Graph, vertex_state_t >::type | stateProperty_ |
Access to the internal base::state at each Vertex. | |
boost::property_map< Graph, boost::edge_weight_t >::type | weightProperty_ |
Access to the weights of each Edge. | |
boost::property_map< Graph, vertex_component_t >::type | vertexComponentProperty_ |
Access the connected component of a vertex. | |
boost::property_map< Graph, vertex_flags_t >::type | vertexValidityProperty_ |
Access the validity state of a vertex. | |
boost::property_map< Graph, edge_flags_t >::type | edgeValidityProperty_ |
Access the validity state of an edge. | |
unsigned long int | componentCount_ |
Number of connected components created so far. This is used as an ID only, does not represent the actual number of components currently in the graph. | |
std::map< unsigned long int, unsigned long int > | componentSize_ |
The number of elements in each component in the LazyPRM roadmap. | |
base::OptimizationObjectivePtr | opt_ |
Objective cost function for PRM graph edges. | |
base::Cost | bestCost_ |
unsigned long int | iterations_ |
Static Protected Attributes | |
static const unsigned int | VALIDITY_UNKNOWN = 0 |
Flag indicating validity of an edge of a vertex. | |
static const unsigned int | VALIDITY_TRUE = 1 |
Flag indicating validity of an edge of a vertex. |
Detailed Description
Lazy Probabilistic RoadMap planner.
- Short description
- LazyPRM is a planner that constructs a roadmap of milestones that approximate the connectivity of the state space, just like PRM does. The difference is that the planner uses lazy collision checking.
- External documentation
- R. Bohlin and L.E. Kavraki Path Planning Using Lazy PRM IEEE International Conference on Robotics and Automation, San Francisco, pp. 521–528, 2000. DOI: [10.1109/ROBOT.2000.844107](http://dx.doi.org/10.1109/ROBOT.2000.844107)
[[more]](http://www.kavrakilab.org/robotics/lazyprm.html)
Member Typedef Documentation
typedef boost::function<bool(const Vertex&, const Vertex&)> ompl::geometric::LazyPRM::ConnectionFilter |
typedef boost::adjacency_list< boost::vecS, boost::listS, boost::undirectedS, boost::property < vertex_state_t, base::State*, boost::property < boost::vertex_index_t, unsigned long int, boost::property < vertex_flags_t, unsigned int, boost::property < vertex_component_t, unsigned long int, boost::property < boost::vertex_predecessor_t, Vertex, boost::property < boost::vertex_rank_t, unsigned long int > > > > > >, boost::property < boost::edge_weight_t, base::Cost, boost::property < edge_flags_t, unsigned int > > > ompl::geometric::LazyPRM::Graph |
The underlying roadmap graph.
- Any BGL graph representation could be used here. Because we
- expect the roadmap to be sparse (m<n^2), an adjacency_list is more appropriate than an adjacency_matrix. We use listS for the vertex list because vertex descriptors are invalidated by remove operations if using vecS.
- Obviously, a ompl::base::State* vertex property is required.
- The incremental connected components algorithm requires vertex_predecessor_t and vertex_rank_t properties. If boost::vecS is not used for vertex storage, then there must also be a boost:vertex_index_t property manually added.
- Edges should be undirected and have a weight property.
Member Function Documentation
void ompl::geometric::LazyPRM::setConnectionFilter | ( | const ConnectionFilter & | connectionFilter | ) | [inline] |
Set the function that can reject a milestone connection.
- The given function is called immediately before a connection
- is checked for collision and added to the roadmap. Other neighbors may have already been connected before this function is called. This allows certain heuristics that use the structure of the roadmap (like connected components or useful cycles) to be implemented by changing this function.
- Parameters:
-
connectionFilter A function that takes the new milestone, a neighboring milestone and returns whether a connection should be attempted.
void ompl::geometric::LazyPRM::setConnectionStrategy | ( | const ConnectionStrategy & | connectionStrategy | ) | [inline] |
Set the connection strategy function that specifies the milestones that connection attempts will be make to for a given milestone.
- The behavior and performance of PRM can be changed drastically
- by varying the number and properties if the milestones that are connected to each other.
- Parameters:
-
pdef A function that takes a milestone as an argument and returns a collection of other milestones to which a connection attempt must be made. The default connection strategy is to connect a milestone's 10 closest neighbors.
The documentation for this class was generated from the following files:
- ompl/geometric/planners/prm/LazyPRM.h
- ompl/geometric/planners/prm/src/LazyPRM.cpp