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

TimeSynchronizer stops working with rosbay looping

asked 2015-08-18 10:05:22 -0600

DeeFox gravatar image

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)
edit retag flag offensive close merge delete

Comments

I'm not sure how this is implemented, but maybe the TimeSynchronizer assumes that time only increases, thus looping makes this impossible to work.

dornhege gravatar image dornhege  ( 2015-08-18 10:19:42 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-02-26 11:23:05 -0600

cuevhv gravatar image

When you loop the rosbag, basically you go back in time to time 0, making to ROS impossible to synchronize the data.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-08-18 10:05:22 -0600

Seen: 247 times

Last updated: Aug 18 '15