Edit:
Does "send a transformation from the child to the parent frame" actually mean that tf
sends e.g. a homogenous matrix representing the transformation (i.e. rotation and orientation) of a point in the local frame of the child to a point in the local frame of the parent, or is it vice-versa, or something else?
I would say this is more what the various transformX(..)
methods in TF do. The TransformBroadcaster
really only updates the transformation matrices that you refer to (but they're not encoded as matrices, but as separate Vector3
and Quaternion
).
re-reading your question you might actually be saying the same as I was. The TransformBroadcaster
is not about points, but the transformation matrices themselves. If that is what you were describing, then yes, that is what it is doing. The transformX(..)
methods in TF(2) then use those to do the actual transformation of points between those frames.
Could this be a misinterpretation / misquote of the docs? "Broadcasting" is the word used in the docs. This just means: sending a msg to all who are/will listen. "Sending to" implies there is some unidirectional transfer going on. TF does not send anything "from X to Y" (well, the TransformBroadcaster
does, but at a different level perhaps).
The example you show just broadcasts a single message that contains the information about a single transform "from the child to the parent frame". It's a piece of information that TF listeners will use to update their tree of transforms.
The "child" and "parent" are just labels (ie: names for humans), not entities in a ROS node graph (ie: nodes or similar active constructs) that receive or send any messages.
From the same docs on TransformBroadcaster
:
TransformBroadcaster
is a convenient way to send transformation updates on the "/tf"
message topic.
All the methods in this class do is send out messages (geometry_msgs/TransformStamped) that inform listeners about a single or multiple edge(s) in the TF tree. Between each node a transformation matrix exists. For new transforms, an edge is added and the matrix attached. For existing transforms, the matrix is updated.
Originally posted by gvdhoorn with karma: 86574 on 2018-04-12
This answer was ACCEPTED on the original site
Post score: 2
Original comments
Comment by nbro on 2018-04-12:
Sorry, I am asking about the transformation itself which is sent, not to whom or to which topic it is sent.
Comment by gvdhoorn on 2018-04-12:
I believe I touched on that with the last paragraph.
You ask about TransformBroadcaster
. That class inherently has to do with topics and msgs, because that is what is used to broadcast this information.
"a transformation" is not a thing in TF. Transforms are broadcast, those contain ..
Comment by gvdhoorn on 2018-04-12:
.. translations and rotations in separate fields (but conceptually the same as the matrix you're referring to).
So to broadcast a transform is to publish a msg that contains that information. That is then used by listeners to insert or update edges in their local view of the tree.
Comment by nbro on 2018-04-12:
@gvdhoorn Ok, thanks, it starts to make more sense. I think we should add this "verbose" but, IMHO, helpful description/explanation to the documentation of those methods so that we don't have to click a few times to infer what those methods do.
Comment by gvdhoorn on 2018-04-12:
It's all open-source. There is a good chance an update to the documentation submitted in a PR would be accepted. For TF, the sources are here. For TF2 here.
Note that TF (not TF2) is deprecated.
Comment by nbro on 2018-04-12:
You're saying that TransformStamped
s, which are sent, already exist, and we only update them using sendTransform
. However, in this tutorial, http://wiki.ros.org/tf/Tutorials/Adding%20a%20frame%20%28Python%29, a new local frame is created using sendTransform
...
Comment by gvdhoorn on 2018-04-12:
TransformStamped
is just the msg containing the information. The internal data structure may be different. Doesn't matter, as long as the information (ie: transform) is retained.
re: new or existing: doesn't matter. Both can be done. Each broadcaster notifies listeners that it has ..
Comment by gvdhoorn on 2018-04-12:
.. (potentially) new information. If the listener already knew about the transform (ie: received msgs about it earlier), then it updates its internal view of the tree. If it's new, it incorporates the new info (ie: add edge(s)).
Comment by gvdhoorn on 2018-04-12:
This reminds me of a question about two weeks ago (can't find it). The OP there also asked about "when do TF frames 'exist'".
Thing is, they don't really. It's (conceptually) just a big tree of vertices and edges with transform matrices attached (it's not really necessarily, but it helps).
Comment by gvdhoorn on 2018-04-12:
It's perfectly ok for a listener to have only a partial view of the big, global tree. It'll just mean that if you ask it to transform between frames it hasn't heard about, you'll get a LookupException
.
If your TF tree has missing edges, that's a problem too.