feat(depth): observed_volume depth clearing as deployed 2026-10-14

Baseline commit of the working-tree refactor built on 2026-10-14 17:24 and
running on the KIT robot, recorded in one commit before further changes.

- VoxelLayer clearing looks up TF at the depth image stamp.
- ObservationBuffer: per-source cloud preparation at the measurement stamp,
  height/range gate before the PCL VoxelGrid.
- DepthFramePairer: pairs the marking cloud with the clearing image by
  source and stamp, bounded queue and age.
- DepthVisibilityChecker and the observed_volume clearing mode in VoxelLayer;
  the legacy frustum mode stays the default.
- Tests: depth_observation_buffer_test, depth_visibility_test.
This commit is contained in:
2026-10-15 11:37:56 +07:00
parent a63c084002
commit 2ca0bcc1c1
15 changed files with 1336 additions and 19 deletions

View File

@@ -414,6 +414,9 @@ void Costmap2DROBOT::copyParentParameters(const std::string& costmap_name,
double max_obstacle_height;
double obstacle_range;
double raytrace_range;
bool cloud_transform_at_stamp = false;
bool marking_voxel_enabled = false;
double marking_voxel_leaf_size = 0.05;
bool frustum_clearing_enabled = false;
int frustum_clearing_pixel_step = 8;
double frustum_min_range = 0.2;
@@ -439,6 +442,14 @@ void Costmap2DROBOT::copyParentParameters(const std::string& costmap_name,
move_parameter(plugin_nh_element, costmap_plugin_nh_element, "max_obstacle_height", max_obstacle_height);
move_parameter(plugin_nh_element, costmap_plugin_nh_element, "obstacle_range", obstacle_range);
move_parameter(plugin_nh_element, costmap_plugin_nh_element, "raytrace_range", raytrace_range);
// These source options must reach local/global plugin namespaces too;
// loading the common YAML alone does not scope them to the layer.
move_parameter(plugin_nh_element, costmap_plugin_nh_element,
"cloud_transform_at_stamp", cloud_transform_at_stamp);
move_parameter(plugin_nh_element, costmap_plugin_nh_element,
"marking_voxel_filter/enabled", marking_voxel_enabled);
move_parameter(plugin_nh_element, costmap_plugin_nh_element,
"marking_voxel_filter/leaf_size_m", marking_voxel_leaf_size);
move_parameter(plugin_nh_element, costmap_plugin_nh_element, "frustum_clearing_enabled", frustum_clearing_enabled);
move_parameter(plugin_nh_element, costmap_plugin_nh_element, "frustum_clearing_pixel_step", frustum_clearing_pixel_step);
move_parameter(plugin_nh_element, costmap_plugin_nh_element, "frustum_min_range", frustum_min_range);
@@ -451,6 +462,12 @@ void Costmap2DROBOT::copyParentParameters(const std::string& costmap_name,
move_parameter(plugin_nh_element, costmap_plugin_nh_element, "column_cover_distance", column_cover_distance);
move_parameter(plugin_nh_element, costmap_plugin_nh_element, "frustum_clear_left_border_px", frustum_clear_left_border_px);
move_parameter(plugin_nh_element, costmap_plugin_nh_element, "frustum_clear_right_border_px", frustum_clear_right_border_px);
for (const char* key : {"depth_clearing_mode", "paired_marking_source", "depth_pair_queue_size",
"depth_pair_max_wait_s", "depth_observation_max_age_s", "depth_valid_min_z_m",
"depth_valid_max_z_m", "depth_free_margin_m", "depth_projection_margin_px",
"depth_voxel_z_resolution_m"})
if (plugin_nh_element.hasParam(key))
costmap_plugin_nh_element.setParam(key, YAML::Clone(plugin_nh_element.getParamValue(key)));
robot::log_info("topic: %s data_type: %s clearing: %d marking: %d inf_is_valid: %d min_obstacle_height: %f max_obstacle_height: %f", topic.c_str(), data_type.c_str(), clearing, marking, inf_is_valid, min_obstacle_height, max_obstacle_height);
robot::log_info("frustum_clearing_enabled: %s, frustum_clearing_pixel_step: %d, frustum_min_range: %f, frustum_max_range: %f, frustum_clear_left_border_px: %d, frustum_clear_right_border_px: %d", frustum_clearing_enabled ? "true" : "false", frustum_clearing_pixel_step, frustum_min_range, frustum_max_range, frustum_clear_left_border_px, frustum_clear_right_border_px);
}