In a rolling (local) costmap the StaticLayer extent is in map_frame_, so the
bounds it reported did not cover the moving master window and zone layers
(forbidden, preferred, unpreferred, critical) were not redrawn as the robot
moved.
- StaticLayer::updateBounds: when the costmap is rolling, expand the bounds to
the whole master window every cycle.
- StaticLayer::updateCosts: skip when disabled; the transformed path uses the
master grid passed in and the same merge policy as the aligned path.
- CostmapLayer::mergeCost: one merge rule for aligned and transformed grids.
NO_INFORMATION in the layer keeps the master cell; CRITICAL_SPACE always
wins; PREFERRED/UNPREFERRED only below INSCRIBED_INFLATED_OBSTACLE; otherwise
max. updateWithMax and updateWithOverwrite keep their previous results.
- CriticalLayer::updateCosts delegates to StaticLayer::updateCosts, so it is
rolling-aware too.
- Test: rolling_static_layer_test, 7 cases.
Tests on dev: rolling_static_layer_test 7/7, test_costmap 9/9,
costmap_common_root_test 4/4 (rooted and flat). directional_layer_test
InvalidMaxDeviationThrows still fails: it checks directional_layer.cpp
initialization, which this change does not touch.
- 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.