Class Lightning
Defined in File Lightning.h
Inheritance Relationships
Base Type
public ompl::tools::ExperienceSetup
(Class ExperienceSetup)
Class Documentation
-
class Lightning : public ompl::tools::ExperienceSetup
Built off of SimpleSetup but provides support for planning from experience.
Public Functions
-
explicit Lightning(const base::SpaceInformationPtr &si)
Constructor needs the state space used for planning.
-
explicit Lightning(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 Lightning since being loaded.
-
inline ompl::geometric::LightningRetrieveRepair &getLightningRetrieveRepairPlanner() 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 LightningRetrieveRepair planner. If the planner is not set, a default planner is set.
-
inline 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.
- Parameters:
PlannerData –
PathGeometric –
-
inline const ompl::tools::DynamicTimeWarpPtr &getDynamicTimeWarp() const
Tool for comparing two paths and scoring them.
Protected Functions
-
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
Protected Attributes
-
base::PlannerPtr rrPlanner_
The maintained experience planner instance.
-
ompl::tools::ParallelPlanPtr pp_
Instance of parallel planning to use for computing solutions in parallel.
-
ompl::tools::LightningDBPtr experienceDB_
A shared object between all the planners for saving and loading previous experience.
-
ompl::tools::DynamicTimeWarpPtr dtw_
Tool for comparing two paths and scoring them.
-
explicit Lightning(const base::SpaceInformationPtr &si)