From 2469c99053d243c511189b486b6e2ae7697103b2 Mon Sep 17 00:00:00 2001 From: Remi Cadene Date: Mon, 9 Sep 2024 19:19:05 +0200 Subject: [PATCH] fix unit tests --- lerobot/common/robot_devices/cameras/opencv.py | 4 +--- tests/utils.py | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lerobot/common/robot_devices/cameras/opencv.py b/lerobot/common/robot_devices/cameras/opencv.py index eb724284..6652b538 100644 --- a/lerobot/common/robot_devices/cameras/opencv.py +++ b/lerobot/common/robot_devices/cameras/opencv.py @@ -337,9 +337,7 @@ class OpenCVCamera: return color_image def read_loop(self): - # TODO(rcadene): implement safe exit for the threads, - # to avoid Segfault when main process finishes - while self.stop_event is None or not self.stop_event.is_set(): + while not self.stop_event.is_set(): self.color_image = self.read() def async_read(self): diff --git a/tests/utils.py b/tests/utils.py index 1feb69cb..9e07219f 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -207,7 +207,6 @@ class MockVideoCapture(cv2.VideoCapture): } def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) self._mock_dict = { cv2.CAP_PROP_FPS: 30, cv2.CAP_PROP_FRAME_WIDTH: 640, @@ -235,3 +234,6 @@ class MockVideoCapture(cv2.VideoCapture): w = self.get(cv2.CAP_PROP_FRAME_WIDTH) ret = True return ret, self.image[f"{h}x{w}"] + + def release(self): + pass