Repository navigation
feat(dynamics): payload_capacity() replaces pay() and paycap() - #881
Merged
Merged
Conversation
payload_capacity(q, tau_m, w, frame="base") is the multiple of a wrench w that each joint can support, for each configuration in q, for joint torque limits tau_m: a positive number, inf if the joint has no part in it, and nan if gravity alone is beyond the limit. The wrench is in the base frame, or "ee" for the end-effector frame. Limits are (n,) or (1,n) maxima, or (2,n) minima then maxima. pay() is removed, it is -J.T @ w and was a poor name, and paycap() is removed, which returned a tuple when its docstring said otherwise and was skipped in its test. Both were ported from the MATLAB functions of Bryan Moutrie, credited in the docstring. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| ErrorProne | 1 high |
| Security | 11 high |
🟢 Metrics 15 complexity · 0 duplication
Metric Results Complexity 15 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.
petercorke
enabled auto-merge (squash)
October 21, 2026 23:36
…erywhere else Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Merged
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #881 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 146 146
Lines 17200 17164 -36
=====================================
+ Misses 17200 17164 -36 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Adds
payload_capacity()and removespay()andpaycap(), which it replaces.payload_capacity(q, tau_m, w, frame="base"): for each configuration (row ofq), the multiple of the wrenchwthat each joint can support without exceeding its torque limit, a matrix of shape (m, n). Each entry is a positive number,infif the joint has no part in it, ornanif gravity alone is beyond the limit; the minimum over the joints is the capacity and itsargminis the limiting joint. Ifwis the weight of a 1 kg mass the answer is in kg.tau_mis (n,) or (1,n) of maxima (the minimum is the negative), or (2,n) of minima then maxima.wis a 6-vector in the base frame (frame="base", default) or the end-effector frame, including the tool (frame="ee"). The Jacobian function is chosen once before the loop. Any other value raisesValueError.s·wisgravload − s·Jᵀw, sincewis the wrench the payload applies to the robot. This sign is checked against physics that does not use the method (below), and it matters for asymmetric limits.payandpaycapby Bryan Moutrie (@au-phiware), credited in the docstring. The docstring has an example, as code and a.. plot::, of the Puma 560 along a line.Removed:
pay()(it was-J.T @ w, a poor name) andpaycap()(its docstring did not match what it returned, Issue #728, and its test was skipped). These are public methods, so this is a breaking change; the replacement ispayload_capacity, and the limits layout differs frompaycap's (n, 2) with the maximum first. No!in the title, as agreed for this repository.Tests (
tests/test_payload_capacity.py, 20): the reference is a real mass on the last link, whose gravity load comes from the recursive Newton-Euler dynamics and does not use the method, for the Puma 560 and the Panda with symmetric and asymmetric limits: at 0.999 of the capacity every joint is within its limit, and at 1.01 of it one is not. Also that a mass adds−Jᵀwto the gravity load, theinfandnancases, a trajectory, a singleq, the limit forms, bad shapes and a badframe, and that a wrench in the end-effector frame equals the same wrench rotated into the base frame.Changes numerical results or public behaviour: yes, new method;
payandpaycapare removed.Ran: the payload, DHRobot, ERobot, BaseRobot and hasdynamics tests (228 passed, 1 skipped) and mypy (clean, 165 files). Not run: the docs build; the
docs/notebooks/payload.ipynbnotebook is not part of this PR.Written by Peter Corke with Claude Code, which fixed a sign error in the first version (the gravity term had the wrong sign relative to the payload term), added
frame, and wrote the tests.🤖 Generated with Claude Code