diff --git a/lerobot/common/robot_devices/cameras/opencv.py b/lerobot/common/robot_devices/cameras/opencv.py index eb7242847..6652b5388 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 1feb69cb5..9e07219fb 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