mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-18 02:00:03 +00:00
Remove useless import and args
This commit is contained in:
@@ -19,18 +19,14 @@
|
|||||||
# pytest tests/cameras/test_opencv.py::test_connect
|
# pytest tests/cameras/test_opencv.py::test_connect
|
||||||
# ```
|
# ```
|
||||||
|
|
||||||
from pathlib import Path
|
import time
|
||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import time
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from lerobot.cameras.configs import Cv2Rotation
|
|
||||||
from lerobot.errors import DeviceAlreadyConnectedError, DeviceNotConnectedError
|
|
||||||
|
|
||||||
from lerobot.cameras.reachy2_camera import Reachy2Camera, Reachy2CameraConfig
|
from lerobot.cameras.reachy2_camera import Reachy2Camera, Reachy2CameraConfig
|
||||||
|
from lerobot.errors import DeviceNotConnectedError
|
||||||
|
|
||||||
PARAMS = [
|
PARAMS = [
|
||||||
("teleop", "left"),
|
("teleop", "left"),
|
||||||
@@ -88,7 +84,7 @@ def _make_cam_manager_mock():
|
|||||||
|
|
||||||
@pytest.fixture(
|
@pytest.fixture(
|
||||||
params=PARAMS,
|
params=PARAMS,
|
||||||
# ids=["teleop-left", "teleop-right", "torso-rgb", "torso-depth"], # Depth camera is not available yet
|
# ids=["teleop-left", "teleop-right", "torso-rgb", "torso-depth"],
|
||||||
ids=["teleop-left", "teleop-right", "torso-rgb"],
|
ids=["teleop-left", "teleop-right", "torso-rgb"],
|
||||||
)
|
)
|
||||||
def camera(request):
|
def camera(request):
|
||||||
@@ -141,7 +137,7 @@ def test_async_read(camera):
|
|||||||
assert isinstance(img, np.ndarray)
|
assert isinstance(img, np.ndarray)
|
||||||
finally:
|
finally:
|
||||||
if camera.is_connected:
|
if camera.is_connected:
|
||||||
camera.disconnect() # To stop/join the thread. Otherwise get warnings when the test ends
|
camera.disconnect()
|
||||||
|
|
||||||
|
|
||||||
def test_async_read_timeout(camera):
|
def test_async_read_timeout(camera):
|
||||||
|
|||||||
@@ -75,9 +75,9 @@ def _make_reachy2_sdk_mock():
|
|||||||
"_on_set",
|
"_on_set",
|
||||||
)
|
)
|
||||||
|
|
||||||
def __init__(self, present_position=0.0, initial_goal=None, on_set=None):
|
def __init__(self, present_position=0.0, on_set=None):
|
||||||
self.present_position = present_position
|
self.present_position = present_position
|
||||||
self._goal_position = initial_goal
|
self._goal_position = present_position
|
||||||
self._on_set = on_set
|
self._on_set = on_set
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -109,7 +109,6 @@ def _make_reachy2_sdk_mock():
|
|||||||
joints = {
|
joints = {
|
||||||
k: JointSpy(
|
k: JointSpy(
|
||||||
present_position=float(i),
|
present_position=float(i),
|
||||||
initial_goal=float(i) + 0.1,
|
|
||||||
on_set=_on_any_goal_set,
|
on_set=_on_any_goal_set,
|
||||||
)
|
)
|
||||||
for i, k in enumerate(REACHY2_JOINTS.values())
|
for i, k in enumerate(REACHY2_JOINTS.values())
|
||||||
|
|||||||
Reference in New Issue
Block a user