Class ThunderDB
Defined in File ThunderDB.h
Class Documentation
-
class ThunderDB
Save and load entire paths from file.
Public Functions
-
ThunderDB(const base::StateSpacePtr &space)
Constructor needs the state space used for planning.
- Parameters:
space – - state space
-
virtual ~ThunderDB()
Deconstructor.
-
bool load(const std::string &fileName)
Load database from file.
- Parameters:
fileName – - name of database file
- Returns:
true if file loaded successfully
-
bool addPath(ompl::geometric::PathGeometric &solutionPath, double &insertionTime)
Add a new solution path to our database. Des not actually save to file so experience will be lost if save() is not called.
- Parameters:
new – path - must be non-const because will be interpolated
returned – insertion time to add to db
- Returns:
true on success
-
bool saveIfChanged(const std::string &fileName)
Save loaded database to file, except skips saving if no paths have been added.
- Parameters:
fileName – - name of database file
- Returns:
true if file saved successfully
-
bool save(const std::string &fileName)
Save loaded database to file.
- Parameters:
fileName – - name of database file
- Returns:
true if file saved successfully
-
void getAllPlannerDatas(std::vector<ompl::base::PlannerDataPtr> &plannerDatas) const
Get a vector of all the planner datas in the database.
-
void setSPARSdb(ompl::tools::SPARSdbPtr &prm)
Create the database structure for saving experiences.
-
ompl::tools::SPARSdbPtr &getSPARSdb()
Hook for debugging.
-
bool findNearestStartGoal(int nearestK, const base::State *start, const base::State *goal, ompl::geometric::SPARSdb::CandidateSolution &candidateSolution, const base::PlannerTerminationCondition &ptc)
Find the k nearest paths to our queries one.
-
void debugVertex(const ompl::base::PlannerDataVertex &vertex)
Print info to screen.
-
inline int getNumPathsInserted() const
Get number of unsaved paths.
-
inline bool getSavingEnabled()
Getter for enabling experience database saving.
-
inline void setSavingEnabled(bool saving_enabled)
Setter for enabling experience database saving.
-
inline bool isEmpty()
Check if anything has been loaded into DB.
- Returns:
true if has no nodes
Protected Attributes
-
base::SpaceInformationPtr si_
The created space information.
-
ompl::base::PlannerDataStorage plannerDataStorage_
Helper class for storing each plannerData instance.
-
int numPathsInserted_
-
ompl::tools::SPARSdbPtr spars_
-
bool saving_enabled_
-
ThunderDB(const base::StateSpacePtr &space)