Skip tests if alexander koch robot is not available

This commit is contained in:
Remi Cadene
2024-07-10 19:41:57 +02:00
parent c2388c59be
commit 95de4b7454
6 changed files with 55 additions and 10 deletions

View File

@@ -3,6 +3,7 @@ import pytest
from lerobot.common.robot_devices.cameras.opencv import OpenCVCamera, save_images_from_cameras
from lerobot.common.robot_devices.utils import RobotDeviceAlreadyConnectedError, RobotDeviceNotConnectedError
from tests.utils import require_koch
CAMERA_INDEX = 2
# Maximum absolute difference between two consecutive images recored by a camera.
@@ -14,7 +15,8 @@ def compute_max_pixel_difference(first_image, second_image):
return np.abs(first_image.astype(float) - second_image.astype(float)).max()
def test_camera():
@require_koch
def test_camera(request):
"""Test assumes that `camera.read()` returns the same image when called multiple times in a row.
So the environment should not change (you shouldnt be in front of the camera) and the camera should not be moving.
@@ -118,5 +120,6 @@ def test_camera():
del camera
def test_save_images_from_cameras(tmpdir):
@require_koch
def test_save_images_from_cameras(tmpdir, request):
save_images_from_cameras(tmpdir, record_time_s=1)