Skip to content

Commit d7151ed

Browse files
authored
use mod when comparing angles
1 parent cce952f commit d7151ed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

python/gtsam/tests/test_ShonanAveraging.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ def test_constructorBetweenFactorPose2s(self) -> None:
197197
wRi_list = [result_values.atRot2(i) for i in range(num_images)]
198198
thetas_deg = np.array([wRi.degrees() for wRi in wRi_list])
199199
thetas_deg -= max(thetas_deg)
200-
expected_thetas_deg = np.array([0.0, -270.0, 0.0])
200+
# map all angles to [0,360)
201+
thetas_deg = thetas_deg % 360
202+
expected_thetas_deg = np.array([0.0, 90.0, 0.0])
201203
np.testing.assert_allclose(thetas_deg, expected_thetas_deg)
202204

203205

0 commit comments

Comments
 (0)