Thunder.cpp
46 ompl::tools::Thunder::Thunder(const base::SpaceInformationPtr &si) : ompl::tools::ExperienceSetup(si)
51 ompl::tools::Thunder::Thunder(const base::StateSpacePtr &space) : ompl::tools::ExperienceSetup(space)
99 // Decide if we should setup the second planning from scratch planner for benchmarking w/o recall
133 throw Exception("Both planning from scratch and experience have been disabled, unable to plan");
194 ompl::base::PlannerStatus ompl::tools::Thunder::solve(const base::PlannerTerminationCondition &ptc)
196 // we provide a duplicate implementation here to allow the planner to choose how the time is turned into a planner
210 OMPL_WARN("Previous solved paths are currently uninserted into the experience database and are in the "
214 // There are two modes for running parallel plan - one in which both threads are run until they both return a result
221 // If \e hybridize is false, when the first solution is found, the rest of the planners are stopped as well.
229 OMPL_WARN("Thunder: not stopping until a solution or a failure is found from both threads. THIS MODE IS JUST "
232 // If \e hybridize is false, when \e minSolCount new solutions are found (added to the set of solutions
284 OMPL_INFORM("Solution path has %d states and was generated from planner %s", solutionPath.getStateCount(),
328 OMPL_INFORM("Adding path to database because SPARS will decide for us if we should keep the nodes");
464 out << " That were discarded: " << stats_.numSolutionsFromRecall_ - stats_.numSolutionsFromRecallSaved_
473 out << " Connected Components: " << experienceDB_->getSPARSdb()->getNumConnectedComponents() << std::endl;
475 out << " Consecutive state failures: " << experienceDB_->getSPARSdb()->getNumConsecutiveFailures() << std::endl;
476 out << " Connected path failures: " << experienceDB_->getSPARSdb()->getNumPathInsertionFailed() << std::endl;
477 out << " Sparse Delta Fraction: " << experienceDB_->getSPARSdb()->getSparseDeltaFraction() << std::endl;
487 void ompl::tools::Thunder::getAllPlannerDatas(std::vector<ob::PlannerDataPtr> &plannerDatas) const
492 void ompl::tools::Thunder::convertPlannerData(const ob::PlannerDataPtr &plannerData, og::PathGeometric &path)
499 bool ompl::tools::Thunder::reversePathIfNecessary(og::PathGeometric &path1, og::PathGeometric &path2)
bool doPostProcessing() override
Allow accumlated experiences to be processed.
Definition: Thunder.cpp:526
ompl::tools::ThunderDBPtr getExperienceDB()
Hook for getting access to debug data.
Definition: Thunder.cpp:521
void printLogs(std::ostream &out=std::cout) const override
Display debug data about overall results from Thunder since being loaded.
Definition: Thunder.cpp:452
Single entry for the csv data logging file.
Definition: ExperienceSetup.h:101
void log(const char *file, int line, LogLevel level, const char *m,...)
Root level logging function. This should not be invoked directly, but rather used via a logging macro...
Definition: Console.cpp:120
The planner failed to find a solution.
Definition: PlannerStatus.h:62
base::PlannerStatus solve(double time=1.0) override
Run the planner for up to a specified amount of time (default is 1 second)
Definition: Thunder.cpp:398
void convertPlannerData(const ompl::base::PlannerDataPtr &plannerData, ompl::geometric::PathGeometric &path)
Convert PlannerData to PathGeometric. Assume ordering of verticies is order of path.
Definition: Thunder.cpp:492
A shared pointer wrapper for ompl::base::StateSpace.
std::size_t getStateCount() const
Get the number of states (way-points) that make up this path.
Definition: PathGeometric.h:249
Encapsulate a termination condition for a motion planner. Planners will call operator() to decide whe...
Definition: PlannerTerminationCondition.h:63
bool reversePathIfNecessary(ompl::geometric::PathGeometric &path1, ompl::geometric::PathGeometric &path2)
If path1 and path2 have a better start/goal match when reverse, then reverse path2.
Definition: Thunder.cpp:499
base::State * getState(unsigned int index)
Get the state located at index along the path.
Definition: PathGeometric.h:237
Includes various tools such as self config, benchmarking, etc.
Definition: LightningRetrieveRepair.h:47
Thunder(const base::SpaceInformationPtr &si)
Constructor needs the state space used for planning.
Definition: Thunder.cpp:46
duration seconds(double sec)
Return the time duration representing a given number of seconds.
Definition: Time.h:76
void printResultsInfo(std::ostream &out=std::cout) const override
Display debug data about potential available solutions.
Definition: Thunder.cpp:416
void print(std::ostream &out=std::cout) const override
Print information about the current setup.
Definition: Thunder.cpp:426
void setup() override
This method will create the necessary classes for planning. The solve() method will call this functio...
Definition: Thunder.cpp:71
A class to store the exit status of Planner::solve()
Definition: PlannerStatus.h:48
bool saveIfChanged() override
Save the experience database to file if there has been a change.
Definition: Thunder.cpp:410
A shared pointer wrapper for ompl::base::SpaceInformation.
void setPlannerAllocator(const base::PlannerAllocator &pa)
Set the planner allocator to use. This is only used if no planner has been set. This is optional – a...
Definition: Thunder.cpp:186
This namespace contains sampling based planning routines shared by both planning under geometric cons...
Definition: Cost.h:44
void clear() override
Clear all planning data. This only includes data generated by motion plan computation. Planner settings, start & goal states are not affected.
Definition: Thunder.cpp:170
void getAllPlannerDatas(std::vector< ompl::base::PlannerDataPtr > &plannerDatas) const override
Get a vector of all the planning data in the database.
Definition: Thunder.cpp:487
std::function< PlannerPtr(const SpaceInformationPtr &)> PlannerAllocator
Definition of a function that can allocate a planner.
Definition: Planner.h:433
A shared pointer wrapper for ompl::base::PlannerData.
Create the set of classes typically needed to solve a geometric problem.
Definition: ExperienceSetup.h:56
This namespace contains code that is specific to planning under geometric constraints.
Definition: GeneticSearch.h:47
std::size_t getExperiencesCount() const override
Get the total number of paths stored in the database.
Definition: Thunder.cpp:482