00001 #ifndef GRIPPING_H 00002 #define GRIPPING_H 00003 #include "ros/ros.h" 00004 #include <geometry_msgs/PoseStamped.h> 00005 #include <actionlib/client/simple_action_client.h> 00006 // gripper control 00007 #include <message_filters/subscriber.h> 00008 #include <pr2_controllers_msgs/Pr2GripperCommandAction.h> 00009 00010 #include <tf/transform_listener.h> 00011 #include <std_srvs/Empty.h> 00012 #include <string> 00013 00014 typedef actionlib::SimpleActionClient<pr2_controllers_msgs::Pr2GripperCommandAction> gripActClient; 00015 00016 class DoorSwinger{ 00017 public: 00019 DoorSwinger(char lr); 00020 ~DoorSwinger(); 00022 bool swing_door(std_srvs::Empty::Request&, std_srvs::Empty::Response&); 00023 00025 void home_position(); 00027 void use_gripper(float position, float effort); 00028 bool wait_for_gripper(); 00029 private: 00030 gripActClient* gripperClient; 00031 ros::NodeHandle n; 00032 ros::ServiceServer serviceServer; 00033 tf::TransformListener tflistener; 00034 std::string controller_name_; 00037 void withdraw(float meters); 00038 00039 }; 00040 #endif