feat(static_layer): report current only after the map reaches the master
current_ is false before the first map, after every new map, update or resize, and becomes true only once updateCosts has written the map (shared markMapWritten helper, also called by CriticalLayer). Readiness flags are written under the master mutex so the planner can trust isCurrent() taken under the same lock. Invalid partial updates are rejected with a throttled error.
This commit is contained in:
@@ -30,6 +30,7 @@ void CriticalLayer::updateCosts(robot_costmap_2d::Costmap2D& master_grid, int mi
|
||||
StaticLayer::CostmapLayer::updateWithOverwrite(master_grid, min_i, min_j, max_i, max_j);
|
||||
else
|
||||
updateWithMax(master_grid, min_i, min_j, max_i, max_j);
|
||||
markMapWritten(min_i, min_j, max_i, max_j);
|
||||
|
||||
}
|
||||
|
||||
@@ -42,4 +43,4 @@ static boost::shared_ptr<Layer> create_critical_plugin() {
|
||||
BOOST_DLL_ALIAS(create_critical_plugin, CriticalLayer)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user