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

tf fixed transforms

asked 2016-11-09 19:23:56 -0500

Venkat Ganesh gravatar image

updated 2016-11-10 11:02:33 -0500

Hello ROS users,

I'm slightly confused about how TF handles transforms.

I'm using the tf::TransformBroadcaster class in a node called tf_broadcaster_node for publishing transforms to TF, resulting in the following TF tree:

image description

These frames have fixed transforms (only rotations), represented below as RPY(in degrees) :

  • base_link --> camera_frame : Rotation (-90, 0, 50)

  • camera_frame --> bundler_camera_frame : Rotation is (0, 180, 0)

I also have a tf_listener_node which is used to query and print these transforms from TF. My expectation was that the fixed-value transforms will be printed exactly as defined above. However, I was surprised to note that they were different:

image description

Question : Why do the fixed transform values differ from their definitions?

I'd appreciate any assistance in helping me understand TF better. Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2016-11-10 00:10:44 -0500

rbbg gravatar image

updated 2016-11-10 00:46:21 -0500

Hi Venkat,

As you might be aware, a rotation can be expressed in several different representations. RPY is often used as it is fairly easy to visualize and recognize what the rotation is, but it has some problems with regards to singularities. Under the hood, TF uses quaterions, which means that if you are broadcasting and listening to a transform in euler angles like RPY, it will have to translated to and from quaternions. A single rotation can be expressed in several different set of RPY angles, for instance, a Pitch of 180 degrees is identical to first a roll of 180 degrees and then a yaw of 180 degrees (Like your camera_frame --> bundler_camera_frame) For your base_link --> camera_frame, it also works out.

An easy way to check that the transforms are what you intend for them is to use the TF plugin in RVIZ. If they are not what you intended, there is another problem, but I suspect this was the root cause.

edit flag offensive delete link more

Comments

Thanks! The rotation convention I've followed is:

  • (yaw around Z, then pitch around new Y, then roll around new X)

I assume you are talking about rotating around fixed X, Y, Z axes?

Venkat Ganesh gravatar image Venkat Ganesh  ( 2016-11-10 17:12:01 -0500 )edit

Please view this link to get a better idea of my API usage.

Venkat Ganesh gravatar image Venkat Ganesh  ( 2016-11-10 17:12:19 -0500 )edit

I don't know which convention you are using, but this is the reason for the difference. The quaternion api mentions RPY around fixed axis for the setRPY function.

rbbg gravatar image rbbg  ( 2016-11-10 23:59:46 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2016-11-09 19:23:56 -0500

Seen: 668 times

Last updated: Nov 10 '16