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

Revision history [back]

click to hide/show revision 1
initial version

You could use ApproximateTimeSynchronizer for this, but with topics that have such different frequencies you may be better off having two separate callbacks and storing a reference to the most recent data in one of the callbacks, and letting the second callback use the stored data along with its new message.

I'd probably perform the processing in the image callback only, using the most recent (stored) GPS position, since that's going to have the smallest average position error from the image capture position.

If you want to use message_filters, you'll need to use the approximate time policy, since the messages won't have exactly matching timestamps. See https://docs.ros.org/api/message_filters/html/python/#message_filters.ApproximateTimeSynchronizer (Python) or https://wiki.ros.org/message_filters#ApproximateTime_Policy (C++).