#include <grasp_retriever.h>
Public Member Functions | |
DatabaseGraspRetriever (ObjectsDatabasePtr database, const household_objects_database_msgs::DatabaseModelPose &model, const std::string &arm_name, bool prune_compliant_copies, bool use_cluster_rep_grasps) | |
virtual void | fetchFromDB () |
virtual void | getGrasps (std::vector< GraspWithMetadata > &grasps) |
Protected Member Functions | |
void | appendMetadataToGrasps (const std::vector< household_objects_database::DatabaseGraspPtr > &db_grasps, std::vector< GraspWithMetadata > &grasps) |
void | pruneGraspList (std::vector< household_objects_database::DatabaseGraspPtr > &grasps, double gripper_threshold, double table_clearance_threshold) |
Prune grasps that require gripper to be open all the way, or that are marked in db as colliding with table. | |
Protected Attributes | |
ObjectsDatabasePtr | database_ |
const household_objects_database_msgs::DatabaseModelPose & | model_ |
The model whose grasps this retriever will retrieve. | |
bool | prune_compliant_copies_ |
Whether compliant copies should be returned or not. | |
bool | use_cluster_rep_grasps_ |
Whether only cluster representative grasps should be returned. | |
Private Attributes | |
std::map< int, std::vector < household_objects_database::DatabaseGraspPtr > > | grasps_cache_ |
A cache storing model_id->grasps for that model. This is private since subclasses should not share caches. |
Definition at line 75 of file grasp_retriever.h.
probabilistic_grasp_planner::DatabaseGraspRetriever::DatabaseGraspRetriever | ( | ObjectsDatabasePtr | database, |
const household_objects_database_msgs::DatabaseModelPose & | model, | ||
const std::string & | arm_name, | ||
bool | prune_compliant_copies, | ||
bool | use_cluster_rep_grasps | ||
) |
Instantiates a DatabaseGraspRetriever which gets all grasps for a model (as opposed to just cluster rep grasps)
Definition at line 182 of file grasp_retriever.cpp.
void probabilistic_grasp_planner::DatabaseGraspRetriever::appendMetadataToGrasps | ( | const std::vector< household_objects_database::DatabaseGraspPtr > & | db_grasps, |
std::vector< GraspWithMetadata > & | grasps | ||
) | [protected] |
Given a model which the grasps are specified relative to, and a list of grasps from the database, populates a list of GraspWithMetadata objects which contains the basic Grasp object for final return by the planner and additional information used by the planner such as energy metrics and object coordinate frames.
The "tool point" is roughly in the middle of the object enclosed by the grasp, so roughly 5cm from wrist
Definition at line 86 of file grasp_retriever.cpp.
void probabilistic_grasp_planner::DatabaseGraspRetriever::fetchFromDB | ( | ) | [virtual] |
Reimplemented in probabilistic_grasp_planner::PerturbationGraspRetriever, and probabilistic_grasp_planner::ClusterRepGraspRetriever.
Definition at line 193 of file grasp_retriever.cpp.
void probabilistic_grasp_planner::DatabaseGraspRetriever::getGrasps | ( | std::vector< GraspWithMetadata > & | grasps | ) | [virtual] |
Given a list of models, retrieves all of the cluster representative grasps for those models and stores them with their metadata in the grasps vector.
Implements probabilistic_grasp_planner::GraspRetriever.
Reimplemented in probabilistic_grasp_planner::PerturbationGraspRetriever, probabilistic_grasp_planner::DebugClusterRepGraspRetriever, and probabilistic_grasp_planner::ClusterRepGraspRetriever.
Definition at line 240 of file grasp_retriever.cpp.
void probabilistic_grasp_planner::DatabaseGraspRetriever::pruneGraspList | ( | std::vector< household_objects_database::DatabaseGraspPtr > & | grasps, |
double | gripper_threshold, | ||
double | table_clearance_threshold | ||
) | [protected] |
Prune grasps that require gripper to be open all the way, or that are marked in db as colliding with table.
Removes grasps from the list which do not match certain criteria (such as not coming from beneath the object).
Use negative value for table_clearance_threshold if no clearing should be done based on table clearance.
Definition at line 63 of file grasp_retriever.cpp.
Definition at line 82 of file grasp_retriever.h.
std::map<int, std::vector<household_objects_database::DatabaseGraspPtr> > probabilistic_grasp_planner::DatabaseGraspRetriever::grasps_cache_ [private] |
A cache storing model_id->grasps for that model. This is private since subclasses should not share caches.
Reimplemented in probabilistic_grasp_planner::ClusterRepGraspRetriever.
Definition at line 79 of file grasp_retriever.h.
const household_objects_database_msgs::DatabaseModelPose& probabilistic_grasp_planner::DatabaseGraspRetriever::model_ [protected] |
The model whose grasps this retriever will retrieve.
Definition at line 85 of file grasp_retriever.h.
Whether compliant copies should be returned or not.
Definition at line 88 of file grasp_retriever.h.
Whether only cluster representative grasps should be returned.
Definition at line 91 of file grasp_retriever.h.