Robotics StackExchange | Archived questions

callback / trigger on tf

Hi

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?

Asked by Markus Bader on 2018-11-06 08:57:42 UTC

Comments

Answers

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.

Asked by tfoote on 2019-07-10 19:02:25 UTC

Comments