tf fixed transforms

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:

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:

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 close merge delete

Sort by » oldest newest most voted

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.

more

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?

( 2016-11-10 17:12:01 -0500 )edit

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

( 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.

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