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

How to check that two topics are synced?

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

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

Comments

Can you clarify what timestamp you are asking about?

tfoote gravatar image tfoote  ( 2017-11-03 13:00:46 -0600 )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 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
2

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

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: http://wiki.ros.org/message_filters#P...

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

edit flag offensive delete link more
0

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

nbro gravatar image

Have a look at this ROS package I created that can be used to synchronize messages according to their timestamps https://github.com/nbro/bag_synchronizer. 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

2 followers

Stats

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

Seen: 4,371 times

Last updated: Sep 24 '19