Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#730 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@huxiaoyi-ovo đang làm issue này rồi.

Từ ngày 10/10/2026.

  • #732 của @huxiaoyi-ovo — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
robotics

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C++
Star
3.5k
Fork
630
Merge trung bình
2 ngày 14 giờ
Pull request đã merge (30 ngày)
65

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của petercorke/robotics-toolbox-python

Tất cả issue của petercorke/robotics-toolbox-python

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.