Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

paycap crashes for robots with n != 6 and its docstring does not match its behaviour

已关闭
#728 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@huxiaoyi-ovo 已经在做这个了。

开始于 2026年10月10日。

  • #731 来自 @huxiaoyi-ovo —— 已合并

评估

难度
4/5
预计耗时
3-5 天
新手友好度
18/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python

调研方向

Start from Dynamics.paycap and its docstring, and compare the wmax allocation with the per-joint assignment that fails for n != 6. Uncomment test_paycap in tests/test_DHRobot.py, then run the Panda repro from the issue. Done means n != 6 works, the return value matches the docstring, and the signature and frame docs are corrected. Pull request #731 already targets this, so check it before starting.

由索引模型根据 Issue 内容生成。

描述

bug

Dynamics.paycap allocates wmax = np.zeros((trajn, 6)) but assigns an n-element per-joint vector, so any robot with n != 6 raises:

ValueError: could not broadcast input array from shape (7,) into shape (6,)

Repro: rtb.models.DH.Panda().paycap([0, 0, -1, 0, 0, 0], tauR, q=q) with tauR an (n, 2) array of joint torque limits.

For n = 6 it works but returns per-joint scale factors, not the 6-vector wrench the docstring describes. The maximum load along w is wmax.min() and joint is the limiting joint. On a DH Puma 560 at qr, with w = [0, 0, -1, 0, 0, 0], this gave 4392 N limited by joint 2, and recomputing the joint torques at that load put joint 2 exactly at its limit.

Other problems:

  • The docstring signature paycap(q, w, f, tauR) does not match the code paycap(w, tauR, frame=1, q=None), and the frame description ('base'/'ee') does not match the int argument.
  • w is normalised, so it is only a direction, which the docs do not say.
  • It uses gravload, so it gives nonsense on models with zero dynamics such as the default URDF-based Panda. This should be documented or detected.
  • tests/test_DHRobot.py::test_paycap is commented out.

Raised from discussion #430.

主要语言
C++
星标
3.5k
派生
639
平均合并
1 天 8 小时
30 天内合并 PR
113

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

petercorke/robotics-toolbox-python 的其他 Issue

查看 petercorke/robotics-toolbox-python 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。