ros-planning / navigation

ROS Navigation stack. Code for finding where the robot is and how it can get somewhere else.
2.36k stars 1.8k forks source link

Move Base: Does clearCostmapsService reset the costmap in planner_? #1162

Open Ducanor opened 3 years ago

Ducanor commented 3 years ago

Hi, im using move base as global planner in a training procedure with multiple randomly generated ros maps. I publish the ros maps to the topic "map" and use the clearCostmapsService afterwards. The costmap gets reset successfully and adapts to the new published map. The problem is the behavior of the global planner. Sometimes the global plan runs through walls (2-3 out of 10 times). Screenshot 2021-08-13 162259 My guess is that while the clearCostmapsService resets the global controller_costmap_ros_ and planner_costmap_ros_, it does not change the planner_costmap_ros_ in planner_ (used while initialization).

I also checked whether the global planner works properly without changing maps and yes it does. 100 % of the global plans generated by move base when only using the same randomly generated map are correct and efficient.

I searched the github repo but could not find where planner_->makePlan(...) was defined and thus could not understand the way makePlan(...) works and what role planner_costmap_ros_ plays in there.

Im thankful for any advices!

mikeferguson commented 3 years ago

There is only a single instance of the global costmap AFAIK - so this sounds more like it might be a locking issue where the costmap is not properly locked during the full update of the costmap?