Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/lerobot/cameras/opencv/camera_opencv.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@ def connect(self, warmup: bool = True) -> None:

self._configure_capture_settings()

# Give the camera time to initialize after configuration
# This helps prevent read failures when multiple cameras are initialized sequentially
time.sleep(1.0)

# Grab a few frames to clear the buffer and ensure camera is ready
for i in range(3):
self.videocapture.grab()
time.sleep(0.1)

if warmup:
start_time = time.time()
while time.time() - start_time < self.warmup_s:
Expand Down