From a71712b8a459a56bba73692c9727873f27b57e59 Mon Sep 17 00:00:00 2001 From: Davide Depau Date: Sun, 11 Aug 2024 22:22:02 +0200 Subject: [PATCH] Ignore invalid marker IDs --- bot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 4d4ed26..c1cc45e 100644 --- a/bot.py +++ b/bot.py @@ -147,7 +147,11 @@ class Bot: ) if corners is not None and ids is not None: for corner, i in zip(corners, ids): - aruco_corners[i[0]] = corner + index = i[0] + if not (0 <= index < 4): + warnings.warn(f"Invalid ArUco marker ID: {index}") + continue + aruco_corners[index] = corner assert annotated_image is not None del vcap