Merge branch 'main' into feature/add-multitask-dit

This commit is contained in:
Bryson Jones
2026-01-14 08:30:26 -08:00
committed by GitHub
7 changed files with 29 additions and 4 deletions

View File

@@ -22,20 +22,21 @@ Short, imperative summary (e.g., "fix(robots): handle None in sensor parser"). S
- Short, concrete bullets of the modifications (files/behaviour).
- Short note if this introduces breaking changes and migration steps.
## How was this tested
## How was this tested (or how to run locally)
- Tests added: list new tests or test files.
- Manual checks / dataset runs performed.
- Instructions for the reviewer
## How to run locally (reviewer)
Example:
- Run the relevant tests:
- Ran the relevant tests:
```bash
pytest -q tests/ -k <keyword>
```
- Run a quick example or CLI (if applicable):
- Reproduce with a quick example or CLI (if applicable):
```bash
lerobot-train --some.option=true

View File

@@ -18,6 +18,7 @@ import logging
from functools import cached_property
from lerobot.teleoperators.so_leader import SOLeaderTeleopConfig
from lerobot.utils.errors import DeviceNotConnectedError
from ..so_leader import SOLeader
from ..teleoperator import Teleoperator
@@ -92,6 +93,9 @@ class BiSOLeader(Teleoperator):
self.right_arm.setup_motors()
def get_action(self) -> dict[str, float]:
if not self.is_connected:
raise DeviceNotConnectedError(f"{self} is not connected.")
action_dict = {}
# Add "left_" prefix

View File

@@ -21,6 +21,7 @@ from typing import Any
import numpy as np
from lerobot.processor import RobotAction
from lerobot.utils.errors import DeviceNotConnectedError
from ..teleoperator import Teleoperator
from ..utils import TeleopEvents
@@ -86,6 +87,9 @@ class GamepadTeleop(Teleoperator):
self.gamepad.start()
def get_action(self) -> RobotAction:
if not self.is_connected:
raise DeviceNotConnectedError(f"{self} is not connected.")
# Update the controller to get fresh inputs
self.gamepad.update()
@@ -158,6 +162,7 @@ class GamepadTeleop(Teleoperator):
self.gamepad.stop()
self.gamepad = None
@property
def is_connected(self) -> bool:
"""Check if gamepad is connected."""
return self.gamepad is not None

View File

@@ -300,6 +300,9 @@ class HomunculusArm(Teleoperator):
logger.debug(f"Error reading frame in background thread for {self}: {e}")
def get_action(self) -> dict[str, float]:
if not self.is_connected:
raise DeviceNotConnectedError(f"{self} is not connected.")
joint_positions = self._read()
return {f"{joint}.pos": pos for joint, pos in joint_positions.items()}

View File

@@ -326,6 +326,9 @@ class HomunculusGlove(Teleoperator):
logger.debug(f"Error reading frame in background thread for {self}: {e}")
def get_action(self) -> dict[str, float]:
if not self.is_connected:
raise DeviceNotConnectedError(f"{self} is not connected.")
joint_positions = self._read()
return homunculus_glove_to_hope_jr_hand(
{f"{joint}.pos": pos for joint, pos in joint_positions.items()}

View File

@@ -165,6 +165,9 @@ class IOSPhone(BasePhone, Teleoperator):
return True, pos, rot, pose
def get_action(self) -> dict:
if not self.is_connected:
raise DeviceNotConnectedError(f"{self} is not connected.")
has_pose, raw_position, raw_rotation, fb_pose = self._read_current_pose()
if not has_pose or not self.is_calibrated:
return {}
@@ -319,6 +322,9 @@ class AndroidPhone(BasePhone, Teleoperator):
self._latest_message = message
def get_action(self) -> dict:
if not self.is_connected:
raise DeviceNotConnectedError(f"{self} is not connected.")
ok, raw_pos, raw_rot, pose = self._read_current_pose()
if not ok or not self.is_calibrated:
return {}

View File

@@ -140,6 +140,9 @@ class SOLeader(Teleoperator):
print(f"'{motor}' motor id set to {self.bus.motors[motor].id}")
def get_action(self) -> dict[str, float]:
if not self.is_connected:
raise DeviceNotConnectedError(f"{self} is not connected.")
start = time.perf_counter()
action = self.bus.sync_read("Present_Position")
action = {f"{motor}.pos": val for motor, val in action.items()}