feat(directional_layer): rewrite as a direction field provider
DirectionalLayer no longer derives from StaticLayer and never writes the master grid. It receives an OccupancyGrid of direction codes (0 = no constraint, 1..8 = direction_index + 1) on direction_topic, validates it against the master geometry and global frame, and publishes an immutable DirectionField snapshot with a DISABLED / PENDING / READY state and a generation counter. Every static map on map_topic drops the snapshot and returns the layer to PENDING until a grid for that map arrives. direction_field.h holds the core API used by planners: grid validation, DirectionField with bounds-checked codeAt(), a half-open-cell DDA (traverseGridSegment), allowedDirectionMask() and checkSegment(). LayeredCostmap::getDirectionFieldSnapshot() exposes the snapshot through the DirectionFieldProvider interface without adding data members. Tests: direction_field_test (7) and directional_layer_test (5) pass.
This commit is contained in:
15
config/directional_layer_params.yaml
Normal file
15
config/directional_layer_params.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
# Mặc định đóng gói của directional layer; cây chạy thực tế tùy host là
|
||||
# pnkx_nav_core/src/Navigations/Packages/move_base2/config/runtime hoặc
|
||||
# pnkx_nav_core/config.
|
||||
directional_layer:
|
||||
# Bật: sau mỗi static map, layer PENDING đến khi nhận grid hợp lệ và planner
|
||||
# phải từ chối lập đường trong lúc chờ. Host phải gửi grid sau mỗi static map;
|
||||
# dùng data rỗng nếu map không có zone. Tắt để bỏ ràng buộc hướng.
|
||||
enabled: false
|
||||
# Phải trùng map_topic của StaticLayer. Đặt sai khiến layer không thoát
|
||||
# PENDING hoặc không nhận biết khi map đổi.
|
||||
map_topic: "map"
|
||||
# Topic grid hướng: đổi theo tên host gửi; phải khác map_topic.
|
||||
direction_topic: "direction_map"
|
||||
# Bật để ghi log chuyển trạng thái; tắt để giảm log bình thường.
|
||||
debug_state: true
|
||||
Reference in New Issue
Block a user