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

local_costmap "ghost objects"; Restarting move_base

asked 2017-07-26 19:01:35 -0500

xnick77x gravatar image

Hey all,

I am running the ROS naviagation stack with a 360 degree lidar. After running a couple paths. the local costmap from the lidar seems to fill up with "ghost objects" until the robot can no longer generate a path to the destination. I looked for methods to clear or reset to local costmap, but didn't find much on it, so my new approach is to restart the move_base node.

I want to restart the move_base node from where I send the action_lib goal, so that the local_costmap can restart. I found this; however I have not found out how to set parameters for the node. I also would prefer not to write the path to the .launch file (the second example) to avoid having to manually write the path on each new robot/system.

TLDR; Is there a method to clear the local costmap? Or is there a good way to restart the move_base node programmatically from where I send an actionlib goal?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2017-07-27 01:03:58 -0500

Procópio gravatar image

Yes, there are better ways to clear the costmaps. From the command line you can:

rosservice call /move_base/clear_costmaps

And you can also call servcies from your code, as explained here.

I also suggest you create another question with more details about the "ghost objects", with images and your costmap configurations, so maybe you can address the origin of your problem.

edit flag offensive delete link more


Hi, does this clear both costmaps? Or only the local costmap? I think even if it clears both, the global costmap upon reinflation would be identical to previous one, so effectively only the local costmap would be reset. Do you think this is true?

parzival gravatar image parzival  ( 2021-04-06 03:23:19 -0500 )edit

answered 2017-11-15 05:08:46 -0500

biglotusturtle gravatar image

updated 2017-11-15 16:29:06 -0500

jayess gravatar image

For anyone looking how to do this via c++, here you go:

std_srvs::Empty emptymsg;
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-07-26 19:01:35 -0500

Seen: 1,412 times

Last updated: Nov 15 '17