locusrobotics / robot_navigation

Spiritual successor to ros-planning/navigation.
444 stars 149 forks source link

[nav_core_adapter] bugfix: resetMap -> resetLayers #49

Closed ompugao closed 4 years ago

ompugao commented 4 years ago

when a user load costmap_2d plugins with nav_core_adapter, 'costmap_2d::Costmap2D::resetMap' does not reset plugins' costmaps. instead, we need to use 'costmap_2d_ros::Costmap2DROS::resetLayers'.

we can mimic the way move_base does: https://github.com/ros-planning/navigation/blob/melodic-devel/move_base/src/move_base.cpp#L333

implementation of resetLayers: https://github.com/ros-planning/navigation/blob/melodic-devel/costmap_2d/src/costmap_2d_ros.cpp#L557

DLu commented 4 years ago

Thanks for the contribution!