Routine to remove obstacles from costmap not working well

asked 2022-07-25 06:27:23 -0500

FFelizpe gravatar image

Hello there, good morning!

I have a robot here I'm using to navigate with move_base. After a lot of trouble trying to find out why was it walking weirdly - like, walking like someone was pushing it, stopping at times -, I started the whole navigation from scratch to see if I could find the problems. The navigation was fine, until I added one routine - the one that cleared the costmap.

The thing is - we were very confused a while ago on how to apply this routine correctly. The robot doesn't navigate right if this routine is not applied, letting a trace of itself as it navigates through the map. In the end, what we found was that there is a command on terminal that can remove these traces, effectively clearing the costmap:

rosservice call /move_base/clear_costmaps "{}"

However, due to the nature of the message - empty - we could not publish it as a rosservice message in the script. To go around that, we decided to instead do a Python script and execute this on the os every two seconds. It worked! So we just left it at that and kept developing.

Well, turns out, that's probably the main reason the robot navigates weirdly and stopping at times.

So I've been looking for an alternate solution. It seems that essentially executing a terminal command at every two seconds ends up being rather costly for the processor. Is there some better way I can do this and clear my costmap? I'm using ROS Kinetic on a Lubuntu 16.04.

Thanks a lot in advance!

edit retag flag offensive close merge delete