Skip to content

Commit

Permalink
CostmapLayer::matchSize may be executed concurrently (ros-navigation#…
Browse files Browse the repository at this point in the history
…3250)

* CostmapLayer::matchSize() add a mutex
  • Loading branch information
Cryst4L9527 authored and Joshua Wallace committed Nov 30, 2022
1 parent f3ab862 commit c2f9f0b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions nav2_costmap_2d/src/costmap_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ void CostmapLayer::touch(

void CostmapLayer::matchSize()
{
std::lock_guard<Costmap2D::mutex_t> guard(*getMutex());
Costmap2D * master = layered_costmap_->getCostmap();
resizeMap(
master->getSizeInCellsX(), master->getSizeInCellsY(), master->getResolution(),
Expand Down

0 comments on commit c2f9f0b

Please sign in to comment.