Probabilistic RoadMap planner. More...
#include <BasicPRM.h>
Classes | |
class | Milestone |
Representation of a milestone. More... | |
Public Member Functions | |
BasicPRM (const base::SpaceInformationPtr &si) | |
Constructor. | |
virtual void | setProblemDefinition (const base::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(). | |
void | setMaxNearestNeighbors (unsigned int maxNearestNeighbors) |
Set the maximum number of neighbors for which a connection to will be attempted when a new milestone is added. | |
unsigned int | getMaxNearestNeighbors (void) const |
Get the maximum number of neighbors for which a connection will be attempted when a new milestone is added. | |
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 | growRoadmap (double growTime) |
If the user desires, the roadmap can be improved for a specified amount of time. The solve() method will also improve the roadmap, as needed. | |
virtual bool | 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 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. | |
virtual void | reconstructLastSolution (void) |
If the user desires to recompute the previously obtained solution, this function allows this functionality. | |
virtual void | clear (void) |
Clear all internal datastructures. Planner settings are not affected. Subsequent calls to solve() will ignore all previous work. | |
template<template< typename T > class NN> | |
void | setNearestNeighbors (void) |
Set a different nearest neighbors datastructure. | |
virtual void | setup (void) |
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. | |
Protected Member Functions | |
void | freeMemory (void) |
Free all the memory allocated by the planner. | |
virtual void | nearestNeighbors (Milestone *milestone, std::vector< Milestone * > &nbh) |
Get the list of nearest neighbors (nbh) for a given milestone (milestone) | |
Milestone * | addMilestone (base::State *state) |
Construct a milestone for a given state (state) and store it in the nearest neighbors data structure. | |
void | uniteComponents (Milestone *m1, Milestone *m2) |
Make two milestones (m1 and m2) be part of the same connected component. The component with fewer elements will get the id of the component with more elements. | |
void | growRoadmap (const std::vector< Milestone * > &start, const std::vector< Milestone * > &goal, const base::PlannerTerminationCondition &ptc, base::State *workState) |
Randomly sample the state space, add and connect milestones in the roadmap. Stop this process when the termination condition ptc returns true or when any of the start milestones are in the same connected component as any of the goal milestones. Use workState as temporary memory. | |
bool | haveSolution (const std::vector< Milestone * > &start, const std::vector< Milestone * > &goal, std::pair< Milestone *, Milestone * > *endpoints=NULL) |
Check if there exists a solution, i.e., there exists a pair of milestones such that the first is in start and the second is in goal, and the two milestones are in the same connected component. If endpoints is not null, that pair is recorded. | |
void | constructSolution (const Milestone *start, const Milestone *goal) |
Given two milestones from the same connected component, construct a path connecting them and set it as the solution. | |
double | distanceFunction (const Milestone *a, const Milestone *b) const |
Compute distance between two milestones (this is simply distance between the states of the milestones) | |
Protected Attributes | |
base::ValidStateSamplerPtr | sampler_ |
Sampler user for generating valid samples in the state space. | |
boost::shared_ptr < NearestNeighbors< Milestone * > > | nn_ |
Nearest neighbors data structure. | |
std::vector< Milestone * > | milestones_ |
Array of available milestones. | |
std::vector< Milestone * > | startM_ |
Array of start milestones. | |
std::vector< Milestone * > | goalM_ |
Array of goal milestones. | |
const Milestone * | lastStart_ |
constructSolution() will set this variable to be the milestone used as the start. This is useful if multiple solution paths are to be generated. | |
const Milestone * | lastGoal_ |
constructSolution() will set this variable to be the milestone used as the goal. This is useful if multiple solution paths are to be generated. | |
unsigned int | maxNearestNeighbors_ |
Maximum number of nearest neighbors to attempt to connect new milestones to. | |
std::map< unsigned long, unsigned long > | componentSizes_ |
Number of elements in each component. | |
unsigned long | componentCount_ |
The number of components that have been used at a point in time. There is no component with id larger than this value, but it is not necessary for all components with smaller id to exist (they could have been merged) | |
RNG | rng_ |
Random number generator. |
Probabilistic RoadMap planner.
Definition at line 78 of file BasicPRM.h.