diff --git a/estimate_distance.py b/estimate_distance.py index 0a98544..6d44410 100644 --- a/estimate_distance.py +++ b/estimate_distance.py @@ -2,9 +2,10 @@ from robot import Arlo def main(): arlo = Arlo(False) - image = arlo.robot.take_photo() - bounding_boxes = arlo.find_aruco(image) - print(arlo.estimate_distance(bounding_boxes[0][0])) + for _ in range(5): + image = arlo.robot.take_photo() + bounding_boxes = arlo.find_aruco(image) + print(arlo.estimate_distance(bounding_boxes[0][0])) if __name__ == "__main__": main() \ No newline at end of file diff --git a/robot/arlo.py b/robot/arlo.py index dad8255..08b196e 100644 --- a/robot/arlo.py +++ b/robot/arlo.py @@ -99,7 +99,7 @@ class Arlo(): avg_size = (avg_width + avg_height)/2 - return (FOCAL_LENGTH * 15)/avg_size + return (FOCAL_LENGTH * 14.5)/avg_size def find_aruco(self, image): aruco_dict = cv2.aruco.Dictionary_get(cv2.aruco.DICT_6X6_250)