Skip to content

return true only when a valid solution found#160

Merged
sea-bass merged 1 commit intoopen-planning:mainfrom
Mattolo4:main
Mar 9, 2026
Merged

return true only when a valid solution found#160
sea-bass merged 1 commit intoopen-planning:mainfrom
Mattolo4:main

Conversation

@Mattolo4
Copy link
Contributor

@Mattolo4 Mattolo4 commented Mar 9, 2026

In simple_IK (i guess incorrectly) returns true (so it succeed) even when the collision check fails to find a valid solution, causing the returned solution to be the initial start position rather than an actual IK solution.

When check_collision=True and hasCollision(q) returns True:

  • the solution.position is not updated (collision detected)
  • but the function still returns True
  • the caller recieves the initial solution value, which in this case is the starting position

So IK appears to be "succeeded" but it returns the starting position as solution. By returning True only when a valid solution is found solves this bug,

Copy link
Collaborator

@sea-bass sea-bass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow, good catch!

@sea-bass sea-bass merged commit 3fafd4b into open-planning:main Mar 9, 2026
10 checks passed
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.

3 participants