Enhancement: SE3 constructor should accept an (N, 4, 4) ndarray as N poses
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 66/100
- Issue-Typ
- Feature
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- numpy, python
- Bereich
- backend-api-design
Rechercherichtung
Start by reading the SE3 constructor and its existing tests for single matrices and lists of matrices. Run those tests, then add coverage for stacked (N, 4, 4) arrays and unsupported shapes, including the check=False behavior. Done means stacked arrays produce N poses like SE3(list(arr)), while unsupported shapes raise a useful error.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
SE3 can be built from a single 4x4 array, from a list of 4x4 arrays (its own internal representation for a sequence of poses), or from other SE3 objects, but not from a stacked (N, 4, 4) ndarray. That is the natural way to hold a pose sequence in NumPy-based code (for example the output of np.stack, or a trajectory loaded from a file), and it is the form that a number of Robotics Toolbox for Python (RTB) functions accept for pose trajectories.
Reproduction
import numpy as np
from spatialmath import SE3
A = SE3.Rx(0.3).A
arr = np.array([A, A, A]) # shape (3, 4, 4)
SE3(arr)
# ValueError: bad argument to constructor
s = SE3(arr, check=False)
len(s), s.A.shape
# (1, (3, 4, 4)) <- silently a malformed object: length 1, but .A is (3, 4, 4)
len(SE3([A, A, A])) # 3, a list of matrices works
Tested with spatialmath-python 1.1.18.
Why it matters
- With the default
check=Truethe error message does not say what is accepted. - With
check=Falsethe constructor silently returns a malformed object. In RTB this turned a user's(N, 4, 4)trajectory into an object that failed deep inside an IK solver withValueError: operands could not be broadcast together with shapes (3,4) (3,), far from the cause.
Suggested behaviour
- Accept an ndarray with
ndim == 3andshape[1:] == (4, 4)as a sequence of N poses, equivalent toSE3(list(arr)). - For other unsupported shapes, raise an error that says which forms are accepted. Ideally this validation of the array shape (not the matrix contents) would also happen with
check=False, which would skip only the expensive checks that the matrices are valid SE(3).
This is an enhancement request, not a regression. RTB works around it by converting the array to a list of matrices before calling the constructor, so there is no urgency.
- Vorherrschende Sprache
- Python
- Sterne
- 643
- Forks
- 102
- Ø Merge
- 11 Min.
- Gemergte PRs (30 T.)
- 1
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus rai-opensource/spatialmath-python
-
documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
rai-opensource/spatialmath-python#235 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
rai-opensource/spatialmath-python#32 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 68/100
rai-opensource/spatialmath-python#234 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Line3.isparallel()/__or__ still scale-dependent, like the distance() bug fixed in #224Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 72/100
rai-opensource/spatialmath-python#231 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 50/100
rai-opensource/spatialmath-python#177 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in rai-opensource/spatialmath-python
Ähnliche Issues
-
defect from-review v0.9.2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
khuisman/mcp-gee-sweet#926 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 Unter einer Stunde Anfängerfreundlichkeit 84/100
EtanHey/brainlayer#1164 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug security
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
yunaremaia/vibeguard#141 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
PrismorSec/prismor#599 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
iii-hq/iii#2278 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag