Skip to content

bump IK max_iter to 20 to enable wrist-flip restart in pinokin#1

Merged
Jepson2k merged 2 commits into
mainfrom
fix-ik-wrist-flip-restart
May 9, 2026
Merged

bump IK max_iter to 20 to enable wrist-flip restart in pinokin#1
Jepson2k merged 2 commits into
mainfrom
fix-ik-wrist-flip-restart

Conversation

@Jepson2k
Copy link
Copy Markdown
Owner

@Jepson2k Jepson2k commented Apr 25, 2026

Summary

Bumps max_iter for the cached IK solver in parol6/utils/ik.py from 10 to 20.

Why

Companion to Jepson2k/pinokin#1 which adds a deterministic wrist-flip restart strategy. The wrist flip only triggers after LM converges to a limits-violating q (i.e. inside the convergence-then-check_limits-rejected branch). With max_iter=10, some realistic seeds — e.g. the PRECISION_POSE call from end-of-zigzag in demo_showcase.py line 98 — need ~11 LM iters to converge and were exiting the inner loop without ever calling check_limits, so the wrist flip never applied.

max_iter=20 gives margin for currently observed PAROL6 IK seeds while keeping worst-case solve time well under 1 ms. Successful first-attempt convergence is unaffected since LM converges in <20 iters either way.

Test plan

  • pytest — 231 passed, 8 skipped
  • pre-commit run --all-files — clean
  • CI: tests + lint
  • Verify demo regression downstream (waldo-commander)

Dependencies

  • Requires pinokin v0.1.6 (or matching branch) for the wrist-flip behavior. CI will fall back to v0.1.5 wheels until pinokin is released, so the demo regression won't pass until pinokin v0.1.6 is tagged and the wheel pin in pyproject.toml is bumped (separate follow-up).

Pinokin's wrist-flip restart strategy (introduced in pinokin
fix-ik-wrist-flip-restart) only triggers after LM converges to a
limits-violating q. With max_iter=10 some realistic seeds (e.g. the
PRECISION_POSE call from end-of-zigzag in demo_showcase line 98) need
~11 LM iters to converge — they exited the inner loop without ever
calling check_limits, so the wrist flip never applied.

20 gives enough margin for current PAROL6 IK seeds while keeping
worst-case solve time well under 1 ms. Successful first-attempt
convergence is unaffected (LM converges in <20 iters either way).
v0.1.6 ships the deterministic wrist-flip restart for limits-violating
IK branches (Jepson2k/pinokin#1). Combined with this branch's max_iter
bump to 20, the wrist-flip restart now actually fires for the realistic
PAROL6 seeds it was designed to rescue.
@Jepson2k Jepson2k merged commit c6620e3 into main May 9, 2026
38 of 39 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.

1 participant