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

multiple messages sync with tf

asked 2011-12-16 05:42:17 -0600

Akin gravatar image

updated 2011-12-16 06:55:09 -0600


I am trying to write a callback where two topics and tf are synchronized. For example I want to have an image, a pointcloud and tf at the same time.

I inspired from the piece of code below, which deals with one topic and tf. Does anybody know how to extend tf:MessageFilter to two or more topics?


 tf::TransformListener tf_;
 tf::MessageFilter<sensor_msgs::PointCloud2> * tf_filter_;
 message_filters::Subscriber<sensor_msgs::PointCloud2> cloud2_sub_;

cloud2_sub_.subscribe(n, "/kinect/rgb/points2", 10);
tf_filter_ = new tf::MessageFilter<sensor_msgs::PointCloud2>(cloud2_sub_, tf_, "/map", 10);
tf_filter_->registerCallback( boost::bind(&PointReader::pointCloudCallback, this, _1) );

void pointCloudCallback(const sensor_msgs::PointCloud2::ConstPtr& sensor_msg)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-01-01 05:55:51 -0600

tfoote gravatar image

The tf::MessageFilter is based on the core message_filter package which can be used to do what you want.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2011-12-16 05:42:17 -0600

Seen: 1,341 times

Last updated: Jan 01 '12