fix(leg_pattern): segment mirror-taped legs by intensity and estimate their range bias

Mirror tape on the KIT lidar blooms: a taped leg returns a saturated core plus a skirt of
dim rays whose range climbs smoothly to the background. Clustering by geometry first made
taped legs attached (no depth jump at the edge) or too wide for the width gate, so the
robot found the cart in 6 of 227 scans at 1.2 m. The saturated core also reads 1-3 cm short.

All changes sit behind tape_enabled plus their own key; with the keys at 0 or tape off the
detector runs exactly as before.

- tape_bloom_max_angle [rad]: bright runs become leg candidates before geometric
  clustering. The bloom skirt is walked and masked, and the edge class comes from the walk.
  A bright core spread over more than the leg's apparent width in range is rejected: it is
  a leg corrupted by a nearer mirror's bloom.
- tape_range_bias_sigma [m]: the pose fit estimates one common range bias for bright points
  (x, y, yaw, b) with a Gaussian prior. This only happens when at least one bare leg anchors
  the range; otherwise the 3-DoF fit is unchanged. |b| > 0.1 m invalidates the fit. Pair
  spacing and measured dimensions use bias-corrected leg centres.
- Real KIT scans with intensities: 9 from the 2-leg-taped run (11:06) and 2 with all four
  legs taped (12:12).
This commit is contained in:
2026-10-29 13:05:55 +07:00
parent 979bef360d
commit 347896e252
12 changed files with 1144 additions and 20 deletions

View File

@@ -188,6 +188,23 @@ bool LegProfile::validate(std::string& error) const
error = "tape_min_intensity must be finite and tape_min_points >= 1";
return false;
}
if (!std::isfinite(tape_bloom_max_angle) || tape_bloom_max_angle < 0.0 ||
tape_bloom_max_angle >= 0.5)
{
error = "tape_bloom_max_angle must be finite and in [0, 0.5) [rad]";
return false;
}
if (!std::isfinite(tape_range_bias_sigma) || tape_range_bias_sigma < 0.0 ||
tape_range_bias_sigma > 0.2)
{
error = "tape_range_bias_sigma must be finite and in [0, 0.2] [m]";
return false;
}
if (!tape_enabled && (tape_bloom_max_angle > 0.0 || tape_range_bias_sigma > 0.0))
{
error = "non-zero tape_bloom_max_angle or tape_range_bias_sigma requires tape_enabled: true";
return false;
}
if (std::fabs(cart_opening - cart_depth) < 2.0 * cart_dim_tolerance)
{
// Xe gần vuông: hình học không biết cạnh nào là cạnh vào. Dò ra cạnh bên là robot chui ngang