00001 /* 00002 * Software License Agreement (Modified BSD License) 00003 * 00004 * Copyright (c) 2014, University of Colorado, Boulder, PAL Robotics, S.L. 00005 * All rights reserved. 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions 00009 * are met: 00010 * 00011 * * Redistributions of source code must retain the above copyright 00012 * notice, this list of conditions and the following disclaimer. 00013 * * Redistributions in binary form must reproduce the above 00014 * copyright notice, this list of conditions and the following 00015 * disclaimer in the documentation and/or other materials provided 00016 * with the distribution. 00017 * * Neither the name of Univ of CO, Boulder, PAL Robotics, S.L. 00018 * nor the names of its contributors may be used to endorse or 00019 * promote products derived from this software without specific 00020 * prior written permission. 00021 * 00022 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00023 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00024 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00025 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00026 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00027 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00028 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00029 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00030 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00031 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00032 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00033 * POSSIBILITY OF SUCH DAMAGE. 00034 */ 00035 00036 /* Authors: Bence Magyar, Dave Coleman 00037 Description: Data class used by the grasp generator. 00038 */ 00039 00040 #ifndef MOVEIT_SIMPLE_GRASPS__GRASP_DATA_H_ 00041 #define MOVEIT_SIMPLE_GRASPS__GRASP_DATA_H_ 00042 00043 // Ros 00044 #include <ros/node_handle.h> 00045 00046 // Msgs 00047 #include <geometry_msgs/Pose.h> 00048 #include <trajectory_msgs/JointTrajectory.h> 00049 #include <moveit/robot_state/robot_state.h> 00050 00051 namespace moveit_simple_grasps 00052 { 00053 00054 class GraspData 00055 { 00056 public: 00057 geometry_msgs::Pose grasp_pose_to_eef_pose_; // Convert generic grasp pose to this end effector's frame of reference 00058 trajectory_msgs::JointTrajectory pre_grasp_posture_; // when the end effector is in "open" position 00059 trajectory_msgs::JointTrajectory grasp_posture_; // when the end effector is in "close" position 00060 std::string base_link_; // name of global frame with z pointing up 00061 std::string ee_parent_link_; // the last link in the kinematic chain before the end effector, e.g. "/gripper_roll_link" 00062 std::string ee_group_; // the end effector name 00063 double grasp_depth_; // distance from center point of object to end effector 00064 int angle_resolution_; // generate grasps at PI/angle_resolution increments 00065 double approach_retreat_desired_dist_; // how far back from the grasp position the pregrasp phase should be 00066 double approach_retreat_min_dist_; // how far back from the grasp position the pregrasp phase should be at minimum 00067 double object_size_; // for visualization 00068 00069 public: 00070 00074 GraspData(); 00075 00082 bool loadRobotGraspData(const ros::NodeHandle& nh, const std::string& end_effector); 00083 00089 bool setRobotStatePreGrasp( robot_state::RobotStatePtr &robot_state ); 00090 00096 bool setRobotStateGrasp( robot_state::RobotStatePtr &robot_state ); 00097 00104 bool setRobotState( robot_state::RobotStatePtr &robot_state, const trajectory_msgs::JointTrajectory &posture ); 00105 00109 void print(); 00110 }; 00111 00112 } // namespace 00113 00114 #endif