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

How to check that two topics are synced?

asked 2017-11-03 00:33:42 -0500

ravich gravatar image

Right now, I'm recording the two topics using rosbag and seeing if the messages are aligned. But, I'm not sure if rosbag respects the original timestamps or gives a new timestamp based on when it received the message.

edit retag flag offensive close merge delete


Can you clarify what timestamp you are asking about?

tfoote gravatar image tfoote  ( 2017-11-03 13:00:46 -0500 )edit

header.stamp of the message. I had recorded /camera/depth/image_raw and /camera/rgb/image_raw from freenect, and expected these 2 sensor_msgs/Image topics to have the same time stamp, but on checking them with rqt_bag I found that the messages were misaligned.

ravich gravatar image ravich  ( 2017-11-04 00:33:17 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2017-11-04 12:18:45 -0500

tfoote gravatar image

rosbag will not modify timestamp data inside the bag file. However it will publish as accurately as possible related to the receive time during the playback. Two parallel message topics are not synchronized or guarenteed in order. Going through rosbag adds another layer of complexity.

The recommended approach to synchronize parallel topics is a message_filter based synchronizer:

There are standard filters for ExactTime Policy as well as ApproximateTIme documented there.

edit flag offensive delete link more

answered 2019-09-24 03:51:45 -0500

nbro gravatar image

Have a look at this ROS package I created that can be used to synchronize messages according to their timestamps For now, it only supports TimeSynchronizer and ApproximateTimeSynchronizer and SimpleFilter, but I am planning to extend it, if there is a request.

edit flag offensive delete link more

Question Tools



Asked: 2017-11-03 00:33:42 -0500

Seen: 4,209 times

Last updated: Sep 24 '19