Clear costmaps from within local planner
I am implementing a local planner plugin for move_base. Under certain conditions I would like to clear the costmaps (both local and global) from within this planner. This turned out to be more complicated than expected:
- From within the planner I don't have access to the global costmap, so I cannot simply use the costmap API.
- Using the service
/move_base/clear_costmaps
does not work as it blocks the planner (probably because the service is called from the same node that provides it).
The best idea I had so far is writing a separate node that provides an action to call the service... But I am hoping that there is a less hacky way. Any ideas?