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

Small Confusion about TF

asked 2013-08-09 02:09:25 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

if I have a broadcaster like this:

void pub_odom::odom_callback(const nav_msgs::Odometry& odom) {

btVector3 Position;
btQuaternion Orientation;
tf::TransformBroadcaster odom_broadcaster_;
tf::StampedTransform odom_transform;


odom_transform.stamp_ = odom.header.stamp;
odom_transform.child_frame_id_= "/odom";
odom_transform.frame_id_= "/center_map";

How do I visualise its publication on rviz and tf. Do i have to create something like in my launch file in order to visualise it:

<node pkg="tf" type="static_transform_publisher" name="tf_data" args="1.0 0.0 0.0 0.0 1.0 0.0 /odom /another_link 20" />

WHen I do it with this launch file I can visualise in tf the tranformation between /odom and /another_link and the transformation is based on args I have given in launch file. How do I get the publication based on the broadcaster and the callback function.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-08-09 10:16:29 -0600

BennyRe gravatar image

You can remove the static transform publisher from the launch file, if you want /center_map to be your center in rviz.

In your code do the following:


In rviz select center_map as the fixed frame.

Hope this works.

edit flag offensive delete link more


so I removed the whole line <node pkg="tf" .................=""/> from my launch file. I also added the 2 lines that you mentioned into my code. But when I do rostopic list. It does not list tf as a topic now. Why does it not list tf as a topic. Similarly my view_frames return no tf data now. What should I do ?

micheal gravatar image micheal  ( 2013-08-10 06:17:02 -0600 )edit

Could you please update the code in your question, so I can check, if it's correct? Does your callback get called?

BennyRe gravatar image BennyRe  ( 2013-08-10 21:36:06 -0600 )edit

answered 2013-08-09 09:36:47 -0600

updated 2013-08-09 09:37:13 -0600

You can use view_frame to generate a pdf file and see the tf tree. In rviz you can visualise tf axes based on a fixed frame, commonly /map frame.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2013-08-09 02:09:25 -0600

Seen: 195 times

Last updated: Aug 09 '13