Class Thunder
Defined in File Thunder.h
Inheritance Relationships
Base Type
public ompl::tools::ExperienceSetup
(Class ExperienceSetup)
Class Documentation
-
class Thunder : public ompl::tools::ExperienceSetup
Built off of SimpleSetup but provides support for planning from experience.
Public Functions
-
explicit Thunder(const base::SpaceInformationPtr &si)
Constructor needs the state space used for planning.
-
explicit Thunder(const base::StateSpacePtr &space)
Constructor needs the state space used for planning.
- Parameters:
space – - the state space to plan in
-
virtual void printResultsInfo(std::ostream &out = std::cout) const override
Display debug data about potential available solutions.
-
virtual void printLogs(std::ostream &out = std::cout) const override
Display debug data about overall results from Thunder since being loaded.
-
inline ompl::base::PlannerPtr &getPlanner()
Get the current planner.
-
inline ompl::geometric::ThunderRetrieveRepair &getRetrieveRepairPlanner() const
Get a pointer to the retrieve repair planner.
-
inline virtual void setRepairPlanner(const base::PlannerPtr &planner) override
Set the planner to use for repairing experience paths inside the ThunderRetrieveRepair planner. If the planner is not set, a default planner is set.
-
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 default planner will be used if no planner is otherwise specified.
-
virtual base::PlannerStatus solve(double time = 1.0) override
Run the planner for up to a specified amount of time (default is 1 second)
-
virtual base::PlannerStatus solve(const base::PlannerTerminationCondition &ptc) override
Run the planner until ptc becomes true (at most)
-
virtual bool save() override
Save the experience database to file.
-
virtual bool saveIfChanged() override
Save the experience database to file if there has been a change.
-
virtual void clear() override
Clear all planning data. This only includes data generated by motion plan computation. Planner settings, start & goal states are not affected.
-
virtual void print(std::ostream &out = std::cout) const override
Print information about the current setup.
-
virtual void setup() override
This method will create the necessary classes for planning. The solve() method will call this function automatically.
-
virtual void getAllPlannerDatas(std::vector<ompl::base::PlannerDataPtr> &plannerDatas) const override
Get a vector of all the planning data in the database.
-
virtual std::size_t getExperiencesCount() const override
Get the total number of paths stored in the database.
-
void convertPlannerData(const ompl::base::PlannerDataPtr &plannerData, ompl::geometric::PathGeometric &path)
Convert PlannerData to PathGeometric. Assume ordering of vertices is order of path.
-
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.
- Parameters:
path – to test against
path – to reverse
- Returns:
true if reverse was necessary
-
ompl::tools::ThunderDBPtr getExperienceDB()
Hook for getting access to debug data.
-
virtual bool doPostProcessing() override
Allow accumlated experiences to be processed.
Protected Attributes
-
base::PlannerPtr rrPlanner_
The maintained experience planner instance
-
base::PlannerPtr planner2_
A third planner used for testing dual-thread scratch-only planning
-
bool dualThreadScratchEnabled_ = {true}
Flag indicating whether dual thread scratch planning is enabled
-
ompl::tools::ParallelPlanPtr pp_
Instance of parallel planning to use for computing solutions in parallel.
-
ompl::tools::ThunderDBPtr experienceDB_
A shared object between all the planners for saving and loading previous experience.
-
std::vector<ompl::geometric::PathGeometric> queuedSolutionPaths_
Accumulated experiences to be later added to experience database.
-
explicit Thunder(const base::SpaceInformationPtr &si)