Ask Your Question

What is the correct way to connect two tf trees?

asked 2013-03-19 15:12:25 -0500

I have a setup in which two separate tf trees are published, and I'd like to define one with regard to the other, but not from the base link/root node.

For instance two trees one with a tf_prefix, one without such that you might see:




And I want to define /ghost/linkB0 as having an identity transformation from /linkB0. However, since tf is set up with child and parent relationships as a tree and not as a free network, the correct way to do this is unclear.

The only way I can think to do it would be to rebuild the KDL::Tree that the sub-ordinate tree's RobotStatePublisher uses to originate at the desired link, but this would be non-trivial, and not offer a way to easily select a different link at will without doing the same thing for each desired combination.

Is there a better way to do this? Is it even possible given the current architecture?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2013-03-19 15:33:31 -0500

tfoote gravatar image

Your instincts are correct you can simply add a transform from "/baseLink" to "/ghost/baseLink". The graph structure is independent of the names of the frames.

edit flag offensive delete link more



Problem is that I want to go from /linkA0 to /ghost/linkA0 which cause /ghost/linkA0 to have two parents and fail. I'm working on a work-around where I publish the transfrom from /ghost/linkB0 to /ghost/baseLink as the transform from /linkB0 to /ghost/baseLink to get the same effect.

Asomerville gravatar image Asomerville  ( 2013-03-19 16:01:06 -0500 )edit

Just publish the link the other direction so it's a child, not a parent. You cannot bridge in the middle of a tree.

tfoote gravatar image tfoote  ( 2013-05-27 09:23:06 -0500 )edit

answered 2013-03-20 01:59:40 -0500

Claudio gravatar image

If I got what you want correctly: get the tf from the /base_link to /linkB0 and the tf from /ghost/base_link to /ghost/linkB0 and resolve to have the inbetween tf match an identity.

Either you make the nodes you want to manage the trees' roots or you resolve the inverse kinematics.

edit flag offensive delete link more


This is pretty much the work-around I cam up with as well, but it's still a bit off as if certain transforms are updated more frequently than others, there will be more error than if the chain flowed from /linkB0 to /ghost/linkB0

Asomerville gravatar image Asomerville  ( 2013-03-20 04:57:42 -0500 )edit

What time difference are you seeing? At 50Hz on a wifi I sometimes see delays of half a second and tf view_frames requires multiple runs before drawing the correct trees. So it may well be normal that you have delays sometimes.

Claudio gravatar image Claudio  ( 2013-03-20 06:47:00 -0500 )edit

It's not a measured one difference but inferred. If I publish the transform from /linkB0 to /ghost/baseLink and the joint between /ghost/linkB0 and /ghost/link0 changes before the next update to from /linkB0 to /ghost/baseLink, all transforms in the /ghost/ tree will be incorrect.

Asomerville gravatar image Asomerville  ( 2013-03-20 09:45:04 -0500 )edit

answered 2013-03-20 02:13:16 -0500

dornhege gravatar image

You could add a transform /base_link -> /ghost/base_link or a common /world parent for both. The problem is that you'll need to compute that based on the trees.

It's the same way that SLAM algorithms provide /map -> /base_link by computing /map -> /odom.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-03-19 15:12:25 -0500

Seen: 2,988 times

Last updated: Mar 20 '13