wip: state before depth cleanup

Uncommitted work as it ran on the KIT robot until 2026-10-20: the ROC observed_volume tuning patch on top of 63707c9 and the DepthCameraObstacleLayer plugin (clone of tsengapola/costmap_depth_camera noetic, B6 window fix), its 17 unit tests and the CMake wiring. Kept as one commit so the cleanup that follows has a recoverable starting point; not meant to be pushed.
This commit is contained in:
2026-10-20 09:36:53 +07:00
parent 63707c968c
commit 9a67eee148
16 changed files with 1816 additions and 13 deletions

View File

@@ -296,6 +296,29 @@ bool ObstacleLayer::getParams(const std::string& config_file_name, robot::NodeHa
read_depth_option("depth_far_return_is_behind", frustum_config.far_return_is_behind);
if (frustum_config.far_return_is_behind && !frustum_config.evidence_points_enabled)
throw std::invalid_argument("depth_far_return_is_behind requires depth_evidence_points_enabled");
int miss_frames = static_cast<int>(frustum_config.miss_frames);
int band_margin = static_cast<int>(frustum_config.stereo_band_margin_px);
read_depth_option("depth_reobserve_clearing", frustum_config.reobserve_clearing);
read_depth_option("depth_confirm_tolerance_m", frustum_config.confirm_tolerance_m);
read_depth_option("depth_miss_frames", miss_frames);
read_depth_option("depth_no_return_weight", frustum_config.no_return_weight);
read_depth_option("depth_stereo_baseline_m", frustum_config.stereo_baseline_m);
read_depth_option("depth_stereo_band_margin_px", band_margin);
if ((frustum_config.reobserve_clearing || frustum_config.stereo_baseline_m > 0) &&
!frustum_config.evidence_points_enabled)
throw std::invalid_argument("depth_reobserve_clearing and depth_stereo_baseline_m require "
"depth_evidence_points_enabled");
if (!std::isfinite(frustum_config.confirm_tolerance_m) || frustum_config.confirm_tolerance_m <= 0 ||
frustum_config.confirm_tolerance_m > 0.5 || miss_frames < 1 || miss_frames > 100 ||
!std::isfinite(frustum_config.no_return_weight) || frustum_config.no_return_weight < 0 ||
frustum_config.no_return_weight > 1 || !std::isfinite(frustum_config.stereo_baseline_m) ||
frustum_config.stereo_baseline_m < 0 || frustum_config.stereo_baseline_m > 1 ||
band_margin < 0 || band_margin > 200)
throw std::invalid_argument("depth_confirm_tolerance_m must be in (0, 0.5] m, depth_miss_frames 1..100, "
"depth_no_return_weight 0..1, depth_stereo_baseline_m 0..1 m and "
"depth_stereo_band_margin_px 0..200");
frustum_config.miss_frames = static_cast<unsigned int>(miss_frames);
frustum_config.stereo_band_margin_px = static_cast<unsigned int>(band_margin);
// One pixel more than the patch radius absorbs rounding of the stored float points,
// so every kept evidence point is re-checked with a full patch from its own pose.
if (frustum_config.evidence_points_enabled &&
@@ -442,15 +465,20 @@ bool ObstacleLayer::getParams(const std::string& config_file_name, robot::NodeHa
paired_depth_sources_.push_back(paired);
marking_buffers_.erase(std::remove(marking_buffers_.begin(), marking_buffers_.end(), m.buffer), marking_buffers_.end());
robot::log_info("depth clearing observed_volume: paired %s + %s, height=[%.3f, %.3f] m; "
"unknown/occluded/outside FOV retained; queue=%u age=%.3f s; one valid free frame; "
"unknown/occluded/outside FOV retained; queue=%u age=%.3f s; rule=%s; "
"evidence_points=%s per_voxel=%u marking_border=%u px projection_margin=%u px "
"far_return_behind=%s\n",
"far_return_behind=%s; reobserve tolerance=%.3f m miss_frames=%u no_return_weight=%.2f; "
"stereo_baseline=%.3f m band_margin=%u px\n",
paired->cloud_topic.c_str(), paired->depth_topic.c_str(), m.min_height, m.max_height,
paired->config.pair_queue_size, paired->config.observation_max_age_s,
paired->config.reobserve_clearing ? "re-observe or clear" : "one valid free frame",
paired->config.evidence_points_enabled ? "true" : "false",
paired->config.evidence_points_per_voxel, paired->config.marking_border_px,
paired->config.projection_margin_px,
paired->config.far_return_is_behind ? "true" : "false");
paired->config.far_return_is_behind ? "true" : "false",
paired->config.confirm_tolerance_m, paired->config.miss_frames,
paired->config.no_return_weight, paired->config.stereo_baseline_m,
paired->config.stereo_band_margin_px);
}
}
catch (const YAML::BadFile& e) {