bdaiinstitute / spatialmath-python

Create, manipulate and convert representations of position and orientation in 2D or 3D using Python
MIT License
519 stars 84 forks source link

SE3.Eul() method returns same for 180 degree rotation about X and Z axes #45

Closed jmount1992 closed 2 years ago

jmount1992 commented 2 years ago

The SE3.Eul method returns the same matrix for a 180 degree rotation about the X and Z axes.

Running

import spatialmath as sm
print(sm.SE3.Eul([0, 0, 180], unit='deg')) # this creates same rotation matrix as line below
print(sm.SE3.Eul([180, 0, 0], unit='deg'))

Haven't had a chance to look further as to why. Will hopefully find the root of the problem and do a PR.

petercorke commented 2 years ago

This is correct behaviour. Because the middle rotation is zero, it is a rotation of 180deg about z-axis in both cases.