- New per-source flag zero_is_valid (default false): a 0 range is replaced by
range_max - 0.1 mm, like inf_is_valid does for Inf, so the beam clears free
space up to raytrace_range instead of being dropped.
- The flag is copied from the shared costmap block like inf_is_valid; it logs an
error when set on a non-LaserScan source.
- Test obstacle_layer_scan_ranges_test covers the range replacement.
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.
- ReferenceGraph / ReferenceGraphWorker: Voronoi ridges and one-way lanes are
computed on a low-priority thread when the map changes (reference_graph_*
keys, off with rolling_window), with unit tests.
- Shared costmap keys can live in a root: map or flat at the top of the YAML;
costmap_common_root_test covers both layouts.
- Static and directional layers report map changes to the layered costmap.
- 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.
occlusion_guard (default false): keep a stored point when a nearer object blocks the ray to it, clear a point the camera sees through. attach_distance (default 0.12 m, as before) is now read per source. Both keys are forwarded from the parent costmap parameters. README, params YAML and tests updated.
DepthCameraObstacleLayer::loadParameters() wrapped each key in a
readParam() helper. It now reads the same way as
ObstacleLayer::getParams(): one block of loadParam() calls on the default
file, then one block of "if (priv_nh.hasParam(k)) priv_nh.getParam(k, v)"
on "<costmap>/<plugin>". The per-source keys do the same on
"<costmap>/<plugin>/<source>". Values and precedence are unchanged.
getParam() gets the current value as its default, so a value of the
wrong type keeps the file default instead of becoming 0, false or "".
The layer no longer throws on a wrong type itself. A wrong type in the
shared block still stops the costmap, in copyParentParameters(). The two
wrong-type test cases, which set the layer namespace directly, are
removed.
Each layer reads its default file under $PNKX_NAV_CORE_CONFIG_DIR/config,
then overrides a key from "<costmap>/<plugin>".
Costmap2DROBOT::copyParentParameters() copies the shared "<plugin>:"
block there first. This was broken in three ways:
- the copy lists covered only part of what the layers read, so a key set
in the shared block was dropped without a word;
- DepthCameraObstacleLayer had no default file and read the shared block
itself;
- a layer that failed to initialize left a half-built costmap that
reported READY.
Failing loudly:
- costmap_2d_robot.cpp: a failing layer, a malformed plugins: list or a
missing costmap_params.yaml throws std::runtime_error with the costmap
and layer name, after releasing layered_costmap_.
NavigationRuntime::buildCostmaps() turns this into an initialization
error, so the host never reports READY.
- Static/Obstacle/Voxel/Inflation and DepthCameraObstacleLayer throw when
their default file cannot be opened.
- A key whose value does not convert to the type the layer reads throws.
getParam() used to write 0, false or "" into the value, and that was
copied as if configured.
One flow:
- copyParentParameters() copies every key each layer reads, with the
layer's type, including a new DepthCameraObstacleLayer branch. Copies no
layer reads are dropped.
- DepthCameraObstacleLayer::loadParameters() reads
config/depth_camera_obstacle_layer_params.yaml (new, equal to the C++
defaults), then "<costmap>/<plugin>". ParamReader is gone, and so is the
node_handle.cpp:265 warning at start-up.
- VoxelLayer: z_resolution can be overridden; unknown_threshold is
computed after the final z_voxels; the column keys are range-checked;
the effective column is logged once at start-up.
- config/obstacle_layer_params.yaml: drop the per-source keys the layer
never read there.
- depth_camera_obstacle_layer_test: set PNKX_NAV_CORE_CONFIG_DIR; add
tests for a wrong type and a missing default file.
Squash of fix/config-flow (ae7fce9, f8705e1). Checked on the KIT robot on
22/10/2026:
- the depth layer summary at start-up is unchanged;
- a shared-block key now reaches VoxelLayer;
- FOV_W 3.5, z_voxels 17, a wrong-typed key and a missing default file
each give INITIALIZATION_FAILED.
Depth cameras now go through their own costmap layer instead of the
frustum clearing that lived in ObstacleLayer and VoxelLayer.
- Add DepthCameraObstacleLayer. It stores marked points per costmap
column, clears stored points inside each camera frustum with a kd-tree
check against the new cloud, keeps points outside the view, groups
points with Euclidean clustering, and does not mark a 12 cm band at the
frustum faces.
- The layer follows the CostmapLayer contract: updateWithMax/Overwrite by
combination_method, reset(), clearArea() with the usual invert
semantics, footprint clearing, matchSize() and the layer mutex. So
ClearCostmapRecovery and costmap resets work on it.
- Add LayerType::DEPTH_CAMERA_LAYER, appended last so the existing values
keep their numbers. The host's SensorGateway must dispatch PointCloud2
and DepthCameraData to it (move_base2 feature/depth-camera-layer-type).
- Remove the frustum clearing code from Observation, ObservationBuffer,
ObstacleLayer, VoxelLayer and costmap_2d_robot.cpp.
- ObstacleLayer and VoxelLayer now reject a DepthCameraData source or
frustum_clearing_enabled: true at startup, with a message that points
to DepthCameraObstacleLayer.
- Link PCL into the plugins library only. Add 21 unit tests for the layer
(depth_camera_obstacle_layer_test).
Squashed from feature/depth-observed-volume (2ca0bcc..40dc70e).
main had not moved since 11 July, while the depth-camera work continued on
dev_cam_intel for six weeks. The two branches did not diverge by accident: they
ended up holding two different clearing designs for the same layer.
main carried frustum clearing as VoxelLayer members - frustum_clearing_enabled_,
a pixel step and a min/max range - driven from costmap_2d_robot. dev_cam_intel
replaced that with a full-column clearing pass whose configuration lives per
observation, so the layer keeps no frustum state of its own.
This commit takes the dev_cam_intel tree whole. It is the line running on the
robot, the one rb_ws points at, and the one the NUC measurements were taken
against; the frustum design is superseded rather than merged, and stays in
history at 45c8227 if it is ever wanted back.
Squashed deliberately: the nineteen commits behind it are a working diary -
metrics that were added and removed, test toggles, an optimal-run series - and
none of that is worth carrying onto a branch other trees track.