Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Publishers and subscribers in ROS are agnostic to each other. So

I assume it is for making sure all the published images have the same timestamp.

No. In ROS, what you do on the subscriber's end will have no effect on what (and how) the publisher does.

Here is the message_filter wiki page. A message filter is defined as something which a message arrives into and may or may not be spit back out of at a later point in time.

What the ExactSync message filter does is that it will only spit out messages with the exact timestamp. If they are few nanoseconds different, they will not be identified as a matching pair. To quote the documentation,

The message_filters::sync_policies::ExactTime policy requires messages to have exactly the same timestamp in order to match. Your callback is only called if a message has been received on all specified channels with the same exact timestamp. The timestamp is read from the header field of all messages (which is required for this policy).

Therefore this subscriber will only work if your publisher explicitly synchronizes the left and right images using the timestamps. That is something you have to implement on your publisher node. If the left and right images are not explicitly synchronized, but you want to logically synchronize them based on the timestamp on the subscriber node, perhaps you can use the Approximate Time Policy instead.