From a527e1422c25df73e30ee4f0c38ccbe56f6da4e4 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Sun, 1 Oct 2023 10:55:45 +0200 Subject: [PATCH] Fix Matrix3_TEST.py on Windows with conda-forge dependencies (#561) Signed-off-by: Silvio Traversaro --- src/python_pybind11/test/Matrix3_TEST.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/python_pybind11/test/Matrix3_TEST.py b/src/python_pybind11/test/Matrix3_TEST.py index dc673e2d3..15756457e 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)