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

Why should both use joint_states and transform

asked 2017-01-05 20:29:07 -0500

shawnysh gravatar image

I wonder now that both robot_state_publisher and transform_broadcaster send kinematics information to /tf topic, why should we use both? I think I must misunderstand sth, though I have gone through tf and urdf tutorial.

Here is the link where it makes r2d2 robot move with using robot_state_publisher and sendTransform Tutorial: using urdf with robot_state_publisher

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-01-06 02:48:46 -0500

rbbg gravatar image

Hi Shawnysh,

As I think you are aware, the robot_state_publisher is used to publish the state of the robot to tf. It publishes the transforms between the links as a function of the joint states.

The sendTransform is used to publish a transform from odom to axis, which happens to be the root frame of the robot. As you can see in the code, this is done such that axis performs a circular motion around odom. If you then choose odom as your fixed frame (as noted in the last step for the linked tutorial) you will see the robot move around the origin. As robot_state_publisher only publishes the transforms between the links, they are also updated for a moving 'base' frame (in this case: axis).

Alternatively, if you would select axis as your fixed frame, the robot will make the same motions, but not move in a circular pattern.

I hope that clears things up.

edit flag offensive delete link more

Comments

Thanks a lot. It helps!

shawnysh gravatar image shawnysh  ( 2017-01-06 06:10:43 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-01-05 20:29:07 -0500

Seen: 197 times

Last updated: Jan 06 '17