Repository navigation
refactor(ik): joint limit helpers as module-level functions - #713
Open
petercorke wants to merge 1 commit into
Open
petercorke wants to merge 1 commit into
petercorke wants to merge 1 commit into
Conversation
Move the joint limit normalisation and check out of IKSolver into normalise_q() and within_limits(), which take plain arrays (q, qlim, a revolute mask) instead of an ETS. IKSolver._normalise_q and _check_jl become thin wrappers that map jindex-indexed coordinates onto the joints. Behaviour is unchanged, including that NaN is not reported as outside its limits. This lets other IK implementations, for example analytic IK on a DHRobot, share the numerical solvers' coordinate convention instead of duplicating it. Add direct tests of the helpers. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 7 high |
🟢 Metrics 8 complexity · 0 duplication
Metric Results Complexity 8 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.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #713 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 143 143
Lines 14269 14275 +6
=====================================
- Misses 14269 14275 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
IKSolverinto module-levelnormalise_q(q, qlim, revolute)andwithin_limits(q, qlim)inroboticstoolbox/robot/IK.py. They take plain arrays instead of anETS.IKSolver._normalise_qand_check_jlbecome thin wrappers that map the jindex-indexed coordinates onto the ETS joints and call the helpers.DHRobot(which hasqlimand joint types but noETS), share the numerical solvers' coordinate convention (keep in-limit values, otherwise principal angle shifted by whole turns toward the limits) instead of duplicating it.Behaviour
Unchanged, including that a NaN coordinate is not reported as outside its limits (same
q < lo or q > hisemantics as before). No public API change: the new functions are not exported from the package.Test plan
tests/test_IK.pyandtests/test_ik_joint_limits.pypass unchanged (121 passed, 12 skipped)mainvs the new wrappers, 7200 random cases over 6 jindex layouts (default, identity, reversed, permuted, sparse) and 3 limit sets: identical results🤖 Generated with Claude Code