How to create a node that listens to particular topic and publishes tf
How can I create a node that listens to that particular topic and publishes the required required tf. I have succesfully published data on a topic. Now I want to exhibit it in TF. Do I need a TF broadcaster, something like this
tf::TransformBroadcaster br;
tf::Transform transform;
transform.setOrigin( tf::Vector3(0,0,0));
transform.setRotation( tf::Quaternion(x,y,z,w) );
br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "optical", "base_link"));
Even If I have something like this. How do I listen and display it. Forexample do I need a tf listener to listen to some topic which is publishing data. If thats the case. What would the code look like if my topic is /mytopic