diff --git a/nav2_costmap_2d/src/costmap_layer.cpp b/nav2_costmap_2d/src/costmap_layer.cpp index 3f9da4013d8..ad488c26185 100644 --- a/nav2_costmap_2d/src/costmap_layer.cpp +++ b/nav2_costmap_2d/src/costmap_layer.cpp @@ -55,6 +55,7 @@ void CostmapLayer::touch( void CostmapLayer::matchSize() { + std::lock_guard guard(*getMutex()); Costmap2D * master = layered_costmap_->getCostmap(); resizeMap( master->getSizeInCellsX(), master->getSizeInCellsY(), master->getResolution(),