ompl::tools::ThunderDB Class Reference

Save and load entire paths from file. More...

#include <ompl/tools/thunder/ThunderDB.h>

Public Member Functions

 ThunderDB (const base::StateSpacePtr &space)
 Constructor needs the state space used for planning. More...
 
virtual ~ThunderDB ()
 Deconstructor.
 
bool load (const std::string &fileName)
 Load database from file. More...
 
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. More...
 
bool saveIfChanged (const std::string &fileName)
 Save loaded database to file, except skips saving if no paths have been added. More...
 
bool save (const std::string &fileName)
 Save loaded database to file. More...
 
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::SPARSdbPtrgetSPARSdb ()
 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.
 
void debugState (const ompl::base::State *state)
 
int getNumPathsInserted () const
 Get number of unsaved paths.
 
bool getSavingEnabled ()
 Getter for enabling experience database saving.
 
void setSavingEnabled (bool saving_enabled)
 Setter for enabling experience database saving.
 
bool isEmpty ()
 Check if anything has been loaded into DB. More...
 

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_
 

Detailed Description

Save and load entire paths from file.

Definition at line 134 of file ThunderDB.h.

Constructor & Destructor Documentation

◆ ThunderDB()

ompl::tools::ThunderDB::ThunderDB ( const base::StateSpacePtr &  space)

Constructor needs the state space used for planning.

Parameters
space- state space

Definition at line 48 of file ThunderDB.cpp.

Member Function Documentation

◆ addPath()

bool ompl::tools::ThunderDB::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
newpath - must be non-const because will be interpolated
returnedinsertion time to add to db
Returns
true on success

Definition at line 129 of file ThunderDB.cpp.

◆ isEmpty()

bool ompl::tools::ThunderDB::isEmpty ( )
inline

Check if anything has been loaded into DB.

Returns
true if has no nodes

Definition at line 217 of file ThunderDB.h.

◆ load()

bool ompl::tools::ThunderDB::load ( const std::string &  fileName)

Load database from file.

Parameters
fileName- name of database file
Returns
true if file loaded successfully

Definition at line 60 of file ThunderDB.cpp.

◆ save()

bool ompl::tools::ThunderDB::save ( const std::string &  fileName)

Save loaded database to file.

Parameters
fileName- name of database file
Returns
true if file saved successfully

Definition at line 174 of file ThunderDB.cpp.

◆ saveIfChanged()

bool ompl::tools::ThunderDB::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

Definition at line 165 of file ThunderDB.cpp.


The documentation for this class was generated from the following files: