Skip to content

Commit

Permalink
use mod when comparing angles
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwlambert authored Jul 13, 2021
1 parent cce952f commit d7151ed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/gtsam/tests/test_ShonanAveraging.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ def test_constructorBetweenFactorPose2s(self) -> None:
wRi_list = [result_values.atRot2(i) for i in range(num_images)]
thetas_deg = np.array([wRi.degrees() for wRi in wRi_list])
thetas_deg -= max(thetas_deg)
expected_thetas_deg = np.array([0.0, -270.0, 0.0])
# map all angles to [0,360)
thetas_deg = thetas_deg % 360
expected_thetas_deg = np.array([0.0, 90.0, 0.0])
np.testing.assert_allclose(thetas_deg, expected_thetas_deg)


Expand Down

0 comments on commit d7151ed

Please sign in to comment.