Parasol Planning Library (PPL)
|
#include <BasicRRTStrategy.h>
Public Types | |
Motion Planning Types | |
typedef size_t | VID |
typedef std::unordered_set< VID > | VertexSet |
Public Types inherited from MPStrategyMethod | |
typedef size_t | VID |
Public Types inherited from MPBaseObject | |
typedef DefaultWeight< Cfg > | WeightType |
typedef GenericStateGraph< Cfg, WeightType > | RoadmapType |
typedef GroupCfg< RoadmapType > | GroupCfgType |
typedef GroupLocalPlan< RoadmapType > | GroupWeightType |
typedef GroupRoadmap< GroupCfgType, GroupWeightType > | GroupRoadmapType |
Public Member Functions | |
Construction | |
BasicRRTStrategy () | |
BasicRRTStrategy (XMLNode &_node) | |
virtual | ~BasicRRTStrategy () |
MPBaseObject overrides | |
virtual void | Print (std::ostream &_os) const |
Public Member Functions inherited from MPStrategyMethod | |
MPStrategyMethod ()=default | |
MPStrategyMethod (XMLNode &_node) | |
virtual | ~MPStrategyMethod () |
void | operator() () |
Execute the strategy by calling Initialize, Run, and Finalize. More... | |
void | EnableOutputFiles (const bool _enable=true) |
virtual void | Initialize () |
Public Member Functions inherited from MPBaseObject | |
MPBaseObject (const std::string &_label="", const std::string &_name="", bool _debug=false) | |
MPBaseObject (XMLNode &_node) | |
virtual | ~MPBaseObject () |
const std::string & | GetName () const |
Get the class name for this object. More... | |
const std::string & | GetLabel () const |
Get the unique label for this object. More... | |
std::string | GetNameAndLabel () const |
Get the unique string identifier for this object "m_name::m_label". More... | |
void | SetLabel (const std::string &) |
Set the unique label for this object. More... | |
void | SetMPLibrary (MPLibrary *) noexcept |
Set the owning MPLibrary. More... | |
MPLibrary * | GetMPLibrary () const noexcept |
Get the owning MPLibrary. More... | |
bool | IsRunning () const noexcept |
Check the library's running flag. More... | |
MPProblem * | GetMPProblem () const noexcept |
Get the library's current MPProblem. More... | |
Environment * | GetEnvironment () const noexcept |
Get the current environment. More... | |
MPTask * | GetTask () const noexcept |
Get the current task. More... | |
GroupTask * | GetGroupTask () const noexcept |
Get the current group task. More... | |
MPSolutionType * | GetMPSolution () const noexcept |
RoadmapType * | GetRoadmap (Robot *const _r=nullptr) const noexcept |
Get the current free-space roadmap. More... | |
GroupRoadmapType * | GetGroupRoadmap (RobotGroup *const _g=nullptr) const noexcept |
Get the current free-space group roadmap. More... | |
RoadmapType * | GetBlockRoadmap (Robot *const _r=nullptr) const noexcept |
Get the current obstacle-space roadmap. More... | |
Path * | GetPath (Robot *const _r=nullptr) const noexcept |
GroupPath * | GetGroupPath (RobotGroup *const _g=nullptr) const noexcept |
Get the current best group path. More... | |
StatClass * | GetStatClass () const noexcept |
Get the current StatClass. More... | |
LocalObstacleMap * | GetLocalObstacleMap () const noexcept |
Get the local obstacle map. More... | |
Protected Member Functions | |
MPStrategy Overrides | |
virtual void | Initialize () override |
virtual void | Iterate () override |
Execute one iteration of the strategy. More... | |
Direction Helpers | |
virtual Cfg | SelectTarget () |
Get a random configuration to grow towards. More... | |
Cfg | SelectDispersedTarget (const VID _v) |
Neighbor Helpers | |
virtual VID | FindNearestNeighbor (const Cfg &_cfg, const VertexSet *const _candidates=nullptr) |
virtual Neighbor | SelectNeighbor (const Cfg &_cfg, const std::vector< Neighbor > &_neighbors) |
Growth Helpers | |
virtual VID | Extend (const VID _nearVID, const Cfg &_target, LPOutput &_lp, const bool _requireNew=true) |
VID | Extend (const VID _nearVID, const Cfg &_target, const bool _requireNew=true) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
virtual std::pair< VID, bool > | AddNode (const Cfg &_newCfg) |
virtual void | AddEdge (const VID _source, const VID _target, const LPOutput &_lpOutput) |
void | ConnectNeighbors (const VID _newVID) |
void | TryGoalExtension (const VID _newVID) |
void | TryGoalExtension (const VID _newVID, const Boundary *const _boundary) |
Tree Helpers | |
VID | ExpandTree (const Cfg &_target) |
virtual VID | ExpandTree (const VID _nearestVID, const Cfg &_target) |
void | ConnectTrees (const VID _recentlyGrown) |
Protected Member Functions inherited from MPStrategyMethod | |
virtual void | Run () |
Call Iterate until EvaluateMap is true. More... | |
virtual bool | EvaluateMap () |
Check if we satisfied all map evaluators. More... | |
virtual void | Finalize () |
Clean-up and output results. More... | |
virtual void | ClearRoadmap () |
Pre-clear the roadmap(s) if requested. More... | |
virtual size_t | GenerateStart (const std::string &_samplerLabel="") |
virtual std::vector< size_t > | GenerateGoals (const std::string &_samplerLabel="") |
Protected Member Functions inherited from MPBaseObject | |
void | SetName (const std::string &_s) |
const std::string & | GetBaseFilename () const |
Protected Attributes | |
MP Object Labels | |
std::string | m_samplerLabel |
The sampler label. More... | |
std::string | m_nfLabel |
The neighborhood finder label. More... | |
std::string | m_ncLabel |
The connector label (for RRG). More... | |
std::string | m_exLabel |
The extender label. More... | |
std::string | m_goalDmLabel |
Dm for checking goal extensions. More... | |
std::string | m_fallbackNfLabel |
NF for searching the active set, used if the main one fails. More... | |
RRT Properties | |
bool | m_growGoals {false} |
Grow trees from goals. More... | |
double | m_growthFocus {0} |
The fraction of goal-biased expansions. More... | |
double | m_goalThreshold {0} |
Distance threshold for goal extension. More... | |
size_t | m_numDirections {1} |
Expansion directions per iteration. More... | |
size_t | m_disperseTrials {3} |
Sample attempts for disperse search. More... | |
Internal State | |
std::vector< VertexSet > | m_trees |
The current tree set. More... | |
Protected Attributes inherited from MPStrategyMethod | |
std::string | m_querySampler |
Sampler for generating start/goal. More... | |
std::vector< std::string > | m_meLabels |
The list of map evaluators to use. More... | |
size_t | m_iterations {0} |
The number of executed iterations. More... | |
bool | m_writeOutput {true} |
Write output at the end? More... | |
bool | m_clearMap {false} |
Clear the roadmap(s) before run? More... | |
Protected Attributes inherited from MPBaseObject | |
bool | m_debug |
Print debug info? More... | |
The RRT algorithm grows one or more trees from a set of root nodes to solve a single-query planning problem.
References: Original RRT: LaValle, Steven M. "Rapidly-Exploring Random Trees: A New Tool for Path Planning." TR 98-11, Computer Science Dept., Iowa State Univ., 1998. RRT Connect (bi-directional): James Kuffner and Steven LaValle. "RRT-Connect: An Efficient Approach to Single-Query Path Planning". ICRA 2000. Nonholonomic RRT: Steven LaValle and James Kuffner. "Randomized Kinodynamic Planning." IJRR 2001.
This method supports both uni-directional and bi-directional variants. Nonholonomic problems are supported with the appropriate extender and uni-directional growth.
For uni-directional methods, we support an additional 'goal extension' heuristic which attempts to connect configurations near the goal to the goal region. This is necessary to get RRT to terminate - the alternative is to rely on goal-biased sampling to eventually complete the problem, which is not an efficient solution.
For bi-directional methods, the algorithm will attempt to connect trees after each successful extension. The new node will be extended toward the nearest neighbor in each other tree. If the extension reaches its destination, the two trees will merge.
typedef std::unordered_set<VID> BasicRRTStrategy::VertexSet |
typedef size_t BasicRRTStrategy::VID |
BasicRRTStrategy::BasicRRTStrategy | ( | ) |
BasicRRTStrategy::BasicRRTStrategy | ( | XMLNode & | _node | ) |
|
virtual |
|
protectedvirtual |
Add a new edge to the roadmap.
_source | The source node. |
_target | The target node. |
_lpOutput | The extender output. |
Reimplemented in Syclop.
|
protectedvirtual |
Add a new configuration to the roadmap and current tree.
_newCfg | The new configuration to add. |
Reimplemented in Syclop, and DynamicRegionRRT.
|
protected |
Try to connect a configuration to its neighbors.
_newVID | The VID of the configuration to connect. |
|
protected |
If multiple trees exist, try to connect the current tree with the one that is nearest to a recently grown configuration.
_recentlyGrown | The VID of the recently grown configuration. |
|
protected |
Attempt to expand the map by growing towards a target configuration from the nearest existing node.
_target | The target configuration. |
|
protectedvirtual |
Attempt to expand the map by growing towards a target configuration from an arbitrary existing node.
_nearestVID | The VID to grow from. |
_target | The target configuration. |
Reimplemented in EET, and DynamicDomainRRT.
|
protected |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
protectedvirtual |
Extend a new configuration from a nearby configuration towards a growth target.
_nearVID | The nearby configuration's VID. |
_target | The growth target. |
_lp | An LPOutput for returning local planner info. |
_requireNew | Require the extension to generate a new roadmap node (true unless connecting trees). |
Reimplemented in Syclop, and DynamicDomainRRT.
|
protectedvirtual |
Find the nearest roadmap configuration to an arbitrary configuration.
_cfg | The query configuration. |
_candidates | The candidate set to search, or null for whole roadmap. |
Reimplemented in Syclop.
|
overrideprotectedvirtual |
Initialize this object for the current MPProblem. This should reset any internal state of the algorithms so that they are ready for execution. It is also the place to initialize any state that depends on the current problem.
Reimplemented from MPBaseObject.
Reimplemented in Syclop, EET, DynamicRegionRRT, DynamicDomainRRT, and AdaptiveRRT.
|
overrideprotectedvirtual |
|
virtual |
Print internal state of this object.
_os | The std::ostream to print to. |
Reimplemented from MPStrategyMethod.
Reimplemented in DynamicRegionRRT, DynamicDomainRRT, and AdaptiveRRT.
Sample a target configuration to grow towards from an existing configuration. m_disperseTrials samples are attempted.
_v | The VID of the existing configuration. |
|
protectedvirtual |
Select the best neighbor from the set of candidates returned by the NF. Default implementation selects the nearest.
_cfg | The query configuration. |
_neighbors | The set of neighbors returned by the NF. |
|
protectedvirtual |
Get a random configuration to grow towards.
Reimplemented in EET, and DynamicRegionRRT.
|
protected |
Try to extend a new configuration toward each goal region that is within the extender's range.
_newVID | The VID of a newly extended configuration. |
|
protected |
Try to extend a new configuration toward a specific goal region. No-op if the goal is outside the extender's range.
_newVID | The VID of a newly extended configuration. |
_boundary | The goal boundary. |
|
protected |
Sample attempts for disperse search.
|
protected |
The extender label.
|
protected |
NF for searching the active set, used if the main one fails.
|
protected |
Dm for checking goal extensions.
|
protected |
Distance threshold for goal extension.
|
protected |
Grow trees from goals.
|
protected |
The fraction of goal-biased expansions.
|
protected |
The connector label (for RRG).
|
protected |
The neighborhood finder label.
|
protected |
Expansion directions per iteration.
|
protected |
The sampler label.
|
protected |
The current tree set.