Files
dock_pattern_detector/test
duongtd cea149cae9 Accept a V whose far wing is foreshortened by the viewing angle
A run in simulation matched the pattern 23 times in 15 seconds out of roughly
435 scans - about five percent - and every miss reported the right vertex angle
with the wrong wing length. Measuring it: noise is not the cause (93 to 100
percent at the sensor's own 3 mm sigma) and neither is range (clean detections
out to 5 m). Viewing angle is. Turn the plate and the far wing goes nearly
edge-on to the beam, so few rays land on it and the extracted segment comes out
short. Past thirty degrees the detection rate falls to zero.

Requiring both wings at full length only works when the robot happens to face
the plate squarely, which is not something the approach guarantees. Occlusion
only ever shortens a wing; it cannot lengthen one. So the rule is no longer
symmetric: no wing may be LONGER than wing_length + tolerance, and at least one
must be within tolerance of it. A pallet corner still fails, because a pallet
has both sides long - that gate is untouched, and the test that covers it still
passes.

Confidence scores the length of the long wing rather than the short one. The
short wing is allowed to be short by the rule above, so penalising it again is
charging twice for the same thing, and it created a cliff: candidates cleared
the length gate only to fall at min_confidence. "Too little of it is visible to
trust" is already carried by the support term, which counts the rays on the
thinner wing and degrades smoothly.

With min_wing_points at 5, thirty degrees at 2.5 m goes from 0 to 77 percent,
forty degrees at 1.2 m from 0 to 80, fifty degrees from 0 to 82.

The rejection message also carries the measured vertex angle, both wing lengths
and the apex position now. Without them, "a wing 0.22 m because something is in
the way" and "a wing 0.80 m because that is a pallet" print the same line.
2026-08-26 15:24:31 +07:00
..