Skip to content

Commit 21d4931

Browse files
authored
Merge pull request #26 from srobo/sbot_simulator
Also close camera socket
2 parents 7aa3364 + 4971f5e commit 21d4931

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sr/robot3/simulator/camera.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import atexit
12
import struct
23

34
import cv2
@@ -39,6 +40,8 @@ def __init__(self, camera_info: BoardInfo) -> None:
3940
self.image_size = tuple(map(int, response.split(b":")))
4041
assert len(self.image_size) == 2, f"Invalid image dimensions: {self.image_size}"
4142

43+
atexit.register(self.close)
44+
4245
def read(self, fresh: bool = True) -> NDArray:
4346
"""
4447
The method for getting a new frame.

0 commit comments

Comments
 (0)