use mod when comparing angles

release/4.3a0
John Lambert 2021-07-12 20:52:36 -04:00 committed by GitHub
parent cce952fbb3
commit d7151ed284
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -197,7 +197,9 @@ class TestShonanAveraging(GtsamTestCase):
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)