From b0d05080e0379ded9cde85aa9164e1bfea8aa3b1 Mon Sep 17 00:00:00 2001 From: apirrone Date: Tue, 26 Nov 2024 10:44:28 +0100 Subject: [PATCH] using only teleop camera for now --- .../common/robot_devices/cameras/reachy2.py | 9 ++++++--- lerobot/common/robot_devices/robots/reachy2.py | 5 +++-- lerobot/configs/robot/reachy2.yaml | 18 +++++++++--------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/lerobot/common/robot_devices/cameras/reachy2.py b/lerobot/common/robot_devices/cameras/reachy2.py index 1f547b3b2..c75dab3ef 100644 --- a/lerobot/common/robot_devices/cameras/reachy2.py +++ b/lerobot/common/robot_devices/cameras/reachy2.py @@ -70,9 +70,11 @@ def read(self) -> np.ndarray: if self.name == "teleop" and hasattr(self.cam_manager, "teleop"): if self.image_type == "left": - return self.cam_manager.teleop.get_compressed_frame(CameraView.LEFT) + return self.cam_manager.teleop.get_frame(CameraView.LEFT) + # return self.cam_manager.teleop.get_compressed_frame(CameraView.LEFT) elif self.image_type == "right": - return self.cam_manager.teleop.get_compressed_frame(CameraView.RIGHT) + return self.cam_manager.teleop.get_frame(CameraView.RIGHT) + # return self.cam_manager.teleop.get_compressed_frame(CameraView.RIGHT) else: return None elif self.name == "depth" and hasattr(self.cam_manager, "depth"): @@ -80,7 +82,8 @@ def read(self) -> np.ndarray: if self.image_type == "depth": return self.cam_manager.depth.get_depth_frame() elif self.image_type == "rgb": - return self.cam_manager.depth.get_compressed_frame() + return self.cam_manager.depth.get_frame() + # return self.cam_manager.depth.get_compressed_frame() else: return None return None diff --git a/lerobot/common/robot_devices/robots/reachy2.py b/lerobot/common/robot_devices/robots/reachy2.py index bc0b02d45..252148f56 100644 --- a/lerobot/common/robot_devices/robots/reachy2.py +++ b/lerobot/common/robot_devices/robots/reachy2.py @@ -25,12 +25,13 @@ from lerobot.common.robot_devices.cameras.utils import Camera + @dataclass class ReachyRobotConfig: robot_type: str | None = "Reachy2" cameras: dict[str, Camera] = field(default_factory=lambda: {}) - # ip_address: str | None = "172.17.135.207" - ip_address: str | None = "localhost" + ip_address: str | None = "172.17.135.207" + # ip_address: str | None = "localhost" class ReachyRobot: diff --git a/lerobot/configs/robot/reachy2.yaml b/lerobot/configs/robot/reachy2.yaml index abbbc8da6..456387e41 100644 --- a/lerobot/configs/robot/reachy2.yaml +++ b/lerobot/configs/robot/reachy2.yaml @@ -13,8 +13,8 @@ cameras: head_left: _target_: lerobot.common.robot_devices.cameras.reachy2.ReachyCamera name: teleop - # host: 172.17.135.207 - host: localhost + host: 172.17.135.207 + # host: localhost port: 50065 image_type: left # head_right: @@ -23,13 +23,13 @@ cameras: # host: 172.17.135.207 # port: 50065 # image_type: right - torso_rgb: - _target_: lerobot.common.robot_devices.cameras.reachy2.ReachyCamera - name: depth - # host: 172.17.135.207 - host: localhost - port: 50065 - image_type: rgb + # torso_rgb: + # _target_: lerobot.common.robot_devices.cameras.reachy2.ReachyCamera + # name: depth + # host: 172.17.135.207 + # # host: localhost + # port: 50065 + # image_type: rgb # torso_depth: # _target_: lerobot.common.robot_devices.cameras.reachy2.ReachyCamera # name: depth