- DirectionalLayer rewritten as a DirectionFieldProvider. It no longer derives from StaticLayer and never writes the master grid. It takes 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 returns the layer to PENDING until a grid for that map arrives. - direction_field.h is the core API for planners: grid validation, bounds-checked codeAt(), a half-open-cell DDA (traverseGridSegment), allowedDirectionMask() and checkSegment(). LayeredCostmap::getDirectionFieldSnapshot() exposes the snapshot without adding data members. - max_deviation_deg (default 90, valid 0 < x < 180). The field carries the value so every planner uses the same rule; 90 keeps the previous masks bit for bit. - StaticLayer ignores an OccupancyGrid addressed to another layer's topic instead of logging two unthrottled errors per push. - StaticLayer and its subclasses report current only after updateCosts has written the newest map (markMapWritten, also used by CriticalLayer). Readiness flags are written under the master mutex; invalid partial updates are rejected with a throttled error. Full history: branch feature/direction-zone.
25 lines
1.6 KiB
YAML
25 lines
1.6 KiB
YAML
# 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"
|
|
# [deg] Góc lệch tối đa giữa hướng di chuyển và hướng zone, tính cả biên.
|
|
# Áp chung cho mọi zone. 90 = được đi mọi hướng có thành phần cùng chiều zone
|
|
# (đi ngang zone được, đi ngược bị cấm).
|
|
# Giảm: robot phải đi sát hướng zone hơn, cấm cắt ngang làn, phải căn hướng
|
|
# trước khi vào zone; quay tại chỗ luôn được phép. Dưới 22.5 (bước heading của
|
|
# mprim 16 hướng) SBPL có thể không tìm được đường.
|
|
# Tăng quá 90: cho phép cả hướng hơi ngược chiều zone, zone một chiều yếu đi.
|
|
# Phạm vi hợp lệ: 0 < giá trị < 180; ngoài phạm vi nav core từ chối khởi động.
|
|
max_deviation_deg: 90.0
|
|
# Bật để ghi log chuyển trạng thái; tắt để giảm log bình thường.
|
|
debug_state: true
|