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

tf broadcaster synchronization

asked 2012-11-14 20:23:14 -0500

Kent gravatar image

supposed that i have two broadcasters that declare my robot's frame transformation (odom->base_link, base_link->base_laser), which are written in two different python files, (cuz it's convenient for me to manage the stack since the robot has many modules ); and i find the "odometry" tag just turn red and blue(error and OK) from time to time when i view the gmapping process in rviz. If i write them in the same python file, the problem is solved. I think it's a synchronization problem that the tf should be broadcasted in a same time. However, i just want to know, is there any solutions to that if I really want to write them in different python files?

edit retag flag offensive close merge delete


I guess that this happens because both transformations use ros::time as source for the broadcasts timestamp - dunno what to do there, maybe you can simply check the last time stamp of one file in the other.

Flowers gravatar image Flowers  ( 2012-11-14 21:18:53 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2012-11-14 22:04:00 -0500

Lorenz gravatar image

I guess the problem is not directly a synchronization problem but expected behavior given the setup you are using. There are just points in time where your transform odom->base_link has not been published yet for a specific time stamp but base_link->base_laser is there already. The easiest way to solve this is to increase the publish rate of your transforms. 30-50Hz should be fine.

Another common approach, in particular followed by amcl, is to future-date transforms. See here and here.

edit flag offensive delete link more

Question Tools


Asked: 2012-11-14 20:23:14 -0500

Seen: 727 times

Last updated: Nov 14 '12