Go to the documentation of this file.00001 import roslib; roslib.load_manifest('iri_common_smach')
00002 import rospy
00003 import smach
00004 import smach_ros
00005 from transform_manager import TransformManager
00006
00007 """
00008 TODO: implement TransformPose which can be based on code reem_at_iri -> global_common
00009 which recieve a pose, src_frame, target_frame.
00010 Create a base class for both to share same code.
00011 """
00012
00013 class TransformPoseStamped(smach.State):
00014 """
00015 Use the tf to convert from input_key 'pose_st' (PoseStamped) to 'target_frame'
00016 """
00017 def __init__(self):
00018 smach.State.__init__(self, outcomes = ['success','fail'],
00019 input_keys = ['pose_st','target_frame'],
00020 output_keys = ['transformed_pose_st'])
00021 self.tf_manager = TransformManager()
00022
00023 def execute(self, userdata):
00024 tf_pose_st = self.tf_manager.transform_pose(userdata.target_frame, userdata.pose_st)
00025 userdata.transformed_pose_st = tf_pose_st
00026 return 'success'