Fix wrapping of computed angles in test_backwards_compatibility.py

release/4.3a0
Martin Valgur 2024-12-10 20:37:15 +02:00
parent b2a351c8de
commit 8583185153
1 changed files with 2 additions and 3 deletions

View File

@ -472,9 +472,8 @@ class TestBackwardsCompatibility(GtsamTestCase):
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)