Enhancement: SE3 constructor should accept an (N, 4, 4) ndarray as N poses
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 66/100
- Type d'issue
- Fonctionnalité
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- numpy, python
- Domaine
- backend-api-design
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Python
- Étoiles
- 643
- Forks
- 102
- Merge moyen
- 11 min
- PR mergées (30 j)
- 1
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de rai-opensource/spatialmath-python
-
documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
rai-opensource/spatialmath-python#235 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
rai-opensource/spatialmath-python#32 · 4 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 4/5 3-5 jours Accessibilité débutants 68/100
rai-opensource/spatialmath-python#234 ·
Les mainteneurs répondent en général sous 1 jour
-
Line3.isparallel()/__or__ still scale-dependent, like the distance() bug fixed in #224Peut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 72/100
rai-opensource/spatialmath-python#231 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 50/100
rai-opensource/spatialmath-python#177 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de rai-opensource/spatialmath-python
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
Les mainteneurs répondent en général sous 1 jour
-
area:docs
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
RailtownAI/railtracks#1633 ·
Les mainteneurs répondent en général sous 2 jours
-
review-panel severity:low
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
kristovatlas/coin-accounting#152 ·
Les mainteneurs répondent en général sous 1 jour
-
documentation :blue_book:
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
PennyLaneAI/pennylane#10280 ·
Les mainteneurs répondent en général sous 2 jours
-
`pipx reinstall` prints a Python traceback when the reinstall failsPeut-être pris @ParamTanna l’a pris aujourd’hui. Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour