magazino / move_base_flex

Move Base Flex: a backwards-compatible replacement for move_base
https://uos.github.io/mbf_docs/
BSD 3-Clause "New" or "Revised" License
429 stars 154 forks source link

Controller fails if robot pose gets older than tf_timeout #231

Closed corot closed 3 years ago

corot commented 3 years ago

Current code uses the advanced tf2 interfaces, that returns a pose with stamp 0 (we request time 0 to get the latest available transform when getting robot pose). We then overwrite with time now, what is not realistic. Worse, if localization goes off, getRobotPose will keep providing the latest available tf without any warning. If we are not using costmaps, that means that the robot will keep moving while thinking he's standing!

This PR changes to the simple tf2 interfaces that returns the stamp of the latest available tf, and considers it as non valid if older than tf_timeout. Exe path will fail in that case, and the robot will stop, even if not using costmaps. Moreover, using the simple tf2 interface allows us to simplify in turn the interface of the utility functions.

:warning: Not tested on Kinetic or older that use TF 1. Can anyone do it? :warning: