coriolis() and Robot.copy().rne() fail for URDF/ETS robots: copied links keep their original parent
维护者通常 2 天内回复
评估
调研方向
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 内容生成。
描述
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->ValueErrorunder "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 againstcoriolison 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
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
petercorke/robotics-toolbox-python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
petercorke/robotics-toolbox-python#709 ·
维护者通常 2 天内回复
-
Adapt to pgraph-python 1.0: plot() option names and the single Vertex class可能已有人在做 @tandede 今天认领。 未关闭dependencies tech-debt
难度 2/5 1-3 小时 新手友好度 35/100
petercorke/robotics-toolbox-python#738 ·
维护者通常 2 天内回复
-
jacob0_dot: docstring errors, and analytic-representation path is a numerical Hessian可能已有人在做 @paneendrakumar0 于 1 天前认领。 未关闭tech-debt
难度 4/5 3-5 天 新手友好度 25/100
petercorke/robotics-toolbox-python#734 ·
维护者通常 2 天内回复
-
Interbotix URDF models (wx200 etc.): gripper counted as arm joints, ambiguous end-effector, qr outside joint limits可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug
难度 4/5 3-5 天 新手友好度 35/100
petercorke/robotics-toolbox-python#729 ·
维护者通常 2 天内回复
-
paycap crashes for robots with n != 6 and its docstring does not match its behaviour可能已有人在做 @huxiaoyi-ovo 于 2 天前认领。 未关闭bug
难度 4/5 3-5 天 新手友好度 18/100
petercorke/robotics-toolbox-python#728 · 1 条评论 ·
维护者通常 2 天内回复
查看 petercorke/robotics-toolbox-python 的全部 Issue
相似的 Issue
-
ai_p2
难度 2/5 1-3 小时 新手友好度 68/100
ClickHouse/ClickHouse#125522 ·
维护者通常 1 天内回复
-
Branch-3.3.5a
难度 2/5 1-3 小时 新手友好度 67/100
TrinityCore/TrinityCore#32060 ·
维护者通常 3 天内回复
-
needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
open-telemetry/opentelemetry-cpp#4697 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
secondlife/viewer#6432 · 1 条评论 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 82/100
rajpreetcodes/Skills_MCP_Server#39 ·
维护者通常 1 天内回复