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

callback / trigger on tf

asked 2018-11-06 07:57:42 -0500

Markus Bader gravatar image

updated 2018-11-06 09:37:33 -0500


I would like to get trigger something if a transformation has changed.

For example map ->odom -> base_link.
One solution would be to subscribe to the tf msgs and to all the work but is there a better way?

I the case of map -> odom -> base_link I could listen to the odom msg (Motor controller) and pose msg (localization) but that is not what I want.

I also want an update even the transformation has not changed meaning i want a trigger if one of the tf's in the tf-chain was re-published.

Any suggestions?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-07-10 19:02:25 -0500

tfoote gravatar image

These are not standard conditions that have tools available for them.

My first approach to solving this would be to do the following:

  • Determine the spanning set of frames that you're interested in
  • Subscribe to the tf topics and look for new information on frames in you spanning set
  • If there are new frames of interest query a TransformListener for the resultant transform.
  • Keep the last result and publish the result if it's more than some tolerance threshold.

In you second case you could set the tolerance to zero so that it always publishes if there's a new frame information even if it's the same.

edit flag offensive delete link more

Question Tools



Asked: 2018-11-06 07:57:42 -0500

Seen: 414 times

Last updated: Jul 10 '19