fix: resolve basedpyright errors in aruco and tests

This commit is contained in:
2026-02-07 09:00:07 +00:00
parent 4fc8de4bdc
commit 8f6aee7f22
4 changed files with 59 additions and 46 deletions
+6 -5
View File
@@ -18,14 +18,14 @@ def test_compute_face_normal_valid_quad():
# normal = [1, 0, 0] x [0, 1, 0] = [0, 0, 1]
normal = compute_face_normal(corners)
np.testing.assert_allclose(normal, [0, 0, 1], atol=1e-10)
np.testing.assert_allclose(normal, np.array([0, 0, 1]), atol=1e-10)
def test_compute_face_normal_valid_triangle():
corners = np.array([[0, 0, 0], [1, 0, 0], [0, 1, 0]], dtype=np.float64)
normal = compute_face_normal(corners)
np.testing.assert_allclose(normal, [0, 0, 1], atol=1e-10)
np.testing.assert_allclose(normal, np.array([0, 0, 1]), atol=1e-10)
def test_compute_face_normal_degenerate():
@@ -104,7 +104,8 @@ def test_get_face_normal_from_geometry():
}
normal = get_face_normal_from_geometry("top", marker_geometry, face_marker_map)
np.testing.assert_allclose(normal, [0, 0, 1], atol=1e-10)
assert normal is not None
np.testing.assert_allclose(normal, np.array([0, 0, 1]), atol=1e-10)
# Missing face map
assert get_face_normal_from_geometry("top", marker_geometry, None) is None
@@ -145,14 +146,14 @@ def test_detect_ground_face():
assert res is not None
face_name, normal = res
assert face_name == "bottom"
np.testing.assert_allclose(normal, [0, -1, 0], atol=1e-10)
np.testing.assert_allclose(normal, np.array([0, -1, 0]), atol=1e-10)
# Only top visible
res = detect_ground_face({2}, marker_geometry, camera_up, face_marker_map)
assert res is not None
face_name, normal = res
assert face_name == "top"
np.testing.assert_allclose(normal, [0, 1, 0], atol=1e-10)
np.testing.assert_allclose(normal, np.array([0, 1, 0]), atol=1e-10)
# None visible
assert (