rospy TimeSynchronizer with rosbag play *.bag --clock --loop -r 0.1, use_sim_time=true?

asked 2022-04-22 07:15:36 -0500

lucasw gravatar image

When I was playing back 3 bag files using use_sim_time true and --clock and --loop I noticed the more I lowered the real time playback factor the less a python exact time synchronizer (with three topics) callback was called (factoring out the lower play back rate of course). So -r 0.1 triggered the callback at a tiny rate of the 3 subscribed topics, maybe 1 in a hundred, -r 0.5 is maybe getting a half or third of the syncs that ought to happen.

There are a lot of interacting pieces here so multiple things to try: so far increasing the synchronizer queue_size didn't help, I'll try increasing the rosbag play queue size next, see if something in the synchronizer code is using the system time instead of the sim clock time (maybe it throws out old messages that aren't really old in the slow motion sim time), making a minimal reproducible example. https://github.com/ros/ros_comm/issue... suggests calling init() on the synchronizer when time loops, so I can try that and try bag playback without looping.

edit retag flag offensive close merge delete