Quaternion sign in rotation comparisons
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Domaine
- backend-api-design
Piste de recherche
Start by tracing how Scipp compares spatial rotations in sc.identical, ==, sc.allclose, and the functions in sc.testing; the issue provides a Python example showing the inconsistent results for sign-flipped quaternions. Check the existing rotation comparison tests and add coverage for these cases. Done means comparisons treat rotations represented by opposite-sign quaternions consistently with their rotation matrices.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Rotations built from quaternions are invariant under flipping the sign of the quaternion. But Scipp requires them to be exactly the same when comparing them. E.g.:
import numpy as np
import scipp as sc
q1 = np.array([2, 3, -1, -1])
q2 = -q1
r1 = sc.spatial.rotation(value=q1 / np.linalg.norm(q1))
r2 = sc.spatial.rotation(value=q2 / np.linalg.norm(q2))
print(sc.identical(r1, r2))
print(r1 == r2)
one = sc.spatial.linear_transform(value=np.eye(3))
mat1 = r1 * one
mat2 = r2 * one
print(mat1.value)
print(mat2.value)
print(sc.identical(mat1, mat2))
outputs:
False
<scipp.Variable> () bool <no unit> False
[[-0.33333333 0.66666667 -0.66666667]
[ 0.93333333 0.33333333 -0.13333333]
[ 0.13333333 -0.66666667 -0.73333333]]
[[-0.33333333 0.66666667 -0.66666667]
[ 0.93333333 0.33333333 -0.13333333]
[ 0.13333333 -0.66666667 -0.73333333]]
True
Here, comparing the rotations directly, we get False. But after converting them to rotation matrices, we get True.
The same happens with sc.allclose and the functions in sc.testing.
I think that Scipp should return True in all comparisons above because, even though the number in the quaternions differ, we interpret them as rotations. So comparisons should be performed in that context. But note that this would mean that r1 == r2 can produce a different result from r1.value == r2.value because the latter uses the rotation context and only compares arrays.
- Langage dominant
- C++
- Étoiles
- 148
- Forks
- 25
- Merge moyen
- 2 j 13 h
- PR mergées (30 j)
- 16
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
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 scipp/scipp
-
DType is unhashableOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 56/100
scipp/scipp#4029 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 3/5 1-2 jours Accessibilité débutants 65/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
scipp/scipp#4018 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
scipp/scipp#4016 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 58/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de scipp/scipp
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
jaff-chemistry/jaff#231 ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
Les mainteneurs répondent en général sous 1 jour
-
ColumnDecimal::Append(Int128) stores a value outside the Decimal(P, S) range with no error: cut to 32/64 bits, or with too many digitsPeut-être pris @RUSHIT305 l’a pris aujourd’hui. Ouvertebug data-types
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
ClickHouse/clickhouse-cpp#645 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
[内容提案] 现在C++模块的CMake支持有更新,需要进行同步Ouvertedocumentation enhancement help wanted P0
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#359 ·
Les mainteneurs répondent en général sous 1 jour
-
DXF import: INSERT ignores the BLOCK base pointPeut-être pris @Kevinzhou03 l’a pris aujourd’hui. OuverteType: Bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
openscad/openscad#7360 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour