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

Why does TF use strictly a tree?

asked 2021-11-03 13:24:37 -0600

Thodoris Tyrovouzis gravatar image

It surprised me that it is impossible for a frame to have multiple parents. I understand that TF graphs should not contain cycles but is there a specific reason TF does not use an acyclic graphs internally?

This is limiting in the common scenario, where in a simulated environment, one may want to provide a simulated noisy odometry source, and a ground truth that both have the robot's base frame as child at the same time.

edit retag flag offensive close merge delete

Comments

I've always considered/believed the fact that KDL (now: orocos_kinematics_dynamics) doesn't/didn't support anything but tree structures to be the main reason. If the solver you're using doesn't support it, then it makes sense for the data structure to also not have support for it.

Additionally, lookups can be very efficiently implemented in trees, while arbitrary graphs can make this quite complex.

But I'm not an authoritative source here -- so just a comment.

Perhaps @tfoote knows/remembers.

gvdhoorn gravatar image gvdhoorn  ( 2021-11-03 13:33:17 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-11-03 14:40:56 -0600

tfoote gravatar image

updated 2021-11-03 14:42:32 -0600

Yes, it's basically much faster to search, it can never get into an invalid state such as a cycle which is unresolvable.

There's a lot more details in the paper https://wiki.ros.org/Papers/TePRA2013...

Your case with two sources of odometry a ground truth and an estimate cannot be queried generically as you are now in a case where there are two resolutions for every potential leaf depending on how you traverse the graph. And if you try to fuse the two results you'll just get some weird in between state that's meaningless.

In this case you should choose which is going to be your primary and hang the alternative odometry frame off as a child not a parent. Then you can query to or from that semantically meaningful frame if you want to reference it, but all queries not specifically referencing that frame will use the same consistent tree.

Specifically for acyclic graphs, they're more expensive to search and require maintenance/checking to make sure that they stay acyclic.

edit flag offensive delete link more

Comments

Thank you for this explanation and the paper is a great read.

osilva gravatar image osilva  ( 2021-11-03 18:34:39 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2021-11-03 13:24:37 -0600

Seen: 167 times

Last updated: Nov 03 '21