Synchronize two subscribed topics
Say I have a robot that moves around identifying objects and the object's location.
One topic contains the most updated robot pose (global position and orientation) that updates at 100Hz Other topic contains information of detected objects and the relative pose to the camera/robot. Processing time takes 10-20ms from initial image frame.
In order to determine the global pose of the detected object, I would have to transform the object's relative pose to camera/robot using the pose of the robot. However, processing computer vision for object detection and computing the relative pose takes 10-20ms. Now I'll have to grab the robot's pose topic information from 10-20ms in the past for accurate calculation.
Basically I want to sync the topics which have different refresh rates and delays. What is the best way to do this in ROS?