[Bug]: manipulability reverses start and end when selecting a robot subchain

Offen Anfängerfreundlich
#943 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
76/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
numpy, python
Bereich
backend, robotics

Rechercherichtung

Finde die Manipulierbarkeitsmethode des Robot-Wrappers und untersuche, wie sie start und end an self.ets weitergibt; im Issue werden die vertauschten Argumente benannt. Füge gezielte Kontrollen für ein explizites standardmäßiges end, nur end, nur start und Teilketten mit zwei Endpunkten hinzu, und verwende dabei die Panda-Beispiele und erwarteten Werte aus dem Bericht. Als abgeschlossen gilt die Arbeit, wenn die Ergebnisse der ausgewählten Kette mit jacob0 übereinstimmen und der explizite Standardaufruf dasselbe Ergebnis wie der implizite liefert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug
RTB version

1.5.0, source main cee0023535988e4ae9490c81d639a46f2311b8fd; spatialmath-python 1.1.19; NumPy 2.5.5; native _fknm_c available

Python version

3.12.14

Operating system

Linux

Expected behavior

Selecting start and end should use the same kinematic chain as jacob0 with the same arguments. Supplying the default end explicitly should also agree with leaving it implicit. For the configuration below, the inverse-condition measure for panda_hand should be approximately 0.09476812042044401. For the subchain from panda_link2 to panda_link6, the minimum singular value should be approximately 0.175997031437505.

Actual behavior

Explicit end="panda_hand" raises ValueError: cond is not defined on empty arrays, whereas the default-end call and the measure computed from the selected Jacobian agree. Selecting panda_link2 to panda_link6 returns approximately 0.27532097160945784 instead of 0.175997031437505.

The robot wrapper builds its sequence with self.ets(end, start), but the sequence API takes start first and end second. This chooses a different chain (or a joint-free chain for an explicitly selected default end). The default call with both arguments omitted is unaffected. This was reproduced with the compiled backend on the source revision above. A focused fix would correct argument forwarding and add controls for explicit defaults, end-only, start-only, and two-ended subchains, without changing the manipulability formulas or public API.

Minimal reproducible example
import numpy as np
import roboticstoolbox as rtb

panda = rtb.models.Panda()
q = np.array([0.3, -0.5, 0.2, -1.8, -0.4, 1.4, 0.6])

selection = dict(start="panda_link2", end="panda_link6")
J = panda.jacob0(q, **selection)
print(panda.manipulability(J=J, method="minsingular"))
print(panda.manipulability(q, method="minsingular", **selection))
# Expected both: 0.175997031437505
# Actual second: 0.27532097160945784

print(panda.manipulability(q, method="invcondition"))
# 0.09476812042044401
print(panda.manipulability(q, end="panda_hand", method="invcondition"))
# ValueError: cond is not defined on empty arrays
Vorherrschende Sprache
C++
Sterne
3.6k
Forks
652
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
92

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus petercorke/robotics-toolbox-python

Alle Issues in petercorke/robotics-toolbox-python

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.