db_planner::DatabaseManager Class Reference

Pure virtual base class for interfacing GraspIt with an unspecified Grasp Database. More...

#include <db_manager.h>

Inheritance diagram for db_planner::DatabaseManager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual bool AcquireNextTask (TaskRecord *rec)=0
 Acquires the next experiment to be executed from the list of tasks in the database.
virtual bool AlignmentMethodList (vector< string > *alignment_method_list) const =0
 Returns a vector of strings representing the available precomputed alignment methods.
virtual bool DeleteGrasp (Grasp *grasp) const =0
 Delete a grasp from the database.
virtual bool DistanceFunctionList (vector< string > *distance_function_list) const =0
 Returns a vector of strings representing the available neighbor distance functions.
virtual bool GetAlignment (const Model &source, const Model &dest, const string &alignment_method_name, float alignment[16]) const =0
 Get the 4x4 alignment for 2 Models that are both in the database.
virtual bool GetGrasps (const Model &model, const string &hand_name, vector< Grasp * > *grasp_list) const =0
 Get a list of the Grasps for a Model.
virtual bool GetNeighbors (const Model &model, const string &distance_function_name, const int num_neighbors, vector< pair< Model *, double > > *neighbors) const =0
 Get the neighbors for a model from the database. Returns false if no neighbors are found.
virtual bool GetOptimizationTaskRecord (int, OptimizationTaskRecord *)
 Fills in the details for an optimzation task based on the task id.
virtual bool GetPlanningTaskRecord (int task_id, PlanningTaskRecord *rec)=0
 Fills in the details for a planning task based on the task id.
virtual bool GraspTypeList (vector< string > *type_list) const =0
 Returns a vector of strings representing the available grasp sources.
virtual bool InsertGraspPair (const Grasp *grasp1, const Grasp *grasp2) const =0
 Inserts into the database info that a pair of existing db grasps can be executed simultaneously.
virtual bool isConnected () const =0
 Returns true if the manager has successfully connected to the database.
virtual bool LoadModelGeometry (Model *) const =0
 Loads a model's geometry directly from the database.
virtual bool ModelList (vector< Model * > *model_list, FilterList::FilterType filter=FilterList::NONE) const =0
 Returns a vector with pointers to every Model in the database, possibly filtered.
virtual bool SaveAlignment (const Model &source, const Model &dest, const string &alignment_method_name, const float alignment[16]) const =0
 Save a 4x4 alignment into the database.
virtual bool SaveGrasp (const Grasp *) const =0
 Save a grasp into the database.
virtual bool SaveGrasps (const vector< Grasp * > graspList) const
 Save a list of Grasps into the database. Convenience function, just calls above version.
virtual bool SaveNeighbors (const Model &model, const string &distance_function_name, const vector< pair< Model *, double > > &neighbors) const =0
 Save the neighbors for a model into the database.
virtual bool SaveOptimizationResults (const OptimizationTaskRecord &, const std::vector< double > &, const std::vector< double > &)
 Saves the results of an optimization in the database.
virtual bool ScaledModel (Model *&model, int scaled_model_id) const =0
 Gets one individual model from the database based on scaled model id.
virtual void SetGraspAllocator (GraspAllocator *allocator)=0
 Sets a new grasp allocator.
virtual bool SetGraspClusterRep (Grasp *grasp, bool rep) const =0
 Sets the cluster_rep field of the grasp in the database.
virtual bool SetGraspTableClearance (Grasp *grasp, double clearance) const =0
 Sets the table_clearance field of the grasp in the database.
virtual void SetModelAllocator (ModelAllocator *allocator)=0
 Sets a new model allocator.
virtual bool SetTaskStatus (int task_id, const string &status)=0
 Change the status of a task in the database (e.g. mark it as COMPLETED).

Protected Attributes

GraspAllocatorgrasp_allocator_
 An object to allocate new Grasp's/.
ModelAllocatormodel_allocator_
 An object to allocate new Model's/.

Detailed Description

Pure virtual base class for interfacing GraspIt with an unspecified Grasp Database.

Definition at line 74 of file db_manager.h.


Member Function Documentation

virtual bool db_planner::DatabaseManager::AcquireNextTask ( TaskRecord rec  )  [pure virtual]

Acquires the next experiment to be executed from the list of tasks in the database.

Also marks it as RUNNING in an atomic fashion, so that it is not acquired by another process.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::AlignmentMethodList ( vector< string > *  alignment_method_list  )  const [pure virtual]

Returns a vector of strings representing the available precomputed alignment methods.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::DeleteGrasp ( Grasp grasp  )  const [pure virtual]

Delete a grasp from the database.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::DistanceFunctionList ( vector< string > *  distance_function_list  )  const [pure virtual]

Returns a vector of strings representing the available neighbor distance functions.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::GetAlignment ( const Model source,
const Model dest,
const string &  alignment_method_name,
float  alignment[16] 
) const [pure virtual]

Get the 4x4 alignment for 2 Models that are both in the database.

Returns false if either Model isn't in the database or if no alignment is found. Transforms are left-multiply and column major.

Implemented in db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::GetGrasps ( const Model model,
const string &  hand_name,
vector< Grasp * > *  grasp_list 
) const [pure virtual]

Get a list of the Grasps for a Model.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::GetNeighbors ( const Model model,
const string &  distance_function_name,
const int  num_neighbors,
vector< pair< Model *, double > > *  neighbors 
) const [pure virtual]

Get the neighbors for a model from the database. Returns false if no neighbors are found.

Note that num_neighbors is misleading; this will return up to 2 x num_neighbors models, since whenever possible it returns a model at the scale above and below the query model.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::GetOptimizationTaskRecord ( int  ,
OptimizationTaskRecord  
) [inline, virtual]

Fills in the details for an optimzation task based on the task id.

Reimplemented in db_planner::RosDatabaseManager.

Definition at line 133 of file db_manager.h.

virtual bool db_planner::DatabaseManager::GetPlanningTaskRecord ( int  task_id,
PlanningTaskRecord rec 
) [pure virtual]

Fills in the details for a planning task based on the task id.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::GraspTypeList ( vector< string > *  type_list  )  const [pure virtual]

Returns a vector of strings representing the available grasp sources.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::InsertGraspPair ( const Grasp grasp1,
const Grasp grasp2 
) const [pure virtual]

Inserts into the database info that a pair of existing db grasps can be executed simultaneously.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::isConnected (  )  const [pure virtual]

Returns true if the manager has successfully connected to the database.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::LoadModelGeometry ( Model  )  const [pure virtual]

Loads a model's geometry directly from the database.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::ModelList ( vector< Model * > *  model_list,
FilterList::FilterType  filter = FilterList::NONE 
) const [pure virtual]

Returns a vector with pointers to every Model in the database, possibly filtered.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::SaveAlignment ( const Model source,
const Model dest,
const string &  alignment_method_name,
const float  alignment[16] 
) const [pure virtual]

Save a 4x4 alignment into the database.

Transforms are left-multiply and column major.

Implemented in db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::SaveGrasp ( const Grasp  )  const [pure virtual]

Save a grasp into the database.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::SaveGrasps ( const vector< Grasp * >  graspList  )  const [inline, virtual]

Save a list of Grasps into the database. Convenience function, just calls above version.

Definition at line 142 of file db_manager.h.

virtual bool db_planner::DatabaseManager::SaveNeighbors ( const Model model,
const string &  distance_function_name,
const vector< pair< Model *, double > > &  neighbors 
) const [pure virtual]

Save the neighbors for a model into the database.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::SaveOptimizationResults ( const OptimizationTaskRecord ,
const std::vector< double > &  ,
const std::vector< double > &   
) [inline, virtual]

Saves the results of an optimization in the database.

Reimplemented in db_planner::RosDatabaseManager.

Definition at line 135 of file db_manager.h.

virtual bool db_planner::DatabaseManager::ScaledModel ( Model *&  model,
int  scaled_model_id 
) const [pure virtual]

Gets one individual model from the database based on scaled model id.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual void db_planner::DatabaseManager::SetGraspAllocator ( GraspAllocator allocator  )  [pure virtual]

Sets a new grasp allocator.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::SetGraspClusterRep ( Grasp grasp,
bool  rep 
) const [pure virtual]

Sets the cluster_rep field of the grasp in the database.

Note: this is an ugly way of updating the database. There should be a single function where a grasp is updated in the database. You check out a grasp from the dbase, do whatever you want with it and then call updateToDb or something.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::SetGraspTableClearance ( Grasp grasp,
double  clearance 
) const [pure virtual]

Sets the table_clearance field of the grasp in the database.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual void db_planner::DatabaseManager::SetModelAllocator ( ModelAllocator allocator  )  [pure virtual]

Sets a new model allocator.

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.

virtual bool db_planner::DatabaseManager::SetTaskStatus ( int  task_id,
const string &  status 
) [pure virtual]

Change the status of a task in the database (e.g. mark it as COMPLETED).

Implemented in db_planner::RosDatabaseManager, and db_planner::SqlDatabaseManager.


Member Data Documentation

An object to allocate new Grasp's/.

These will be derived Grasp types, but we will only know them as Grasp*'s.

Definition at line 82 of file db_manager.h.

An object to allocate new Model's/.

These will be derived Model types, but we will only know them as Model*'s.

Definition at line 79 of file db_manager.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


graspit
Author(s):
autogenerated on Wed Jan 25 11:00:32 2012