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

Synchronize two subscribed topics

asked 2016-05-24 03:34:26 -0500

uwleahcim gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-05-24 04:06:34 -0500

gvdhoorn gravatar image

updated 2016-05-24 04:40:18 -0500

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.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2016-05-24 03:34:26 -0500

Seen: 681 times

Last updated: May 24 '16