Skip to content

AORRTC: fix memory leak and findNeighbour padding for non-Euclidean costs#1413

Open
mlsdpk wants to merge 1 commit into
ompl:mainfrom
mlsdpk:aorrtc-fix-non-euclidean
Open

AORRTC: fix memory leak and findNeighbour padding for non-Euclidean costs#1413
mlsdpk wants to merge 1 commit into
ompl:mainfrom
mlsdpk:aorrtc-fix-non-euclidean

Conversation

@mlsdpk

@mlsdpk mlsdpk commented Apr 7, 2026

Copy link
Copy Markdown

Hello! While testing AORRTC with non-Euclidean cost spaces, I ran into a couple of leaks and robustness issues:

  • Memory leak in AOXRRTConnect::reset(): trees were cleared without freeing the Motion objects they hold by raw pointer. Now calls freeMemory() first. Also frees cmotion->state in solve() cleanup.
  • findNeighbour() padding: absolute pad (rootDist += 1e-5) becomes negligible for large rootDist (e.g. SE2, SE3, non-Euclidean metrics), causing empty nearestR results. Replaced with relative pad rootDist *= (1 + 1e-6).

Minor fixes bundled in:

  • bounds check in findNeighbour() cost-iteration loop
  • initialise GrowState gs = TRAPPED
  • fix tgi.xmotion bookkeeping in solve()'s straight-line check
  • inner connect loop now respects ptc

@Thodoris1999

Copy link
Copy Markdown
Contributor

Thank you for the contribution Phone! Changes make sense to me.
@twill777 Can you also take a look?

@mamoll mamoll requested a review from zkingston May 24, 2026 03:29
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.

2 participants