KrisLibrary
1.0.0
|
A motion planner creator. More...
#include <AnyMotionPlanner.h>
Public Member Functions | |
virtual MotionPlannerInterface * | Create (const MotionPlanningProblem &problem) |
Make a motion planner for a given problem. | |
virtual MotionPlannerInterface * | Create (CSpace *space) |
Make a motion planner. | |
virtual MotionPlannerInterface * | Create (CSpace *space, const Config &a, const Config &b) |
Make a point-to-point motion planner (start is milestone 0 and goal is milestone 1) | |
virtual MotionPlannerInterface * | Create (CSpace *space, const Config &a, CSet *goalSet) |
Make a point-to-set motion planner. | |
virtual MotionPlannerInterface * | CreateRaw (CSpace *space) |
Helper: make a motion planner without shortcut / restart modifiers. | |
virtual MotionPlannerInterface * | ApplyModifiers (MotionPlannerInterface *, const MotionPlanningProblem &problem) |
Helper: apply shortcut / restart modifiers to a given planner interface, deleting the prior pointer if necessary. | |
bool | Load (TiXmlElement *e) |
Load settings from XML. | |
bool | Save (TiXmlElement *e) |
Save settings to XML. | |
bool | LoadJSON (const std::string &str) |
Load settings from JSON string. | |
std::string | SaveJSON () const |
Save settings to JSON string. | |
Public Attributes | |
std::string | type |
int | knn |
for PRM (default 10) | |
Real | connectionThreshold |
for PRM,RRT,SBL,SBLPRT,RRT*,PRM*,LazyPRM*,LazyRRG* (default Inf) | |
Real | suboptimalityFactor |
for RRT*, LazyPRM*, LazyRRG* (default 0) | |
bool | ignoreConnectedComponents |
Real | perturbationRadius |
for Perturbation,EST,RRT,SBL,SBLPRT (default 0.1) | |
int | perturbationIters |
for SBL (default 5) | |
bool | bidirectional |
for RRT (default true) | |
bool | useGrid |
for SBL, SBLPRT (default true): for SBL, uses grid-based random point selection | |
Real | gridResolution |
for SBL, SBLPRT, FMM, FMM* (default 0): if nonzero, for SBL, specifies point selection grid size (default 0.1), for FMM / FMM*, specifies resolution (default 1/8 of domain) | |
int | randomizeFrequency |
for SBL, SBLPRT (default 50): how often the grid projection is randomly perturbed | |
std::string | pointLocation |
for PRM, RRT*, PRM*, LazyPRM*, LazyRRG* (default ""): specifies a point location data structure ("random", "randombest [k]", "kdtree" supported) | |
bool | storeEdges |
true if local planner data is stored during planning (false may save memory, default) | |
bool | shortcut |
true if you wish to perform shortcutting afterwards (default false) | |
bool | restart |
true if you wish to restart the planner to get better paths with the remaining time (default false) | |
std::string | restartTermCond |
used if restart is true, JSON string defining termination condition (default "{foundSolution:1;maxIters:1000}") | |
A motion planner creator.
Standard usage is as follows:
Example (assuming you have a space, start, and goal):
* MotionPlanningFactory factory; * factory.type = "any"; //do more setup of parameters here * //an alternative way of setting up the parameters is as follows * //factory.LoadJSON("{ type:\"rrt\", perturbationRadius:0.5, shortcut:1, restart=1 }"); * MotionPlannerInterface* planner = factory.Create(space,start,goal); * * //set up a condition to plan for 10s * HaltingCondition cond; * cond.foundSolution=false; * cond.timeLimit = 10; * * //do the planning * MilestonePath path; * string res = planner->Plan(path,cond); * if(path.edges.empty()) //failed * LOG4CXX_INFO(KrisLibrary::logger(),"Planning failed\n"); * else * LOG4CXX_INFO(KrisLibrary::logger(),"Planning succeeded, path has length "<<path.Length()); * * //clean up the planner * delete planner; *
The type field can be left as "any", in which a default planning algorithm will be used. Otherwise, a given planner algorithm can be designated as follows:
If KrisLibrary is built with OMPL support, you can also use the type specifier "ompl:[X]" where [X] is one of:
Multi-query planners include PRM and SBLPRT.
The only cost function currently supported for optimal motion planners is the path length cost.
Standard kinematic planners (e.g., prm,lazyprm,perturbation,est,rrt,sbl, sblprt,fmm) can be adapted into to optimal planners either by a shortcutting technique – where the path is repeatedy shortened – or by a random-restart technique – in which the planner will repeatedly try to find a better solution. Specifically: