Skip to content

Commit 2edfb83

Browse files
author
Matthew Hansen
committed
Set map_received to true
1 parent 090ddc7 commit 2edfb83

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

nav2_costmap_2d/plugins/static_layer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ StaticLayer::getParameters()
139139

140140
// Enforce bounds
141141
lethal_threshold_ = std::max(std::min(temp_lethal_threshold, 100), 0);
142+
map_received_ = false;
142143
}
143144

144145
void
@@ -241,6 +242,9 @@ StaticLayer::incomingMap(const nav_msgs::msg::OccupancyGrid::SharedPtr new_map)
241242
{
242243
std::lock_guard<Costmap2D::mutex_t> guard(*getMutex());
243244
processMap(*new_map);
245+
if (!map_received_) {
246+
map_received_ = true;
247+
}
244248
}
245249

246250
void

0 commit comments

Comments
 (0)