Skip to content

Commit

Permalink
Fix wrapping of computed angles in test_constructorBetweenFactorPose2s
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Dec 9, 2024
1 parent 044242e commit 4f3df74
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions python/gtsam/tests/test_ShonanAveraging.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,8 @@ 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])

# map all angles to [0,360)
thetas_deg = thetas_deg % 360
thetas_deg -= thetas_deg[0]
# map all angles to [-180,180)
thetas_deg = (thetas_deg - thetas_deg[0] + 180) % 360 - 180

expected_thetas_deg = np.array([0.0, 90.0, 0.0])
np.testing.assert_allclose(thetas_deg, expected_thetas_deg, atol=0.1)
Expand Down

0 comments on commit 4f3df74

Please sign in to comment.