Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#730 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@huxiaoyi-ovo ci sta già lavorando.

Dal 10/10/2026.

  • #732 di @huxiaoyi-ovo — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
robotics

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
C++
Stelle
3.5k
Fork
630
Merge medio
2g 9m
PR unite (30g)
27

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di petercorke/robotics-toolbox-python

Tutte le issue di petercorke/robotics-toolbox-python

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.