ompl::geometric::LazyPRMstar Class Reference

PRM* planner. More...

#include <ompl/geometric/planners/prm/LazyPRMstar.h>

Inheritance diagram for ompl::geometric::LazyPRMstar:

Public Member Functions

 LazyPRMstar (const base::SpaceInformationPtr &si)
 LazyPRMstar (const base::PlannerData &data)
- Public Member Functions inherited from ompl::geometric::LazyPRM
 LazyPRM (const base::SpaceInformationPtr &si, bool starStrategy=false)
 LazyPRM (const base::PlannerData &data, bool starStrategy=false)
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.
void setProblemDefinition (const base::ProblemDefinitionPtr &pdef) override
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. More...
void setDefaultConnectionStrategy ()
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. More...
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.
void getPlannerData (base::PlannerData &data) const override
 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).

void setup () override
 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.
void clear () override
 Clear all internal datastructures. Planner settings are not affected. Subsequent calls to solve() will ignore all previous work.
void clearQuery () override
 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.
void clearValidity ()
 change the validity flag of each node and edge to VALIDITY_UNKNOWN
base::PlannerStatus solve (const base::PlannerTerminationCondition &ptc) override
 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). If clearQuery() is called, the planner may retain prior datastructures generated from a previous query on a new problem definition. The function terminates if the call to ptc returns true.
- Public Member Functions inherited from ompl::base::Planner
 Planner (const Planner &)=delete
Planneroperator= (const Planner &)=delete
 Planner (SpaceInformationPtr si, std::string name)
virtual ~Planner ()=default
template<class T >
T * as ()
 Cast this instance to a desired type. More...
template<class T >
const T * as () const
 Cast this instance to a desired type. More...
const SpaceInformationPtrgetSpaceInformation () const
 Get the space information this planner is using.
const ProblemDefinitionPtrgetProblemDefinition () const
 Get the problem definition the planner is trying to solve.
ProblemDefinitionPtrgetProblemDefinition ()
 Get the problem definition the planner is trying to solve.
const PlannerInputStatesgetPlannerInputStates () const
 Get the planner input states.
virtual void setProblemDefinition (const ProblemDefinitionPtr &pdef)
 Set the problem definition for the planner. The problem needs to be set before calling solve(). Note: If this problem definition replaces a previous one, it may also be necessary to call clear() or clearQuery().
PlannerStatus solve (const PlannerTerminationConditionFn &ptc, double checkInterval)
 Same as above except the termination condition is only evaluated at a specified interval.
PlannerStatus solve (double solveTime)
 Same as above except the termination condition is solely a time limit: the number of seconds the algorithm is allowed to spend planning.
const std::string & getName () const
 Get the name of the planner.
void setName (const std::string &name)
 Set the name of the planner.
const PlannerSpecsgetSpecs () const
 Return the specifications (capabilities of this planner)
virtual void checkValidity ()
 Check to see if the planner is in a working state (setup has been called, a goal was set, the input states seem to be in order). In case of error, this function throws an exception.
bool isSetup () const
 Check if setup() was called for this planner.
ParamSetparams ()
 Get the parameters for this planner.
const ParamSetparams () const
 Get the parameters for this planner.
const PlannerProgressPropertiesgetPlannerProgressProperties () const
 Retrieve a planner's planner progress property map.
virtual void printProperties (std::ostream &out) const
 Print properties of the motion planner.
virtual void printSettings (std::ostream &out) const
 Print information about the motion planner's settings.

Additional Inherited Members

- Public Types inherited from ompl::geometric::LazyPRM
using Vertex = boost::adjacency_list_traits< boost::vecS, boost::listS, boost::undirectedS >::vertex_descriptor
 The type for a vertex in the roadmap.
using Graph = 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 > >>
 The underlying roadmap graph. More...
using Edge = boost::graph_traits< Graph >::edge_descriptor
 The type for an edge in the roadmap.
using RoadmapNeighbors = std::shared_ptr< NearestNeighbors< Vertex > >
 A nearest neighbors data structure for roadmap vertices.
using ConnectionStrategy = std::function< const std::vector< Vertex > &(const Vertex)>
 A function returning the milestones that should be attempted to connect to.
using ConnectionFilter = std::function< bool(const Vertex &, const Vertex &)>
 A function that can reject connections. More...
- Public Types inherited from ompl::base::Planner
using PlannerProgressProperty = std::function< std::string()>
 Definition of a function which returns a property about the planner's progress that can be queried by a benchmarking routine.
using PlannerProgressProperties = std::map< std::string, PlannerProgressProperty >
 A dictionary which maps the name of a progress property to the function to be used for querying that property.
- Protected Member Functions inherited from ompl::geometric::LazyPRM
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 Member Functions inherited from ompl::base::Planner
template<typename T , typename PlannerType , typename SetterType , typename GetterType >
void declareParam (const std::string &name, const PlannerType &planner, const SetterType &setter, const GetterType &getter, const std::string &rangeSuggestion="")
 This function declares a parameter for this planner instance, and specifies the setter and getter functions.
template<typename T , typename PlannerType , typename SetterType >
void declareParam (const std::string &name, const PlannerType &planner, const SetterType &setter, const std::string &rangeSuggestion="")
 This function declares a parameter for this planner instance, and specifies the setter function.
void addPlannerProgressProperty (const std::string &progressPropertyName, const PlannerProgressProperty &prop)
 Add a planner progress property called progressPropertyName with a property querying function prop to this planner's progress property map.
- Protected Attributes inherited from ompl::geometric::LazyPRM
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_ {false}
 Flag indicating whether the employed connection strategy was set by the user (or defaults are assumed)
double maxDistance_ {0.}
 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< VertexstartM_
 Array of start milestones.
std::vector< VertexgoalM_
 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_ {0}
 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_ {std::numeric_limits<double>::quiet_NaN()}
unsigned long int iterations_ {0}
- Protected Attributes inherited from ompl::base::Planner
SpaceInformationPtr si_
 The space information for which planning is done.
ProblemDefinitionPtr pdef_
 The user set problem definition.
PlannerInputStates pis_
 Utility class to extract valid input states

std::string name_
 The name of this planner.
PlannerSpecs specs_
 The specifications of the planner (its capabilities)
ParamSet params_
 A map from parameter names to parameter instances for this planner. This field is populated by the declareParam() function.
PlannerProgressProperties plannerProgressProperties_
 A mapping between this planner's progress property names and the functions used for querying those progress properties.
bool setup_
 Flag indicating whether setup() has been called.
- Static Protected Attributes inherited from ompl::geometric::LazyPRM
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

PRM* planner.

Run LazyPRM with the "star strategy". Instead of setting the value "k" for how many neighbors to connect, automatically compute it based on the coverage of the space, guaranteeing optimality of solutions.

Short description
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
S. Karaman and E. Frazzoli, Sampling-based Algorithms for Optimal Motion Planning, International Journal of Robotics Research, vol. 30, no.7, pp. 846-894, 2011. DOI: 10.1177/0278364911406761

Definition at line 130 of file LazyPRMstar.h.

The documentation for this class was generated from the following files: