add asyncio new loop

This commit is contained in:
Sem van der Hoeven
2023-06-03 15:42:14 +02:00
parent f29509e16d
commit e0ab883144

View File

@@ -58,7 +58,9 @@ class CameraController(Node):
def setup_websocket(self):
start_server = websockets.serve(self.websocket_video, "0.0.0.0", 9002)
asyncio.run(start_server)
loop = asyncio.new_event_loop()
loop.run_until_complete(start_server)
loop.run_forever()
async def websocket_video(self,websocket,path):
vid = cv2.VideoCapture(0,cv2.CAP_V4L)