fix(depth): free voxels on clearArea/footprint, accept far returns as behind
clearArea and footprint clearing only wrote the 2D cells, so the voxels and evidence points stayed MARKED and the next column update brought the phantom back. VoxelLayer now frees the voxel column and its evidence in both paths (footprint only for observed_volume; legacy unchanged). A valid return deeper than depth_valid_max_z_m kept every evidence point unknown, so phantoms with nothing within 3 m behind never cleared. New key depth_far_return_is_behind (default false) counts such a return as behind a point that lies at least free_margin_m inside the trusted range. Replay of the 2026-10-15 bags: real phantoms 62 -> 53, static-cell dropouts unchanged, object kept on 10/11 FOV exits as before.
This commit is contained in:
@@ -240,6 +240,9 @@ DepthVisibilityResult DepthVisibilityChecker::classifyPoints(const std::vector<E
|
||||
for (int du = -r; du <= r; ++du)
|
||||
{
|
||||
const double measured_z = depthAt(u + du, v + dv);
|
||||
if (config_.far_return_is_behind && std::isfinite(measured_z) &&
|
||||
measured_z > config_.valid_max_z_m && p.z() + config_.free_margin_m < config_.valid_max_z_m)
|
||||
continue;
|
||||
if (!std::isfinite(measured_z) || measured_z < config_.valid_min_z_m ||
|
||||
measured_z > config_.valid_max_z_m)
|
||||
return {DepthVisibility::Unknown, DepthVisibilityReason::InvalidDepth};
|
||||
|
||||
Reference in New Issue
Block a user