Skip to content

Commit

Permalink
Fix invalid rotation matrix in test_rotate()
Browse files Browse the repository at this point in the history
The python unittest `test_Rot3` fails in case gtsam is compiled with cmake option `-D GTSAM_USE_QUATERNION=ON`.
The cause of the test failure is an invalid rotationmatrix with negative determinant in `test_rotate()`.
  • Loading branch information
roderick-koehle authored Mar 24, 2023
1 parent 005c7d4 commit db6792c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/gtsam/tests/test_Rot3.py
Original file line number Diff line number Diff line change
Expand Up @@ -2034,13 +2034,13 @@ def test_axis_angle_stress_test(self) -> None:

def test_rotate(self) -> None:
"""Test that rotate() works for both Point3 and Unit3."""
R = Rot3(np.array([[1, 0, 0], [0, -1, 0], [0, 0, 1]]))
R = Rot3(np.array([[1, 0, 0], [0, -1, 0], [0, 0, -1]]))
p = Point3(1., 1., 1.)
u = Unit3(np.array([1, 1, 1]))
actual_p = R.rotate(p)
actual_u = R.rotate(u)
expected_p = Point3(np.array([1, -1, 1]))
expected_u = Unit3(np.array([1, -1, 1]))
expected_p = Point3(np.array([1, -1, -1]))
expected_u = Unit3(np.array([1, -1, -1]))
np.testing.assert_array_equal(actual_p, expected_p)
np.testing.assert_array_equal(actual_u.point3(), expected_u.point3())

Expand Down

0 comments on commit db6792c

Please sign in to comment.