ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Yet another tf problem

asked 2015-08-10 07:14:21 -0500

Mehdi. gravatar image

updated 2015-08-10 07:15:35 -0500

Doing this :

print self.tf_listener.lookupTransform("/map", "/camera_frame", rospy.Time(0))
pose_camera_frame.header.stamp = rospy.Time(0)
pose_world_frame = self.tf_transformer.transformPose("/map", pose_camera_frame)

The first line works and I get the transform between /map and /camera_frame. But when I want to transform my pose which is defined in camera_frame to the map frame, I get this error:

  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/", line 711, in _invoke_callback
    cb(msg)   File "/opt/workspaces/catkin_ws/src/sp_navigation/scripts/", line 515, in callback
    pose_world_frame = self.tf_transformer.transformPose("/map", pose_camera_frame)   File "/opt/ros/indigo/lib/python2.7/dist-packages/tf/", line 188, in transformPose
    mat44 = self.asMatrix(target_frame, ps.header) File "/opt/ros/indigo/lib/python2.7/dist-packages/tf/", line 75, in asMatrix
    translation,rotation = self.lookupTransform(target_frame, hdr.frame_id, hdr.stamp) LookupException: "map" passed to lookupTransform argument target_frame does not exist.

But tf just saw that map existed and had no problem giving me the transform between map and camera_frame. pose_camera_frame is a PoseStamped variable with

pose_camera_frame.header.frame_id = "camera_frame"

And tf listener and transformer are defined as follows:

# Create a TF listener
self.tf_listener = tf.TransformListener()
# Create a TF transformer
self.tf_transformer = tf.TransformerROS()

Why does this happen?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-08-10 07:23:28 -0500

Mehdi. gravatar image

Okay I just discovered that TransformListener class also has the ability to transform a given pose from one frame to another. Using:

pose_world_frame = self.tf_listener.transformPose("/map", pose_camera_frame)

works somehow. But I would be still interested to know why TransformerROS doesn't work. Was it implemented at an abstract level where it is called by higher level functions?

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-08-10 07:14:21 -0500

Seen: 699 times

Last updated: Aug 10 '15