feat(sensor_gateway): đẩy static map sang PreferredLayer và UnpreferredLayer

pushStaticMap trước đây chỉ dispatch tới STATIC_LAYER, nên PreferredLayer và
UnpreferredLayer — hai layer cũng ăn OccupancyGrid từ topic /map (namespace
riêng) — không bao giờ nhận được dữ liệu qua SensorGateway. Kết quả: khai layer
trong plugins: nhưng costmap vẫn trống ở vùng preferred/unpreferred.

Thêm dispatch cho cả hai layer trên global và local costmap. dispatchTo lọc theo
LayerType và bỏ qua khi không tìm thấy layer nào khớp, nên cấu hình không khai
hai layer này vẫn chạy y như cũ (no-op, không thêm chi phí đáng kể ngoài một
vòng lặp trên danh sách plugin).

LayerType::PREFERRED_LAYER và UNPREFERRED_LAYER đã có sẵn trong
robot_costmap_2d tại commit a63c084 (bản mà rb_ws đang trỏ tới), nên không sinh
phụ thuộc vào code chưa publish.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-09 13:47:17 +07:00
parent b84b76766d
commit 350b1b7f8e

View File

@@ -275,7 +275,12 @@ void SensorGateway::pushStaticMap(const std::string& name, const robot_nav_msgs:
ScopedSection timer(telemetry_, section_static_map_);
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_);
dispatchTo(local_costmap_, map, robot_costmap_2d::LayerType::STATIC_LAYER, name, stats_);
dispatchTo(local_costmap_, map, robot_costmap_2d::LayerType::PREFERRED_LAYER, name, stats_);
dispatchTo(local_costmap_, map, robot_costmap_2d::LayerType::UNPREFERRED_LAYER, name, stats_);
}
void SensorGateway::pushLaserScan(const std::string& name, const robot_sensor_msgs::LaserScan& scan)