Skip to content

IK joint limits and other various fixes#65

Merged
LemonPi merged 8 commits intomasterfrom
johnson/issue-fixes
Mar 4, 2026
Merged

IK joint limits and other various fixes#65
LemonPi merged 8 commits intomasterfrom
johnson/issue-fixes

Conversation

@LemonPi
Copy link
Copy Markdown
Member

@LemonPi LemonPi commented Mar 4, 2026

No description provided.

LemonPi and others added 8 commits March 2, 2026 19:51
…arly stopping init

Three bugs in PseudoInverseIK.solve() caused significant under-reporting of
convergence (e.g. 453/500 reported vs 489/500 actual on kuka_iiwa):

1. Stale error: sol.update() was called with post-step joint angles but
   pre-step error, so convergence on the current step was never detected
   until the next iteration. Fix: recompute FK error after the joint update.

2. Non-sticky convergence: sol.update() unconditionally overwrote all
   solutions every iteration, so a converged retry could be "un-converged"
   if the solver overshot on the next step. Fix: only overwrite retries
   that haven't already converged; use OR for convergence flags.

3. Early stopping init wasted 2 iterations with nested None checks before
   the no-improvement counter could start tracking. Fix: initialize both
   counter and err_min on the first iteration.

Also removed the conditional final sol.update (only ran when the loop
completed without early stopping) which is no longer needed.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
…ement; closes #48

After solving, revolute joints are wrapped by multiples of 2*pi (which
preserves FK exactly) to bring them into the valid range, then any
remaining violations are clamped and refined with additional IK
iterations. Controlled by enforce_joint_limits flag (default True) and
num_limit_refinement_iterations (default 10).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Python 3.8 is EOL. Update requires-python to >=3.9 and CI matrix to
test 3.9, 3.10, 3.11, 3.12. Fixes mujoco build failures on 3.8.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
…rance

mujoco >=3.4.0 dropped Python 3.9 wheels, causing CI build failure.
Pin to <=3.3.7 which supports 3.9-3.13. Also relax torch.allclose
tolerance in test_ik_in_place_no_err from default 1e-8 to 1e-6, as
joint limit enforcement refinement iterations introduce small floating
point drift.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@LemonPi LemonPi merged commit 5075632 into master Mar 4, 2026
4 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