00001 /* 00002 * UOS-ROS packages - Robot Operating System code by the University of Osnabrück 00003 * Copyright (C) 2010 University of Osnabrück 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * as published by the Free Software Foundation; either version 2 00008 * of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 * 00019 * katana_gripper_grasp_controller.h 00020 * 00021 * Created on: 29.01.2011 00022 * Author: Martin Günther <mguenthe@uos.de> 00023 * 00024 * based on pr2_gripper_grasp_controller 00025 */ 00026 00027 #ifndef KATANA_GRIPPER_GRASP_CONTROLLER_H_ 00028 #define KATANA_GRIPPER_GRASP_CONTROLLER_H_ 00029 00030 #include <ros/ros.h> 00031 00032 #include <actionlib/server/simple_action_server.h> 00033 00034 #include <object_manipulation_msgs/GraspHandPostureExecutionAction.h> 00035 #include <object_manipulation_msgs/GraspStatus.h> 00036 00037 #include <katana/AbstractKatana.h> 00038 00039 00040 namespace katana 00041 { 00042 00043 class KatanaGripperGraspController 00044 { 00045 public: 00046 KatanaGripperGraspController(boost::shared_ptr<AbstractKatana> katana); 00047 virtual ~KatanaGripperGraspController(); 00048 00049 private: 00051 actionlib::SimpleActionServer<object_manipulation_msgs::GraspHandPostureExecutionAction> *action_server_; 00052 00054 ros::ServiceServer query_srv_; 00055 00056 boost::shared_ptr<AbstractKatana> katana_; 00057 00058 bool last_command_was_close_; 00059 00061 double gripper_object_presence_threshold_; 00062 00063 void executeCB(const object_manipulation_msgs::GraspHandPostureExecutionGoalConstPtr &goal); 00064 00065 bool serviceCallback(object_manipulation_msgs::GraspStatus::Request &request, 00066 object_manipulation_msgs::GraspStatus::Response &response); 00067 00068 }; 00069 00070 } 00071 00072 #endif /* KATANA_GRIPPER_GRASP_CONTROLLER_H_ */