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, std::vector< std::string > accepted_types) |
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 | getCaptureRegions (int scaled_model_id, std::string robot_geometry_hash, std::vector< boost::shared_ptr< DatabaseCaptureRegion > > &capture_regions) const |
Gets the list of all capture regions for an object and hand pair. | |
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 | getObjectPaths (int scaled_model_id, std::string robot_geometry_hash, std::vector< boost::shared_ptr< DatabaseObjectPaths > > &object_paths) const |
Gets the list of all object paths for an object and hand pair. | |
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, DatabaseMesh &mesh) const |
Gets the mesh for a scaled model. | |
bool | getScaledModelMesh (int scaled_model_id, shape_msgs::Mesh &ros_mesh) const |
Gets the mesh for a scaled model as a arm_navigation_msgs::Shape. | |
bool | getScaledModelsByAcquisition (std::vector< boost::shared_ptr< DatabaseScaledModel > > &models, std::string acquisition_method) const |
Gets a list of scaled models based on acquisition method. | |
bool | getScaledModelsByRecognitionId (std::vector< boost::shared_ptr< DatabaseScaledModel > > &models, std::string recognition_id) const |
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 (std::string host, std::string port, std::string user, std::string password, std::string dbname) | |
Attempts to connect to the specified database. | |
ObjectsDatabase (const database_interface::PostgresqlDatabaseConfig &config) | |
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 75 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 79 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 85 of file objects_database.h.
Just a stub for now.
Definition at line 91 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::acquireNextTask | ( | std::vector< boost::shared_ptr< DatabaseTask > > & | task, |
std::vector< std::string > | accepted_types | ||
) | [virtual] |
Acquires the next experiment to be executed from the list of tasks in the database.
If accepted_types is not empty, it will only get tasks of one of that types. If it's empty, it will get any task. Also marks any task it gets 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 307 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getCaptureRegions | ( | int | scaled_model_id, |
std::string | robot_geometry_hash, | ||
std::vector< boost::shared_ptr< DatabaseCaptureRegion > > & | capture_regions | ||
) | const [inline] |
Gets the list of all capture regions for an object and hand pair.
Definition at line 545 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 202 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 191 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getModelPathFromViewId | ( | boost::shared_ptr< DatabaseView > & | view, |
std::string & | path | ||
) | [inline] |
Definition at line 504 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 167 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getModelScale | ( | boost::shared_ptr< DatabaseView > & | view, |
double * | scale_factor | ||
) | [inline] |
Definition at line 522 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 490 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 276 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 174 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 147 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getObjectPaths | ( | int | scaled_model_id, |
std::string | robot_geometry_hash, | ||
std::vector< boost::shared_ptr< DatabaseObjectPaths > > & | object_paths | ||
) | const [inline] |
Gets the list of all object paths for an object and hand pair.
Definition at line 556 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getOrientationRollFromVFHId | ( | int | vfh_id, |
boost::shared_ptr< DatabaseVFHOrientation > & | roll_histogram | ||
) | [inline] |
Definition at line 421 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getOrientationRollFromVFHThroughViewId | ( | int | vfh_id, |
boost::shared_ptr< DatabaseVFHOrientation > & | roll_histogram | ||
) | [inline] |
Definition at line 459 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 107 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 316 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 215 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getScaledModelMesh | ( | int | scaled_model_id, |
shape_msgs::Mesh & | ros_mesh | ||
) | const [inline] |
Gets the mesh for a scaled model as a arm_navigation_msgs::Shape.
Definition at line 237 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 123 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getScaledModelsByRecognitionId | ( | std::vector< boost::shared_ptr< DatabaseScaledModel > > & | models, |
std::string | recognition_id | ||
) | const [inline] |
Definition at line 154 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 134 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 115 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getVFHDescriptors | ( | std::vector< boost::shared_ptr< DatabaseVFH > > & | vfh | ) | [inline] |
Definition at line 331 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 402 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getViewFromVFHId | ( | int | vfh_id, |
boost::shared_ptr< DatabaseView > & | view | ||
) | [inline] |
Definition at line 359 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getViewFromVFHIdNoData | ( | int | vfh_id, |
boost::shared_ptr< DatabaseView > & | view | ||
) | [inline] |
Definition at line 382 of file objects_database.h.
bool household_objects_database::ObjectsDatabase::getViewFromViewIdNoData | ( | int | view_id, |
boost::shared_ptr< DatabaseView > & | view | ||
) | [inline] |
Definition at line 347 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 531 of file objects_database.h.