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

Debugging tf frame with multiple parents

asked 2020-01-16 02:45:04 -0500

Rufus gravatar image

updated 2020-01-16 20:38:38 -0500

This is usually a combination of 2 problems

  • Multiple nodes to be publishing a transform of a frame (i.e. nodeA publishes /map -> /odom and nodeB publishes /map -> /odom) (EDIT: Turns out this is not an error)
  • Multiple parent frames are published for the same child frame (something publishes /map -> /odom while something else publishes /world -> /odom)

It seems that the usual methods for debugging tf tree don't help in this situation. Is there any way to help isolate this problem?

In particular, how would one go about finding which is the offending node?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2020-01-17 13:42:19 -0500

gvdhoorn gravatar image

updated 2020-01-17 13:46:37 -0500

I believe roswtf has a tf plugin which checks -- among other things -- reparenting of frames.

Link to the ROS wiki: wiki/tf: roswtf plugin:

roswtf tf comes with a plugin for roswtf that automatically runs whenever you run roswtf. This plugin will analyze your current tf configuration and attempt to find common problems. To run, just invoke roswtf normally:

$ roswtf

Which would seem to be what you are asking.

The wiki page doesn't explain what actually is checked, but from the code:

  • time deltas ("Received out-of-date/future transforms")
  • reparenting of frames
  • cycle detection
  • multiple authority (this would help with multiple broadcasters sending out the same frames)
  • "no msgs" (ie: are there any TF messages being published)
  • unnormalised quaternions

Link to the various error / warning messages: here.

edit flag offensive delete link more

Comments

And roswtf may not mean what you think it does: #q277428 (and #q285116, a bit).

gvdhoorn gravatar image gvdhoorn  ( 2020-01-17 13:48:05 -0500 )edit

huh, good to know :-)

stevemacenski gravatar image stevemacenski  ( 2020-01-17 13:58:00 -0500 )edit

Happened to remember using it some time (a long time) ago.

I feel roswtf doesn't get the love/attention it deserves. It's saved me quite a few times.

gvdhoorn gravatar image gvdhoorn  ( 2020-01-17 14:00:52 -0500 )edit
0

answered 2020-01-16 13:05:25 -0500

That would be true - that's considered an error condition to have 2 parents of a child. TF is a "tree" as you mention, so it needs to follow a tree structure. You will need to modify your frames to remove this cycle in the tree.

In terms of multiple publishers: that's totally allowed, you can do that. However if these 2 nodes aren't working together or aren't fusing their outputs, then I imagine you're going to have some shaking / inconsistencies. If that is your issue, then the same way, you need to modify your tree or fuse them together for a single output frame transformation.

edit flag offensive delete link more

Comments

Thanks for the response! Yes, I am aware that it is an error, however, what I'm trying to find out is, in the event that I made the error of creating a frame with multiple parents, how would I go about finding out which node is causing this problem. Since from what I found, all the TF visualization tools only visualize the TF as a tree, hence hiding the problem of multiple parents.

Rufus gravatar image Rufus  ( 2020-01-16 20:37:34 -0500 )edit

Uh - mhm - I think you just need to go through your code. I'm not sure there's some silver bullet answer to that question. When you see that error popping up, you should be seeing that in the effected processes. I can't imagine you have too many things publishing to odom, find them all and figure out a solution.

I know that's not incredibly helpful.

stevemacenski gravatar image stevemacenski  ( 2020-01-16 21:59:44 -0500 )edit

Hey how were you able to solve this problem? I am facing the same issue when using robot_localization node, it is publishing the tf into the base_link which is clashing with my odometry data(which is also publishing tf of the base_link)

pavan_c gravatar image pavan_c  ( 2022-11-22 17:43:10 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2020-01-16 02:45:04 -0500

Seen: 646 times

Last updated: Jan 17 '20