Skip to content

docs(ik): demonstrate inverse kinematics with a locked joint - #933

Merged
petercorke merged 3 commits into
petercorke:mainfrom
huxiaoyi-ovo:docs/ik-locked-joint-825-clean
Nov 18, 2026
Merged

petercorke merged 3 commits into
petercorke:mainfrom
huxiaoyi-ovo:docs/ik-locked-joint-825-clean

Conversation

@huxiaoyi-ovo

Copy link
Copy Markdown
Contributor

Summary

Adds a runnable Panda inverse-kinematics example with one joint locked, addressing the remaining IK documentation task in #825.

The example uses ETS.fixjoint() to lock the third joint of a seven-joint Panda arm, solves the reduced six-joint problem with ikine_LM, and verifies the recovered end-effector pose.

Validation

  • Changes limited to docs/source/IK/numerical.rst (29 added lines).
  • The earlier staging version passed the full cross-platform test matrix and Sphinx documentation build.
  • The clean branch is based on the latest upstream main. Updated CI validation is pending.

No runtime logic or public API changes.

AI assistance: ChatGPT (GPT-6) assisted with documentation preparation and review.

Addresses petercorke#825.

Co-authored-by: ChatGPT (OpenAI GPT-6) <noreply@openai.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@petercorke petercorke left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for the example, a couple of minor points

Comment thread docs/source/IK/numerical.rst Outdated
>>> target = ets.fkine(q_goal)
>>> reduced = ets.fixjoint(2, q_goal[2])
>>> reduced.n
6

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

don't include results in a runblock. The code is executed during doco build, and actual results are substituted.

Comment thread docs/source/IK/numerical.rst Outdated
>>> seed = np.delete(q_goal, 2) + 0.02
>>> sol = reduced.ikine_LM(target, q0=seed)
>>> sol.success
True

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

as above

Comment thread docs/source/IK/numerical.rst Outdated
>>> seed = np.delete(q_goal, 2) + 0.02
>>> sol = reduced.ikine_LM(target, q0=seed)
>>> sol.success
True

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

as above, but actually this line gives False for me. atol is maybe too small.

@petercorke petercorke left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you for the update. I re-ran the example on a compiled build and on the pure-Python install: sol.success is True and the last line is now True as well (maximum difference 3.9e-7). This looks good to me.

@petercorke
petercorke merged commit 8a7549c into petercorke:main Nov 18, 2026
22 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 18, 2026
@petercorke

Copy link
Copy Markdown
Owner

Thank you, merged. A worked example with one joint locked is a useful addition for Issue #825, and the tighter tolerance makes the last line print True. Thank you for updating it after review.

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