feat(move_base2): direction zone delivery and costmap readiness wait

- SensorGateway::pushStaticMap also dispatches to DIRECTIONAL_LAYER on
  the global costmap, before STATIC_LAYER: with a same-geometry map the
  directional layer goes PENDING before StaticLayer can report current,
  so a plan cannot pair the new map with the old zones.
- Static maps are replayed in arrival order instead of topic order, so a
  direction grid is never replayed before its static map.
- PlannerRunner checks every enabled global layer under the same lock as
  the snapshot. While a layer is not current it keeps the goal, reports
  waiting_for_costmap, logs the stale layers (throttled) and spends no
  planner_patience or watchdog budget. After costmap_ready_timeout [s]
  (default 10, 0 = legacy behaviour) the attempt fails as before. The
  key is added to config/runtime/move_base_common_params.yaml.
- Test fixture destroys the server before its fake ports (the control
  thread could call a destroyed port).

Full history: branch feature/direction-zone.
This commit is contained in:
2026-11-04 13:24:16 +07:00
parent 75af8ccf12
commit 051e18f989
21 changed files with 483 additions and 31 deletions

View File

@@ -276,6 +276,12 @@ void SensorGateway::pushStaticMap(const std::string& name, const robot_nav_msgs:
}
ScopedSection timer(telemetry_, section_static_map_);
// DirectionalLayer TRƯỚC StaticLayer, có chủ đích. Layer tự lọc theo topic: map_topic chỉ đưa nó về
// PENDING (không cần geometry), direction_topic là grid hướng (StaticLayer bỏ qua, nên trong cùng
// lần gọi không có resize nào). Nếu StaticLayer nhận map trước, giữa hai lần dispatch updateMap có
// thể ghi xong map mới và StaticLayer báo current trong khi field hướng cũ vẫn READY — planner kiểm
// readiness đúng lúc đó sẽ plan theo map mới với zone cũ. Chỉ global costmap có layer này.
dispatchTo(global_costmap_, map, robot_costmap_2d::LayerType::DIRECTIONAL_LAYER, name, stats_);
dispatchTo(global_costmap_, map, robot_costmap_2d::LayerType::STATIC_LAYER, name, stats_);
dispatchTo(global_costmap_, map, robot_costmap_2d::LayerType::PREFERRED_LAYER, name, stats_);
dispatchTo(global_costmap_, map, robot_costmap_2d::LayerType::UNPREFERRED_LAYER, name, stats_);