petercorke / petercorke/robotics-toolbox-python
robot.payload(m=0, p=zeros) is not a no-op -- RNE result changes
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.5k
- Forks
- 624
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 53
Description
Background
Originally reported in #134 (over 5 years ago), maintainer commented at the time: "this is on the list of things to fix, it was a quick hack in the MATLAB version and not really proper." Still true.
Confirmed still broken (2026-08-25)
p560 = rtb.models.DH.Puma560()
q = [45, 70, -100, 60, 25, -140] # degrees, converted to rad
zero_v = np.zeros(p560.n)
before = p560.rne(q=q, qd=zero_v, qdd=zero_v)
p560.payload(m=0, p=np.zeros(3))
after = p560.rne(q=q, qd=zero_v, qdd=zero_v)
before and after differ by up to 0.34 (in torque units) despite payload(m=0, p=zeros) supposedly being the identity operation (zero mass, zero offset). Reproduced directly on current main.
Next steps
Needs a real look at Robot.payload()'s implementation -- likely still carrying the "quick hack" behavior the maintainer flagged years ago. Not yet root-caused to a specific line (unlike the RNE/#483 cluster in #636).
Originally reported: #134.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Puma560 example and comparing the RNE results before and after calling Robot.payload(m=0, p=np.zeros(3)). Read the Robot.payload() implementation and trace how its state affects rne(). Done means a zero-mass, zero-offset payload leaves the RNE result unchanged, with a regression test covering the case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- robotics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100