handling reachy not having a leader arm. Starting to work

This commit is contained in:
apirrone 2024-11-25 16:56:11 +01:00
parent 52b7bde587
commit 13a2091db3
3 changed files with 9 additions and 8 deletions

View File

@ -43,7 +43,7 @@ def log_control_info(robot: Robot, dt_s, episode_index=None, frame_index=None, f
log_dt("dt", dt_s) log_dt("dt", dt_s)
# TODO(aliberts): move robot-specific logs logic in robot.print_logs() # TODO(aliberts): move robot-specific logs logic in robot.print_logs()
if not robot.robot_type.startswith("stretch"): if not robot.robot_type.startswith(("stretch", "Reachy")):
for name in robot.leader_arms: for name in robot.leader_arms:
key = f"read_leader_{name}_pos_dt_s" key = f"read_leader_{name}_pos_dt_s"
if key in robot.logs: if key in robot.logs:

View File

@ -15,20 +15,21 @@
# limitations under the License. # limitations under the License.
import time import time
from copy import copy
from dataclasses import dataclass, field, replace from dataclasses import dataclass, field, replace
import numpy as np import numpy as np
import torch import torch
from lerobot.common.robot_devices.cameras.utils import Camera
from reachy2_sdk import ReachySDK from reachy2_sdk import ReachySDK
from copy import copy
from lerobot.common.robot_devices.cameras.utils import Camera
@dataclass @dataclass
class ReachyRobotConfig: class ReachyRobotConfig:
robot_type: str | None = "Reachy2" robot_type: str | None = "Reachy2"
cameras: dict[str, Camera] = field(default_factory=lambda: {}) cameras: dict[str, Camera] = field(default_factory=lambda: {})
ip_address: str | None = "localhost" ip_address: str | None = "172.17.135.207"
class ReachyRobot: class ReachyRobot:

View File

@ -13,24 +13,24 @@ cameras:
head_left: head_left:
_target_: lerobot.common.robot_devices.cameras.reachy2.ReachyCamera _target_: lerobot.common.robot_devices.cameras.reachy2.ReachyCamera
name: teleop name: teleop
host: localhost host: 172.17.135.207
port: 50065 port: 50065
image_type: left image_type: left
head_right: head_right:
_target_: lerobot.common.robot_devices.cameras.reachy2.ReachyCamera _target_: lerobot.common.robot_devices.cameras.reachy2.ReachyCamera
name: teleop name: teleop
host: localhost host: 172.17.135.207
port: 50065 port: 50065
image_type: right image_type: right
torso_rgb: torso_rgb:
_target_: lerobot.common.robot_devices.cameras.reachy2.ReachyCamera _target_: lerobot.common.robot_devices.cameras.reachy2.ReachyCamera
name: depth name: depth
host: localhost host: 172.17.135.207
port: 50065 port: 50065
image_type: rgb image_type: rgb
torso_depth: torso_depth:
_target_: lerobot.common.robot_devices.cameras.reachy2.ReachyCamera _target_: lerobot.common.robot_devices.cameras.reachy2.ReachyCamera
name: depth name: depth
host: localhost host: 172.17.135.207
port: 50065 port: 50065
image_type: depth image_type: depth