Ask Your Question

DeeFox's profile - activity

2018-01-25 11:10:34 -0600 received badge  Famous Question (source)
2016-06-17 08:19:00 -0600 received badge  Notable Question (source)
2016-05-17 05:53:02 -0600 received badge  Popular Question (source)
2015-08-18 10:18:33 -0600 asked a question TimeSynchronizer stops working with rosbay looping

I am working with TimeSynchronizer in python to exactly sync images from 2 cameras that i recorded with rosbay. Now when playing the rosbag with the --loop option, every time the rosbag ends and restarts my program stops working and no callbacks are being called. My guess is, that the number of recorded frames for both cameras do not exactly match and since I am using a queue-size of 1 to optimize delays, the synchronizer fails to find a corresponding packet.

Any ideas?

image_sub1 = message_filters.Subscriber("/stereo/left/image_mono", Image)
image_sub2 = message_filters.Subscriber("/stereo/right/image_mono", Image)

sync = functools.partial(message_filters.TimeSynchronizer)
ts = sync([image_sub1, image_sub2], 1)
ts.registerCallback(self.calculate)