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. More... | |
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. More... | |
void | setSPARSdb (ompl::tools::SPARSdbPtr &prm) |
Create the database structure for saving experiences. More... | |
ompl::tools::SPARSdbPtr & | getSPARSdb () |
Hook for debugging. More... | |
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. More... | |
void | debugVertex (const ompl::base::PlannerDataVertex &vertex) |
Print info to screen. More... | |
void | debugState (const ompl::base::State *state) |
int | getNumPathsInserted () const |
Get number of unsaved paths. More... | |
bool | getSavingEnabled () |
Getter for enabling experience database saving. More... | |
void | setSavingEnabled (bool saving_enabled) |
Setter for enabling experience database saving. More... | |
bool | isEmpty () |
Check if anything has been loaded into DB. More... | |
Protected Attributes | |
base::SpaceInformationPtr | si_ |
The created space information. More... | |
ompl::base::PlannerDataStorage | plannerDataStorage_ |
Helper class for storing each plannerData instance. More... | |
int | numPathsInserted_ |
ompl::tools::SPARSdbPtr | spars_ |
bool | saving_enabled_ |
Detailed Description
Save and load entire paths from file.
Definition at line 70 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.
◆ ~ThunderDB()
|
virtual |
Deconstructor.
Definition at line 54 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
-
new path - must be non-const because will be interpolated returned insertion time to add to db
- Returns
- true on success
Definition at line 129 of file ThunderDB.cpp.
◆ debugState()
void ompl::tools::ThunderDB::debugState | ( | const ompl::base::State * | state | ) |
Definition at line 301 of file ThunderDB.cpp.
◆ debugVertex()
void ompl::tools::ThunderDB::debugVertex | ( | const ompl::base::PlannerDataVertex & | vertex | ) |
Print info to screen.
Definition at line 296 of file ThunderDB.cpp.
◆ findNearestStartGoal()
bool ompl::tools::ThunderDB::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.
Definition at line 278 of file ThunderDB.cpp.
◆ getAllPlannerDatas()
void ompl::tools::ThunderDB::getAllPlannerDatas | ( | std::vector< ompl::base::PlannerDataPtr > & | plannerDatas | ) | const |
Get a vector of all the planner datas in the database.
Definition at line 263 of file ThunderDB.cpp.
◆ getNumPathsInserted()
|
inline |
Get number of unsaved paths.
Definition at line 132 of file ThunderDB.h.
◆ getSavingEnabled()
|
inline |
Getter for enabling experience database saving.
Definition at line 138 of file ThunderDB.h.
◆ getSPARSdb()
ompl::tools::SPARSdbPtr & ompl::tools::ThunderDB::getSPARSdb | ( | ) |
Hook for debugging.
Definition at line 258 of file ThunderDB.cpp.
◆ isEmpty()
|
inline |
Check if anything has been loaded into DB.
- Returns
- true if has no nodes
Definition at line 153 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.
◆ setSavingEnabled()
|
inline |
Setter for enabling experience database saving.
Definition at line 144 of file ThunderDB.h.
◆ setSPARSdb()
void ompl::tools::ThunderDB::setSPARSdb | ( | ompl::tools::SPARSdbPtr & | prm | ) |
Create the database structure for saving experiences.
Definition at line 250 of file ThunderDB.cpp.
Member Data Documentation
◆ numPathsInserted_
|
protected |
Definition at line 166 of file ThunderDB.h.
◆ plannerDataStorage_
|
protected |
Helper class for storing each plannerData instance.
Definition at line 163 of file ThunderDB.h.
◆ saving_enabled_
|
protected |
Definition at line 172 of file ThunderDB.h.
◆ si_
|
protected |
The created space information.
Definition at line 160 of file ThunderDB.h.
◆ spars_
|
protected |
Definition at line 169 of file ThunderDB.h.
The documentation for this class was generated from the following files:
- ompl/tools/thunder/ThunderDB.h
- ompl/tools/thunder/src/ThunderDB.cpp