feat(sensor_gateway): deliver static map grids to the directional layer

pushStaticMap now also dispatches to DIRECTIONAL_LAYER on the global costmap, after STATIC_LAYER so the master is already resized to the new map when the directional layer checks a direction grid against it. The layer filters by topic: map_topic resets it to PENDING, direction_topic carries the direction grid.
This commit is contained in:
2026-11-03 16:57:01 +07:00
parent 75af8ccf12
commit f85d89ef8c

View File

@@ -279,6 +279,10 @@ void SensorGateway::pushStaticMap(const std::string& name, const robot_nav_msgs:
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_);
// Sau STATIC_LAYER có chủ đích: StaticLayer resize master theo map mới ngay trong callback, nên
// DirectionalLayer kiểm geometry của grid hướng trên master đã đúng kích thước. Layer tự lọc theo
// topic: map_topic đưa nó về PENDING, direction_topic là grid hướng. Chỉ global costmap có layer này.
dispatchTo(global_costmap_, map, robot_costmap_2d::LayerType::DIRECTIONAL_LAYER, name, stats_);
dispatchTo(local_costmap_, map, robot_costmap_2d::LayerType::STATIC_LAYER, name, stats_);
dispatchTo(local_costmap_, map, robot_costmap_2d::LayerType::PREFERRED_LAYER, name, stats_);