Ask Your Question
0

unknown reason for transform failure

asked 2012-11-21 00:14:55 -0500

Kent gravatar image

updated 2014-01-28 17:14:19 -0500

ngrennan gravatar image

i'm trying to use the gmapping stack with my robot. i broadcast the following tf every 0.05 seconds:

current_time = rospy.Time.now()
odom_quat = tf.transformations.quaternion_about_axis(math.radians(theta), (0, 0, 1))    
laser_quat = tf.transformations.quaternion_about_axis(math.radians(-90), (0, 0, 1))
self.tfBdc.sendTransform((x, y, 0.0), odom_quat, current_time, "/base_link", "/odom")
self.tfBdc.sendTransform((0.16, 0.0, 0.2), laser_quat, rospy.Time.now(), "/base_laser", "/base_link")

i check the result in rviz, if i set the fixed frame as 'base_laser' in the 'global options' tag, everything seems to be fine(the 'LaserScan' tag is always green). But if i set the fixed frame as 'odom' or 'base_link' in the 'global option' tag, the 'LaserScan' tag just change to red and green from time to time. The error message in the 'LaserScan' tag says that 'unknown reason for transform failure'. How can i fix that?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-11-21 00:24:39 -0500

Lorenz gravatar image

On systems such as the PR2, the robot_state_publisher node is used to publish all transforms of a robot model. One important feature of it is that it future-dates static transforms to ensure that static trasnforms can always be looked up. Also have a look at the tf faq and this answer for more information on future-dated transform.

My guess for what happens in your case is that rviz tries to look up the transform between odom (or base_link) to the laser although it hasn't received the transform for the current time yet which will lead to a failure. To fix it, future-date your static transforms.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2012-11-21 00:14:55 -0500

Seen: 604 times

Last updated: Nov 21 '12