Repository navigation
fix(ik): trajectory residual is the maximum, and document trajectory behaviour - #712
Open
petercorke wants to merge 3 commits into
Open
petercorke wants to merge 3 commits into
petercorke wants to merge 3 commits into
Conversation
…behaviour For a trajectory of poses the numeric IK returned the minimum residual over the poses, which hid poses that were solved badly (or not at all). It is now the maximum, the worst case. Document trajectory behaviour, which was missing: accepted inputs, q of shape (N, n), every pose seeded with the same q0 so consecutive solutions may be on different IK branches, and how success, iterations, searches, residual and reason are combined. Applies to IKSolver.solve and the ikine_* methods, and to docs/source/IK/ik.rst. Correct docs that were wrong: - ik_NR and ik_GN claimed to accept a pose trajectory, but the C++ solvers take a single 4x4 pose and raise TypeError otherwise - ETS.ik_GN and ik.rst said the C++ solvers return a tuple, they return an IKSolution Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 5 |
| Duplication | 0 |
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.
The next release will be 1.5.0, the 1.4.5 release is not being published. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #712 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 143 143
Lines 14269 14269
=====================================
Misses 14269 14269 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
q0 may be a vector (n,) or a matrix (m, n) whose rows are the starting points of the first m searches, as _solve already does. This was undocumented, every q0 description said "the initial joint coordinate vector". Document it on IKSolver.solve and the ikine_* methods, and add a test. The ValueError for a badly shaped Tep said "Tep must be a 4x4 SE3 matrix", it now says what is accepted: an SE3, a 4x4 array or an (N, 4, 4) array. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Oct 4, 2026
Open
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IKSolver.solve(so allikine_*methods) returned the minimum residual over the poses, which hid poses solved badly or not at all. It is now the maximum, the worst case.IKSolver.solve, theikine_LM/NR/GN/QPmethods ofETSandRobotKinematics,DHRobot.ikine_LManddocs/source/IK/ik.rst: accepted inputs (SE3with N poses or an (N, 4, 4) array),qof shape (N, n), every pose seeded with the sameq0(so consecutive solutions may be on different IK branches), and howsuccess,iterations,searches,residualandreasonare combined. Aversionchanged:: 1.4.5notice records the residual change.ik_NR/ik_GN(inETSandRobotKinematics) said they accept a pose trajectory. The C++ solvers take a single 4x4 pose and raiseTypeErrorotherwise.ETS.ik_GNandik.rstsaid the C++ solvers return a tuple. They return anIKSolution.Behaviour change
Only the trajectory
residualvalue changes (min to max). Single-pose results are unchanged. Code that checkssol.successis unaffected. Code that relied on the old minimum as a "best pose" measure would see a larger value.Test plan
tests/test_IK.pyandtests/test_ik_joint_limits.pypass locallytest_trajectory_residual_is_maximum(stub solver, known residuals) andtest_trajectory_failure_is_reported(one reachable, one unreachable pose) both fail onmainand pass here🤖 Generated with Claude Code