diff --git a/src/python_pybind11/test/Matrix3_TEST.py b/src/python_pybind11/test/Matrix3_TEST.py index dc673e2d..15756457 100644 --- a/src/python_pybind11/test/Matrix3_TEST.py +++ b/src/python_pybind11/test/Matrix3_TEST.py @@ -307,7 +307,9 @@ def test_to_quaternion(self): q = Quaterniond(math.pi/2.0, math.pi/2.0, 0) matFromQuat = Matrix3d(q) quatFromMat = Quaterniond(matFromQuat) - self.assertTrue(q == quatFromMat) + # We check both cases as quaternion double-cover the rotation matrix + # space, see https://github.com/gazebosim/gz-math/issues/416#issuecomment-1741741183 + self.assertTrue(q == quatFromMat or q == -quatFromMat) # test the cases where matrix trace is negative # (requires special handling)