Selects the representative grasps (i.e. cluster centers) from a list of grasps. More...
#include <grasp_clustering_task.h>
Public Member Functions | |
GraspClusteringTask (graspit_dbase_tasks::DBTaskDispatcher *disp, db_planner::DatabaseManager *mgr, db_planner::TaskRecord rec) | |
Just a stub for now. | |
virtual void | start () |
Actually does all the work. | |
~GraspClusteringTask () | |
Nothing to do here. | |
Private Member Functions | |
bool | clusterGrasps (const GraspitDBGrasp *g1, const GraspitDBGrasp *g2) |
Returns true if two grasps are close enough to be clustered together. | |
Private Attributes | |
db_planner::PlanningTaskRecord | mPlanningTask |
The record of the actual planning task. |
Selects the representative grasps (i.e. cluster centers) from a list of grasps.
This task is meant to be used *after* a grasp planning task has already been run for a given hand and object. It will then go through the list of existing grasps and cluster them - i.e., for each set of grasps that are "close" in a Euclidian sense it will select one to be marked as "cluster representative". The idea is that, when executing grasps, you do not want to try dozens of grasps that are within a few mm of each other, since if one will fail chances are all will fail. You can thus choose just the "cluster reps" and use those.
Works by selecting the best grasp from a list, then setting it as the representative grasp for all other grasps that are close to it. Then does this iteratively on the remaining grasps.
Two grasps are deemed close based on the position and orientation of they define plus the gripper angle.
Will set the "cluster_rep" property of ALL grasps in the list based on what it thinks, i.e. mark it "true" for all those it thinks should be cluster reps and "false" for all others.
Definition at line 64 of file grasp_clustering_task.h.
dbase_grasp_planner::GraspClusteringTask::GraspClusteringTask | ( | graspit_dbase_tasks::DBTaskDispatcher * | disp, |
db_planner::DatabaseManager * | mgr, | ||
db_planner::TaskRecord | rec | ||
) |
Just a stub for now.
Definition at line 50 of file grasp_clustering_task.cpp.
Nothing to do here.
Definition at line 78 of file grasp_clustering_task.h.
bool dbase_grasp_planner::GraspClusteringTask::clusterGrasps | ( | const GraspitDBGrasp * | g1, |
const GraspitDBGrasp * | g2 | ||
) | [private] |
Returns true if two grasps are close enough to be clustered together.
Only looks at the relative distance between gripper positions for the final grasps. Returns true if both of the follosing are true:
Both thresholds are hard-coded in here.
Definition at line 172 of file grasp_clustering_task.cpp.
void dbase_grasp_planner::GraspClusteringTask::start | ( | ) | [virtual] |
Actually does all the work.
Will also load the hand, even though the hand is not explicitly used. It is needed for the grasp allocator, plus it might be needed for retrieving DOF values, for example if the grasp is stored in the database as eigengrasp values.
Implements graspit_dbase_tasks::DBTask.
Definition at line 61 of file grasp_clustering_task.cpp.
db_planner::PlanningTaskRecord dbase_grasp_planner::GraspClusteringTask::mPlanningTask [private] |
The record of the actual planning task.
Definition at line 67 of file grasp_clustering_task.h.