Go to the documentation of this file.00001
00002
00003
00004
00005
00006 import roslib; roslib.load_manifest('srs_states')
00007 import rospy
00008 import smach
00009
00010 class select_srs_grasp(smach.State):
00011
00012 def __init__(self):
00013 smach.State.__init__(
00014 self,
00015 outcomes=['succeeded', 'not_possible', 'failed', 'preempted'],
00016 input_keys=['object', 'target_object_id'],
00017 output_keys=['grasp_configs', 'poses'])
00018
00019
00020
00021
00022
00023 def execute(self, userdata):
00024 userdata.grasp_configs=''
00025 userdata.poses=''
00026 return 'failed'
00027
00028
00029
00030 class srs_grasp(smach.State):
00031 def __init__(self):
00032 smach.State.__init__(self, outcomes=['succeeded','not_completed','failed', 'preempted'],
00033 input_keys=['grasp_configuration','grasp_configuration_id'],
00034 output_keys=['grasp_categorisation'])
00035
00036 def get_joint_state(self, msg):
00037 global current_joint_configuration
00038 current_joint_configuration = list(msg.desired.positions)
00039 rospy.spin()
00040
00041 def execute(self, userdata):
00042 userdata.grasp_categorisation=''
00043 return 'failed'
00044
00045
00046 class grasp_base_pose_estimation(smach.State):
00047
00048 def __init__(self):
00049 smach.State.__init__(
00050 self,
00051 outcomes=['retry', 'not_retry', 'failed', 'preempted'],
00052 input_keys=['object','target_workspace_name'],
00053 output_keys=['base_pose'])
00054
00055 self.counter = 0
00056
00057
00058 def execute(self, userdata):
00059 userdata.base_pose=''
00060 return 'failed'
00061