Skip to content

fix(examples,dhrobot): repair broken ikine_LMS/ikine_min example references - #650

Merged
petercorke merged 2 commits into
mainfrom
fix/ikine-lms-examples
Aug 26, 2026
Merged

fix(examples,dhrobot): repair broken ikine_LMS/ikine_min example references#650
petercorke merged 2 commits into
mainfrom
fix/ikine-lms-examples

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

  • examples/readme.py and examples/ikine_evaluate.py both called robot.ikine_LMS(...), which hasn't existed since the LM variants were merged into ikine_LM(method=...). ikine_evaluate.py also called the never-existent robot.ikine_min(...).
  • Fixed both to use ikine_LM(method="sugihara", k=0.0001) and ikine_LM(joint_limits=False/True) respectively -- k=0.0001 matters here, the default k=1.0 doesn't actually converge for the sugihara method (confirmed by running both scripts end-to-end).
  • Also fixed a latent bug in ikine_evaluate.py's timeit benchmark strings: robot.ikine_LM(T, q0) passes q0 positionally, landing in the end= parameter instead of q0=.
  • While fixing this, found that DHRobot.ikine_LM (a thin wrapper around ETS.ikine_LM) had its own narrow signature that silently dropped method/k/kq/km -- so DH robots couldn't use the wampler/sugihara variants at all. Widened it to Tep, q0, **ikargs, forwarding everything through, documented via a new shared |ikargs| Sphinx substitution (docs/source/conf.py, matching the existing |BlockOptions| pattern) so the description lives in one place as more ikine_LM wrappers pick it up (relevant for a follow-up PR that touches the rest of the ikine_LM/ik_LM family's docs).

Item 2 of a 4-item IK-solver cleanup plan (see claude-notes/ik-solver-cpp-python-divergence.md); Item 1 (YuMi gripper parent-swap fix) is PR #649.

Test plan

  • New regression test: DHRobot.ikine_LM actually forwards method/k to the underlying solver (fails against the old narrow signature)
  • Full test suite green (732 passed, 18 skipped) in a clean isolated venv
  • Ran both example scripts end-to-end (both DH-robot branches of ikine_evaluate.py, and the IK-relevant portion of readme.py) -- no AttributeError, all rows converge including sugihara
  • Sphinx docs build (-W --keep-going) clean of any new warnings from the |ikargs| substitution or DHRobot.ikine_LM's docstring

🤖 Generated with Claude Code

petercorke and others added 2 commits August 26, 2026 17:21
DHRobot.ikine_LM had its own narrow signature that silently dropped
method/k/kq/km, so DH robots couldn't use the wampler/sugihara variants
or joint-limit/manipulability weighting that ETS.ikine_LM supports.
Switch to Tep/q0 explicit + **ikargs forwarding, documented via a new
shared |ikargs| substitution (matching the existing |BlockOptions|
pattern) so the description stays in one place as more ikine_LM
wrappers pick it up.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Both examples/readme.py and examples/ikine_evaluate.py called
robot.ikine_LMS(...), which hasn't existed since the LM variants were
merged into ikine_LM(method=...). ikine_evaluate.py also called the
never-existent robot.ikine_min(...), and its timeit benchmark strings
passed q0 positionally, which lands in the end= parameter instead.

Fixed all three, replacing ikine_LMS with ikine_LM(method="sugihara",
k=0.0001) -- the default k=1.0 doesn't converge for this method -- and
ikine_min with ikine_LM(joint_limits=False/True), which is what those
benchmark rows were actually trying to compare.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (5b5a0fe) to head (c1e4a7e).

Files with missing lines Patch % Lines
src/roboticstoolbox/robot/DHRobot.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #650   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files        143     143           
  Lines      14035   14035           
=====================================
  Misses     14035   14035           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@petercorke
petercorke merged commit 6691113 into main Aug 26, 2026
23 checks passed
@petercorke
petercorke deleted the fix/ikine-lms-examples branch August 26, 2026 10:59
@github-actions github-actions Bot mentioned this pull request Aug 26, 2026
petercorke added a commit that referenced this pull request Aug 26, 2026
… verify #379 repro

# Conflicts:
#	tests/test_IK.py
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