st_wam_move_in_joints.py
Go to the documentation of this file.
00001 import roslib; roslib.load_manifest('iri_wam_smach')
00002 import rospy
00003 import smach
00004 import smach_ros
00005 
00006 from iri_wam_common_msgs.srv import joints_move
00007 
00008 class MoveWamInJoints(smach.State):
00009     """
00010     Move WAM given specific joints (no planning or obstacle avoidance)
00011 
00012     @type move_service : str
00013     @param move_service : URI of move in joinst wam service
00014     """
00015     def __init__(self, move_service):
00016         smach.State.__init__(self,
00017                              outcomes    = ['success','fail'],
00018                              input_keys  = ['joints_to_position'],
00019                              output_keys = [])
00020 
00021         self.move_service = move_service
00022 
00023     def execute(self, userdata):
00024         
00025         try:
00026             handler = rospy.ServiceProxy(self.move_service, joints_move)
00027             response = handler(userdata.joints_to_position.position, [], [])
00028 
00029         except rospy.ServiceException, e:
00030             return 'fail'
00031 
00032         return 'success'


iri_wam_smach
Author(s): Jose Luis Rivero
autogenerated on Fri Dec 6 2013 21:06:15