transform Pose from one frame to another using tf

asked 2021-02-01 12:13:17 -0500

mateusguilherme gravatar image

updated 2021-02-01 13:04:08 -0500

Hello

I have a Pose in the "camera_link" frame and I would like to convert it to the "map" frame. How can I do this using tf.transformPose using the latest transformation available?

would the following code do this using a last available transformation?

 poseDock = PoseStamped()
 poseDock.header.frame_id = "camera_link"
 poseDock.header.stamp = rospy.Time.now()
 poseDock.pose.position.x = x
 poseDock.pose.position.y = y
 poseDock.pose.orientation.z = q[2]
 poseDock.pose.orientation.w = q[3]

 listener.waitForTransform("map", poseDock.header.frame_id, poseDock.header.stamp, rospy.Duration(3.0))

 newPoseDock = PoseStamped()
 newPoseDock = listener.transformPose('map', poseDock)

thank you

edit retag flag offensive close merge delete