Skip to content

Commit

Permalink
fix assert on angles
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwlambert authored Jul 13, 2021
1 parent d7151ed commit c4a4e13
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/gtsam/tests/test_ShonanAveraging.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,13 @@ 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)

# map all angles to [0,360)
thetas_deg = thetas_deg % 360
thetas_deg -= max(thetas_deg)

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


if __name__ == "__main__":
Expand Down

0 comments on commit c4a4e13

Please sign in to comment.