00001 //###################################################################### 00002 // 00003 // GraspIt! 00004 // Copyright (C) 2002-2008 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 Ciocarlie (cmatei@cs.columbia.edu) 00021 // 00022 // $Id: 00023 // 00024 //###################################################################### 00025 00030 #ifndef PR2GRIPPER_H 00031 00032 #include "robot.h" 00033 00035 00039 class Pr2Gripper : public Hand { 00040 Q_OBJECT 00041 00042 public: 00043 00045 Pr2Gripper(World *w,const char *name) : Hand(w,name) {} 00046 00050 virtual int loadFromXml(const TiXmlElement* root,QString rootPath); 00051 00055 virtual void cloneFrom(Hand *original); 00056 00057 }; 00058 00060 00063 class Pr2Gripper2010 : public Hand { 00064 Q_OBJECT 00065 public: 00066 enum ComplianceType{NONE = -1, FINGER0 = 0, FINGER1 = 1}; 00067 private: 00068 const static std::string l_gripper_tip_name; 00069 const static std::string r_gripper_tip_name; 00070 00071 ComplianceType mCompliance; 00072 00073 protected: 00074 virtual void setJointValuesAndUpdate(const double* jointVals); 00075 00076 public: 00078 Pr2Gripper2010(World *w,const char *name) : Hand(w,name), mCompliance(NONE) {} 00079 00091 void compliantClose(); 00092 00093 void setCompliance(ComplianceType type){mCompliance = type;} 00094 ComplianceType getCompliance() const {return mCompliance;} 00095 }; 00096 00097 #define PR2GRIPPER_H 00098 #endif