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

Disagreement between TransformStamped comment and sendTransformMessage?

asked 2023-07-04 09:59:05 -0600

specarmi gravatar image

The comment in the TransformStamped message states:

This expresses a transform from coordinate frame header.frame_id to the coordinate frame child_frame_id

While the sendTransformMessage function documentation states:

Broadcast the transformation from tf frame child to parent on ROS topic "/tf".

In my experience the sendTransformMessage documentation is correct, i.e. the transform is from the child frame to the parent frame, and it appears the comment in the TransformStamped is backwards. This caused me a lot of confusion and I'm sure I'm not the only one. Is my interpretation correct? Should the TransformStamped message comment be corrected?

Side note: I know the links above are from different versions of ROS. I'm using noetic but can't seem to find complete documentation for noetic's tf2 python implementation. I'm assuming the documentation given above is true for sendTransform in noetic, and my own testing has confirmed this.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2023-07-05 19:34:44 -0600

tfoote gravatar image

The problem that you're seeing is that the value of the transform depends on what the object is that you are applying the transform, the data in frame A or the frame itself.

The sendTransform documentation is ambiguous and references the data transform, whereas the message is not and fully references the frame. The sentTransform documentation could be made more explicit to do this differentiation.

There's a duplicate question and answer here:

People most often encounter this in lookup vs echo:

edit flag offensive delete link more

answered 2023-07-05 09:25:17 -0600

Mike Scheutzow gravatar image

updated 2023-07-05 09:28:36 -0600

I think that both comments are correct, assuming you distinguish a subtle difference between the words "transform" and "transformation".

The pose in the TransformStamped message describes the pose of the child frame within the parent frame. For example, using standard xy axes and identity quaternion, the msg value transform.translation.x = 1 places the child_frame origin to the right of the parent_frame origin. The TF Tree clearly describes a parent to child relationship.

The terminology gets less clear if your goal is to convert a child pose into the equivalent parent frame pose. You can reformat the TF msg as an equivalent homogeneous 4x4 matrix M and use this linear algebra equation:

pose_in_parent = M * pose_in_child

If you expect to use this equation, then M can be interpreted as providing a "transformation" operation from child_frame to parent_frame, which is what that second comment is describing.

edit flag offensive delete link more


My understanding is that "transform" is just used as a shorthand for "transformation" in ROS. For what it's worth, this foxglove blogpost states this directly. Also, I agree there are subtleties and sometimes ambiguity with phrases like "pose of frame A in/within frame B" or "pose of frame A w.r.t. frame B," but in this case both sources use the phrasing "transform[ation] from frame A to B," which I have always taken to mean that expressing it as a homogeneous 4x4 matrix T_A_to_B the following is satisfied: p_B = T_A_to_B * p_A, where p_A is a homogeneous point coordinate expressed in frame A. Can you clarify again the distinction you view between the phrasing "transform from frame A to B" and "transformation from frame A to B," or point to ROS documentation clarifying this distinction? Apologies if I have just gotten myself turned around somehow

specarmi gravatar image specarmi  ( 2023-07-05 10:12:09 -0600 )edit

Question Tools



Asked: 2023-07-04 09:54:19 -0600

Seen: 44 times

Last updated: Jul 05