Loading...
Searching...
No Matches
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.
virtual ~ThunderDB ()
 Deconstructor.
bool load (const std::string &fileName)
 Load database from file.
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.
bool saveIfChanged (const std::string &fileName)
 Save loaded database to file, except skips saving if no paths have been added.
bool save (const std::string &fileName)
 Save loaded database to file.
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.

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 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()

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

◆ 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()

int ompl::tools::ThunderDB::getNumPathsInserted ( ) const
inline

Get number of unsaved paths.

Definition at line 132 of file ThunderDB.h.

◆ getSavingEnabled()

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

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

void ompl::tools::ThunderDB::setSavingEnabled ( bool saving_enabled)
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_

int ompl::tools::ThunderDB::numPathsInserted_
protected

Definition at line 166 of file ThunderDB.h.

◆ plannerDataStorage_

ompl::base::PlannerDataStorage ompl::tools::ThunderDB::plannerDataStorage_
protected

Helper class for storing each plannerData instance.

Definition at line 163 of file ThunderDB.h.

◆ saving_enabled_

bool ompl::tools::ThunderDB::saving_enabled_
protected

Definition at line 172 of file ThunderDB.h.

◆ si_

base::SpaceInformationPtr ompl::tools::ThunderDB::si_
protected

The created space information.

Definition at line 160 of file ThunderDB.h.

◆ spars_

ompl::tools::SPARSdbPtr ompl::tools::ThunderDB::spars_
protected

Definition at line 169 of file ThunderDB.h.


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