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.
7.6 KiB
7.6 KiB