Skip to content

fix: CAPT false negatives during affordance propagation - #122

Open
nrkumar93 wants to merge 2 commits into
KavrakiLab:mainfrom
nrkumar93:main
Open

fix: CAPT false negatives during affordance propagation#122
nrkumar93 wants to merge 2 commits into
KavrakiLab:mainfrom
nrkumar93:main

Conversation

@nrkumar93

@nrkumar93 nrkumar93 commented Aug 23, 2026

Copy link
Copy Markdown

Summary

Fix two defects in CAPT::subdivide that can omit points from leaf affordance buffers. The omissions cause both CAPT::collides and CAPT::collides_simd to return false negatives for point-cloud collision queries.

A motion planner using a CAPT-backed environment could consequently accept a configuration where a query sphere overlaps a stored point.

Primitive collision geometry is unaffected.

Root cause

After partitioning a cell, each child must inherit points near the split plane from the opposite half.

Two issues made this propagation incomplete:

  1. The low half was scanned from the wrong end.

    Each half is sorted along the split dimension. The high child must inherit the low half's suffix, the points closest to the split, but the previous implementation scanned and copied from the low half's beginning.

  2. The propagation band excluded the point radius.

    The required distance is r_max + r_point, but the propagation checks used only r_max. This omitted points that the later Volume::affords check would otherwise accept.

Fix

  • Use the existing max_affordance_l1 value (r_max + r_point) as the propagation band.
  • Walk backward from the split to find the low half's near-plane suffix.
  • Continue walking forward from the split to find the high half's near-plane prefix.
  • Copy those two ranges into the corresponding child affordance buffers.
  • Preserve the existing finite-value checks used to exclude padding points.

Both changes are required. Testing the changes separately still produced false negatives:

Variant False negatives
Unpatched 1972
Band fix only 1633
Scan-direction fix only 69
Both fixes 0

Verification

Added CAPT regression coverage comparing tree results against a brute-force sphere/point overlap test for:

  • a uniform random point cloud;
  • a regular grid with points on median split planes;
  • r_point = 0, isolating the propagation-direction defect;
  • small clouds containing 1, 2, 3, 5, and 8 points.

Results after the fix:

  • 0 false negatives and 0 false positives across approximately 110,000 queries;
  • scalar and SIMD query paths agree;
  • CAPT::is_valid() holds for every tested tree;
  • all existing Catch2 tests pass;
  • the single-point-tree edge case remains valid.

Before the fix, missed overlaps included deep penetrations—not only floating-point boundary cases. The worst observed missed overlap depth was approximately 10 cm.

Performance impact

Correct propagation stores more affordance entries and therefore increases CAPT construction time and memory use. For a 12³ grid containing 1,728 points:

Affordance vectors Build time
Before 23,149 6.8 ms
After 69,579 16.2 ms

CAPT construction is a per-scene cost. Query throughput was unchanged to slightly improved in the measured workload.

@nrkumar93

Copy link
Copy Markdown
Author

Follow-up observation

This fix assumes queries respect CAPT's documented [r_min, r_max] radius range. Generated robot FK code may query the environment with link-culling spheres larger than Robot::max_radius, so callers should ensure that the CAPT r_max bounds the largest environment-query radius, not merely the largest leaf collision sphere.

This is independent of the affordance-propagation defects fixed here and can be addressed separately through documentation or generated robot metadata.

@nrkumar93
nrkumar93 marked this pull request as draft August 23, 2026 17:05
@nrkumar93
nrkumar93 marked this pull request as ready for review August 23, 2026 17:05
@nrkumar93 nrkumar93 changed the title Fix CAPT false negatives during affordance propagation fix: CAPT false negatives during affordance propagation Aug 23, 2026
tenhjo added a commit to tenhjo/vamp that referenced this pull request Aug 25, 2026
…akiLab#122 CAPT false-negative fix

fr3_07.hh generated by cricket from robot_zoo.export.vamp's Fr3_07 inputs: 17 spheres with rokin's
radii and rokin's joint box, FK verified against rokin to 4.5e-6 m over 2000 configs.

PR KavrakiLab#122 is not optional for us: CAPT::collides returns FALSE NEGATIVES (says free while a query
sphere overlaps a stored point), worst observed missed penetration ~10 cm against robot spheres of
5-13 cm. Still open upstream as of 2026-08-24.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant