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?
Asked by uwleahcim on 2016-05-24 03:34:26 UTC
Answers
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 [..] Now I'll have to grab the robot's pose topic information from 10-20ms in the past for accurate calculation.
Wouldn't TF do this for you automatically (provided the timestamp on the detected objects is set to the timestamp of the image that formed the input to your detection algorithm)? See the Time travel with tf2 tutorial (Python or C++).
Basically I want to sync the topics which have different refresh rates and delays. What is the best way to do this in ROS?
I feel this is not really your issue, but this is typically done using the ApproximateTime filter from the message_filters package.
Asked by gvdhoorn on 2016-05-24 04:06:34 UTC
Comments