A slight specialization of the general database interface with a few convenience functions added. More...
#include <objects_database.h>
Public Member Functions | |
virtual bool | acquireNextTask (std::vector< boost::shared_ptr< DatabaseTask > > &task) |
Acquires the next experiment to be executed from the list of tasks in the database. | |
bool | getAllPerturbationsForModel (int scaled_model_id, std::vector< DatabasePerturbationPtr > &perturbations) |
Gets the perturbations for all grasps for a given scaled model. | |
bool | getClusterRepGrasps (int scaled_model_id, std::string hand_name, std::vector< boost::shared_ptr< DatabaseGrasp > > &grasps) const |
Gets the list of only those grasps that are cluster reps a database model. | |
bool | getGrasps (int scaled_model_id, std::string hand_name, std::vector< boost::shared_ptr< DatabaseGrasp > > &grasps) const |
Gets the list of all the grasps for a scaled model id. | |
bool | getModelPathFromViewId (boost::shared_ptr< DatabaseView > &view, std::string &path) |
bool | getModelRoot (std::string &root) const |
Returns the path that geometry paths are relative to. | |
bool | getModelScale (boost::shared_ptr< DatabaseView > &view, double *scale_factor) |
bool | getModelScaleFromId (int scaled_model_id, boost::shared_ptr< DatabaseScaledModel > &scale_model) |
bool | getModelScans (int scaled_model_id, std::string source, std::vector< household_objects_database_msgs::DatabaseScan > &matching_scan_list) const |
bool | getModelsListByTags (std::vector< boost::shared_ptr< DatabaseOriginalModel > > &models, std::vector< std::string > tags) const |
Gets a list of all models with the requested tags in the database. | |
bool | getNumOriginalModels (int &num_models) const |
Returns the number of original models in the database. | |
bool | getOrientationRollFromVFHId (int vfh_id, boost::shared_ptr< DatabaseVFHOrientation > &roll_histogram) |
bool | getOrientationRollFromVFHThroughViewId (int vfh_id, boost::shared_ptr< DatabaseVFHOrientation > &roll_histogram) |
bool | getOriginalModelsList (std::vector< boost::shared_ptr< DatabaseOriginalModel > > &models) const |
Gets a list of all the original models in the database. | |
bool | getPerturbationsForGrasps (const std::vector< int > &grasp_ids, std::vector< DatabasePerturbationPtr > &perturbations) |
bool | getScaledModelMesh (int scaled_model_id, geometric_shapes_msgs::Shape &shape) const |
Gets the mesh for a scaled model as a geometric_shapes_msgs::Shape. | |
bool | getScaledModelMesh (int scaled_model_id, DatabaseMesh &mesh) const |
Gets the mesh for a scaled model. | |
bool | getScaledModelsByAcquisition (std::vector< boost::shared_ptr< DatabaseScaledModel > > &models, std::string acquisition_method) const |
Gets a list of scaled models based on acquisition method. | |
virtual bool | getScaledModelsBySet (std::vector< boost::shared_ptr< DatabaseScaledModel > > &models, std::string model_set_name) const |
bool | getScaledModelsList (std::vector< boost::shared_ptr< DatabaseScaledModel > > &models) const |
Gets a list of all the scaled models in the database. | |
bool | getVFHDescriptors (std::vector< boost::shared_ptr< DatabaseVFH > > &vfh) |
bool | getVFHFromView (boost::shared_ptr< DatabaseVFH > &vfh, boost::shared_ptr< household_objects_database::DatabaseView > &view) |
bool | getViewFromVFHId (int vfh_id, boost::shared_ptr< DatabaseView > &view) |
bool | getViewFromVFHIdNoData (int vfh_id, boost::shared_ptr< DatabaseView > &view) |
bool | getViewFromViewIdNoData (int view_id, boost::shared_ptr< DatabaseView > &view) |
bool | getViewsFromScaledModelId (int scaled_model_id, int iteration, std::vector< boost::shared_ptr< DatabaseView > > &views) |
ObjectsDatabase (const database_interface::PostgresqlDatabaseConfig &config) | |
Attempts to connect to the specified database. | |
ObjectsDatabase (std::string host, std::string port, std::string user, std::string password, std::string dbname) | |
Attempts to connect to the specified database. | |
~ObjectsDatabase () | |
Just a stub for now. |
A slight specialization of the general database interface with a few convenience functions added.
Definition at line 71 of file objects_database.h.
household_objects_database::ObjectsDatabase::ObjectsDatabase | ( | std::string | host, | |
std::string | port, | |||
std::string | user, | |||
std::string | password, | |||
std::string | dbname | |||
) | [inline] |
Attempts to connect to the specified database.
Definition at line 75 of file objects_database.h.
household_objects_database::ObjectsDatabase::ObjectsDatabase | ( | const database_interface::PostgresqlDatabaseConfig & | config | ) | [inline] |
Attempts to connect to the specified database.
Definition at line 81 of file objects_database.h.
household_objects_database::ObjectsDatabase::~ObjectsDatabase | ( | ) | [inline] |
Just a stub for now.
Definition at line 87 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::acquireNextTask | ( | std::vector< boost::shared_ptr< DatabaseTask > > & | task | ) | [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.
Definition at line 47 of file objects_database.cpp.
bool household_objects_database::ObjectsDatabase::getAllPerturbationsForModel | ( | int | scaled_model_id, | |
std::vector< DatabasePerturbationPtr > & | perturbations | |||
) | [inline] |
Gets the perturbations for all grasps for a given scaled model.
These two functions use the ANY(ARRAY[ids]) syntax because those were the most performant in speed tests.
Definition at line 273 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getClusterRepGrasps | ( | int | scaled_model_id, | |
std::string | hand_name, | |||
std::vector< boost::shared_ptr< DatabaseGrasp > > & | grasps | |||
) | const [inline] |
Gets the list of only those grasps that are cluster reps a database model.
Definition at line 183 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getGrasps | ( | int | scaled_model_id, | |
std::string | hand_name, | |||
std::vector< boost::shared_ptr< DatabaseGrasp > > & | grasps | |||
) | const [inline] |
Gets the list of all the grasps for a scaled model id.
Definition at line 172 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getModelPathFromViewId | ( | boost::shared_ptr< DatabaseView > & | view, | |
std::string & | path | |||
) | [inline] |
Definition at line 468 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getModelRoot | ( | std::string & | root | ) | const [inline] |
Returns the path that geometry paths are relative to.
Definition at line 149 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getModelScale | ( | boost::shared_ptr< DatabaseView > & | view, | |
double * | scale_factor | |||
) | [inline] |
Definition at line 486 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getModelScaleFromId | ( | int | scaled_model_id, | |
boost::shared_ptr< DatabaseScaledModel > & | scale_model | |||
) | [inline] |
Definition at line 454 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getModelScans | ( | int | scaled_model_id, | |
std::string | source, | |||
std::vector< household_objects_database_msgs::DatabaseScan > & | matching_scan_list | |||
) | const [inline] |
Definition at line 242 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getModelsListByTags | ( | std::vector< boost::shared_ptr< DatabaseOriginalModel > > & | models, | |
std::vector< std::string > | tags | |||
) | const [inline] |
Gets a list of all models with the requested tags in the database.
Definition at line 156 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getNumOriginalModels | ( | int & | num_models | ) | const [inline] |
Returns the number of original models in the database.
Definition at line 141 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getOrientationRollFromVFHId | ( | int | vfh_id, | |
boost::shared_ptr< DatabaseVFHOrientation > & | roll_histogram | |||
) | [inline] |
Definition at line 385 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getOrientationRollFromVFHThroughViewId | ( | int | vfh_id, | |
boost::shared_ptr< DatabaseVFHOrientation > & | roll_histogram | |||
) | [inline] |
Definition at line 423 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getOriginalModelsList | ( | std::vector< boost::shared_ptr< DatabaseOriginalModel > > & | models | ) | const [inline] |
Gets a list of all the original models in the database.
Definition at line 102 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getPerturbationsForGrasps | ( | const std::vector< int > & | grasp_ids, | |
std::vector< DatabasePerturbationPtr > & | perturbations | |||
) | [inline] |
Definition at line 282 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getScaledModelMesh | ( | int | scaled_model_id, | |
geometric_shapes_msgs::Shape & | shape | |||
) | const [inline] |
Gets the mesh for a scaled model as a geometric_shapes_msgs::Shape.
Definition at line 218 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getScaledModelMesh | ( | int | scaled_model_id, | |
DatabaseMesh & | mesh | |||
) | const [inline] |
Gets the mesh for a scaled model.
Definition at line 196 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getScaledModelsByAcquisition | ( | std::vector< boost::shared_ptr< DatabaseScaledModel > > & | models, | |
std::string | acquisition_method | |||
) | const [inline] |
Gets a list of scaled models based on acquisition method.
Definition at line 118 of file objects_database.h.
virtual bool household_objects_database::ObjectsDatabase::getScaledModelsBySet | ( | std::vector< boost::shared_ptr< DatabaseScaledModel > > & | models, | |
std::string | model_set_name | |||
) | const [inline, virtual] |
Definition at line 129 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getScaledModelsList | ( | std::vector< boost::shared_ptr< DatabaseScaledModel > > & | models | ) | const [inline] |
Gets a list of all the scaled models in the database.
Definition at line 110 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getVFHDescriptors | ( | std::vector< boost::shared_ptr< DatabaseVFH > > & | vfh | ) | [inline] |
Definition at line 297 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getVFHFromView | ( | boost::shared_ptr< DatabaseVFH > & | vfh, | |
boost::shared_ptr< household_objects_database::DatabaseView > & | view | |||
) | [inline] |
Definition at line 367 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getViewFromVFHId | ( | int | vfh_id, | |
boost::shared_ptr< DatabaseView > & | view | |||
) | [inline] |
Definition at line 324 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getViewFromVFHIdNoData | ( | int | vfh_id, | |
boost::shared_ptr< DatabaseView > & | view | |||
) | [inline] |
Definition at line 347 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getViewFromViewIdNoData | ( | int | view_id, | |
boost::shared_ptr< DatabaseView > & | view | |||
) | [inline] |
Definition at line 312 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getViewsFromScaledModelId | ( | int | scaled_model_id, | |
int | iteration, | |||
std::vector< boost::shared_ptr< DatabaseView > > & | views | |||
) | [inline] |
Definition at line 495 of file objects_database.h.