#include <graspit_db_planner.h>
Public Types | |
enum | DynamicCode { DYNAMIC_SUCCESS = 0, DYNAMIC_NO_FC = 1, DYNAMIC_OBJECT_EJECTED = 2, DYNAMIC_ERROR = 3, DYNAMIC_APPROACH_FAILED = 4, NO_DYNAMICS = 5 } |
enum | TestType { STATIC = 0, DYNAMIC = 1 } |
Public Slots | |
void | dynamicsError (const char *) |
Public Member Functions | |
void | computeQuality (float &eq, float &vq) |
Computes the epsilon quality(eq) and the volume quality(vq) for the current grasp. | |
void | crossCorrelate (const std::vector< db_planner::Model * > testModels, std::vector< db_planner::Grasp * > graspList) |
GraspitDBPlanner (Hand *h, db_planner::Model *b, db_planner::DatabaseManager *m, db_planner::Aligner< db_planner::Model > *a) | |
bool | testCurrentGrasp (TestType t, DynamicCode *c=NULL) |
This will test one grasp. | |
bool | testGrasps (TestType t, std::vector< db_planner::Grasp * >, std::vector< db_planner::Grasp * > *testedGraspList) |
This will test all the grasps in. | |
~GraspitDBPlanner () | |
Private Member Functions | |
bool | checkDynBody () |
Check if we need initialize the body for dynamic test. | |
void | dynamicBodyInit () |
For CGDB dynamic body test. | |
void | moveBy (vec3 v) |
Move the hand by the step specified by the vector. | |
bool | moveHandOutOfCollision () |
This moves the hand out of collision. | |
bool | testGraspDynamic (DynamicCode *code) |
Dynamic test. | |
bool | testGraspStatic () |
Static test. | |
Private Attributes | |
db_planner::Aligner < db_planner::Model > * | mAligner |
Used for aligning our object with its nbrs found in the dbase. | |
db_planner::DatabaseManager * | mDBMgr |
The mgr of the dbase we are using. | |
bool | mDynamicsError |
Helper variable for the dynamic autograsp. | |
QualEpsilon * | mEpsQual |
Epsilon quality measure. | |
Hand * | mHand |
The hand that we are planning for. | |
db_planner::Model * | mObject |
The grasped object. | |
std::vector< GraspPlanningState * > | mTestedGrasps |
Stores the tested grasps. | |
QualVolume * | mVolQual |
Volume quality measure. |
Definition at line 53 of file graspit_db_planner.h.
DYNAMIC_SUCCESS | |
DYNAMIC_NO_FC | |
DYNAMIC_OBJECT_EJECTED | |
DYNAMIC_ERROR | |
DYNAMIC_APPROACH_FAILED | |
NO_DYNAMICS |
Definition at line 56 of file graspit_db_planner.h.
Definition at line 57 of file graspit_db_planner.h.
GraspitDBPlanner::GraspitDBPlanner | ( | Hand * | h, | |
db_planner::Model * | b, | |||
db_planner::DatabaseManager * | m, | |||
db_planner::Aligner< db_planner::Model > * | a | |||
) | [inline] |
Definition at line 94 of file graspit_db_planner.h.
GraspitDBPlanner::~GraspitDBPlanner | ( | ) |
Definition at line 47 of file graspit_db_planner.cpp.
bool GraspitDBPlanner::checkDynBody | ( | ) | [private] |
Check if we need initialize the body for dynamic test.
Definition at line 215 of file graspit_db_planner.cpp.
void GraspitDBPlanner::computeQuality | ( | float & | eq, | |
float & | vq | |||
) |
Computes the epsilon quality(eq) and the volume quality(vq) for the current grasp.
Definition at line 224 of file graspit_db_planner.cpp.
void GraspitDBPlanner::crossCorrelate | ( | const std::vector< db_planner::Model * > | modelList, | |
std::vector< db_planner::Grasp * > | graspList | |||
) |
This does cross correlation of the grasps in graspList by applying them on the models in modelList. For each test of a grasp in graspList, the test score will be recorded. In the end, all the grasps will NOT be ranked by the average of the records associated with the grasps. After it, the grasps in graspList will have their test scores filled.
The grasps in graspList will be tested and their DBGrasp::mTestScores will be modified during the cross correlation. The grasps will not be sorted based on any scheme. It is the caller's responsibility to sort the results based on its application.
Definition at line 336 of file graspit_db_planner.cpp.
void GraspitDBPlanner::dynamicBodyInit | ( | ) | [private] |
For CGDB dynamic body test.
Definition at line 220 of file graspit_db_planner.cpp.
void GraspitDBPlanner::dynamicsError | ( | const char * | ) | [slot] |
Definition at line 107 of file graspit_db_planner.cpp.
void GraspitDBPlanner::moveBy | ( | vec3 | v | ) | [private] |
Move the hand by the step specified by the vector.
Definition at line 54 of file graspit_db_planner.cpp.
bool GraspitDBPlanner::moveHandOutOfCollision | ( | ) | [private] |
This moves the hand out of collision.
Definition at line 63 of file graspit_db_planner.cpp.
bool GraspitDBPlanner::testCurrentGrasp | ( | TestType | t, | |
DynamicCode * | c = NULL | |||
) |
This will test one grasp.
Definition at line 204 of file graspit_db_planner.cpp.
bool GraspitDBPlanner::testGraspDynamic | ( | DynamicCode * | code | ) | [private] |
Dynamic test.
Definition at line 113 of file graspit_db_planner.cpp.
bool GraspitDBPlanner::testGrasps | ( | TestType | t, | |
std::vector< db_planner::Grasp * > | graspList, | |||
std::vector< db_planner::Grasp * > * | testedGraspList | |||
) |
This will test all the grasps in.
Every grasp in graspList will be tested and stored in testedGraspList even if their test scores, epsilon quality and volume quality, are not positive, which means they are not stable grasps.
Definition at line 254 of file graspit_db_planner.cpp.
bool GraspitDBPlanner::testGraspStatic | ( | ) | [private] |
Static test.
Definition at line 193 of file graspit_db_planner.cpp.
Used for aligning our object with its nbrs found in the dbase.
Definition at line 66 of file graspit_db_planner.h.
The mgr of the dbase we are using.
Definition at line 64 of file graspit_db_planner.h.
bool GraspitDBPlanner::mDynamicsError [private] |
Helper variable for the dynamic autograsp.
Definition at line 70 of file graspit_db_planner.h.
QualEpsilon* GraspitDBPlanner::mEpsQual [private] |
Epsilon quality measure.
Definition at line 72 of file graspit_db_planner.h.
Hand* GraspitDBPlanner::mHand [private] |
The hand that we are planning for.
Definition at line 60 of file graspit_db_planner.h.
db_planner::Model* GraspitDBPlanner::mObject [private] |
The grasped object.
Definition at line 62 of file graspit_db_planner.h.
std::vector<GraspPlanningState*> GraspitDBPlanner::mTestedGrasps [private] |
Stores the tested grasps.
Definition at line 68 of file graspit_db_planner.h.
QualVolume* GraspitDBPlanner::mVolQual [private] |
Volume quality measure.
Definition at line 74 of file graspit_db_planner.h.