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

coriolis() and Robot.copy().rne() fail for URDF/ETS robots: copied links keep their original parent

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

维护者通常 2 天内回复

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

开始于 2026年10月10日。

  • #732 来自 @huxiaoyi-ovo —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
robotics

调研方向

Start with Robot.copy() and Robot.__deepcopy__, then Robot.rne where self.links.index(joint.parent) fails, and trace how coriolis reaches nofriction(). Check linked PR #732 first, since it already targets this fix. Done means each copied link's parent and children point to copied links, and copy().rne(q, qd, qdd) matches the original robot's result.

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

描述

bug

robot.coriolis(q, qd) raises ValueError: Link(...) is not in list for every URDF-based Robot I tried: UR5, KinovaGen3, LBR, and a two-link URDF with full inertials. DH robots are unaffected.

coriolis calls nofriction(), which calls copy(). The same error occurs for robot.copy().rne(q, qd, qdd) directly, while rne on the original robot works. Cause: after copy() each link's parent (and the joint's parent) still refers to the original robot's link object, so self.links.index(joint.parent) in Robot.rne (group_of_link_idx.get(...)) fails.

Repro (any URDF with dynamics):

import numpy as np
from roboticstoolbox.models.URDF.URDFRobot import URDFRobot

r = URDFRobot("/path/to/two_links_robot.urdf")   # two revolute joints, with <inertial> elements
q, qd = np.array([0.3, -0.5]), np.array([0.1, 0.2])
r.rne(q, qd, np.zeros(2))           # OK
r.copy().rne(q, qd, np.zeros(2))    # ValueError: Link(...) is not in list
r.coriolis(q, qd)                   # ValueError: Link(...) is not in list

Notes

  • #722 lists coriolis -> ValueError under "models with no dynamic parameters". That attribution is wrong: this is the error, and it happens on models that do have dynamics.
  • Same family as #705: state that does not survive copy().
  • Workaround: C(q, qd) qd = rne(q, qd, 0) - gravload(q) + friction(qd). Checked against coriolis on the DH Puma 560 (max difference 4e-15), and against a Christoffel-symbol calculation from the mass matrix on the URDF robot.

Fix: have Robot.__deepcopy__ remap each link's parent (and children) onto the copied links, and add a regression test that copy() then rne equals the original.

Found while answering Adineh94's question in discussion #158.

主要语言
C++
星标
3.5k
派生
630
平均合并
2 天 9 分钟
30 天内合并 PR
27

环境准备

从这里开始

  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 摘要。