Ask Your Question

Rospy message_filter ApproximateTimeSynchronizer issue

asked 2019-08-31 22:45:35 -0500

Ajith gravatar image

updated 2019-08-31 22:55:08 -0500

Hi All,

I installed ROS melodic version in Ubuntu 18.04. I'm running a rosbag in the background to mock cameras in messages rostopics. I set the camera names in rosparams and iterated through it to capture each camera topics. I'm using message_filter ApproximateTimeSynchronizerto get time synchronized data as mentioned in the official documentation,

But most of the time the callback function to ApproximateTimeSynchronizer is not being called/is having too much delay. The code snippet I'm using is given below:

def  camera_callback(*args):
    pass # Other logic comes here
rospy.init_node('my_listener', anonymous=True) 
camera_object_data = []
for camera_name in rospy.get_param('/my/cameras'):
        '/{}/hd/camera_info'.format(camera_name), CameraInfo))
        '/{}/hd/image_color_rect'.format(camera_name), Image))
        '/{}/qhd/image_depth_rect'.format(camera_name), Image))
        '/{}/qhd/points'.format(camera_name), PointCloud2)
 topic_list = [filter_obj for filter_obj in camera_object_data]
 ts = message_filters.ApproximateTimeSynchronizer(topic_list, 10, 1,  allow_headerless=True)

What am I doing wrong here?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-09-04 07:07:15 -0500

Choco93 gravatar image

You can try increasing the slop value as defined here, and just for sanity check maybe check what is the actual time difference in the headers of your topics.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-08-31 22:45:35 -0500

Seen: 248 times

Last updated: Sep 04 '19