feat(async): register unitree_g1 and zmq camera in robot_client

Async inference against the G1 failed at config parsing: draccus had no
choice class for robot type 'unitree_g1' or camera type 'zmq' because
neither module was imported for registration. Also guard the realsense
import, since pyrealsense2 isn't importable on every platform (e.g. Jetson
with an older glibc) and shouldn't crash the client when it goes unused.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Martino Russi
2026-08-07 15:04:08 +02:00
parent 09fb2b4580
commit b4ffe89c3d
+10 -1
View File
@@ -48,7 +48,15 @@ import grpc
import torch
from lerobot.cameras.opencv import OpenCVCameraConfig # noqa: F401
from lerobot.cameras.realsense import RealSenseCameraConfig # noqa: F401
from lerobot.cameras.zmq.configuration_zmq import ZMQCameraConfig # noqa: F401
# pyrealsense2 isn't importable on every platform (e.g. Jetson with an older glibc). Register
# the realsense camera type when it's available, but don't hard-crash the client when it isn't.
try:
from lerobot.cameras.realsense import RealSenseCameraConfig # noqa: F401
except ImportError:
RealSenseCameraConfig = None
from lerobot.robots import ( # noqa: F401
Robot,
RobotConfig,
@@ -57,6 +65,7 @@ from lerobot.robots import ( # noqa: F401
make_robot_from_config,
omx_follower,
so_follower,
unitree_g1,
)
from lerobot.transport import (
services_pb2, # type: ignore