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

TransformListener Could not find a common time /base_link and /map

asked 2011-12-21 22:41:54 -0500

Benoit Larochelle gravatar image

updated 2014-01-28 17:11:01 -0500

ngrennan gravatar image

I recorded bags on different computers/robots during an experiment and now I'm trying to replay them. All computers were synchronized with chrony. Now, I play all bags with the same rosbag command.

However, when I call listener.lookupTransform("/map", "/base_link", ros::Time(0), transformStamped); from another node, I get the error Could not find a common time /base_link and /map.

Everything is fine when I look with RVIZ, same with roswtf. I ran tf view_frames and everything seems normal to me.

I also tried rosparam set /use_sim_time "True" and then rosbag play --clock, but it does not seem to make any difference.

One of my colleagues recommend that I always call waitForTransform before lookupTransform. Is this required, or should lookupTransform work on its own?

frames2.png

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2011-12-22 00:14:40 -0500

Benoit Larochelle gravatar image

updated 2011-12-22 18:26:33 -0500

Adding a call to canTransform or waitForTransform before lookupTransform solves the problem. For example, listener.waitForTransform("/map", "/base_link", ros::Time(0),ros::Duration(1)); the line before lookupTransform makes everything work.

edit flag offensive delete link more

Comments

You will likely want to use waitForTransform documented in the tf tutorials http://www.ros.org/wiki/tf/Tutorials or if you are performance limited the tf::MessageFilter will allow you to do it without blocking execution http://ros.org/doc/electric/api/tf/html/c++/classtf_1_1MessageFilter.html
tfoote gravatar image tfoote  ( 2011-12-22 01:37:08 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2011-12-21 22:41:54 -0500

Seen: 1,252 times

Last updated: Dec 22 '11