00001 //###################################################################### 00002 // 00003 // GraspIt! 00004 // Copyright (C) 2002-2009 Columbia University in the City of New York. 00005 // All rights reserved. 00006 // 00007 // GraspIt! is free software: you can redistribute it and/or modify 00008 // it under the terms of the GNU General Public License as published by 00009 // the Free Software Foundation, either version 3 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // GraspIt! is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with GraspIt!. If not, see <http://www.gnu.org/licenses/>. 00019 // 00020 // Author(s): Matei T. Ciocarlie 00021 // 00022 // $Id: preGraspCheckTask.h,v 1.2 2010/04/12 20:15:30 cmatei Exp $ 00023 // 00024 //###################################################################### 00025 00026 #ifndef _PREGRASPCHECKTASK_H_ 00027 #define _PREGRASPCHECKTASK_H_ 00028 00029 #include <vector> 00030 00031 #include "taskDispatcher.h" 00032 00033 class Hand; 00034 class GraspableBody; 00035 namespace db_planner { 00036 class Grasp; 00037 } 00038 00040 00049 class PreGraspCheckTask : public Task { 00050 protected: 00052 Hand *mHand; 00054 GraspableBody *mObject; 00056 db_planner::PlanningTaskRecord mPlanningTask; 00057 00059 bool checkSetGrasp(db_planner::Grasp *grasp); 00061 bool computePreGrasp(db_planner::Grasp *grasp); 00062 00064 void loadHand(); 00065 00067 void loadObject(); 00068 00070 void emptyGraspList(std::vector<db_planner::Grasp*> &graspList); 00071 00072 public: 00074 PreGraspCheckTask(TaskDispatcher *disp, db_planner::DatabaseManager *mgr, 00075 db_planner::TaskRecord rec); 00077 ~PreGraspCheckTask(); 00078 00080 virtual void start(); 00081 00083 static bool preGraspCheck(Hand *hand); 00084 }; 00085 00086 #endif