镜像自地址
https://github.com/MINT-SJTU/Evo-RL.git
已同步 2026-11-20 18:17:06 +00:00
fix(piper): bool calibration flag and robust can setup/test fallback
这个提交包含在:
@ -17,7 +17,7 @@
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
from lerobot.cameras import CameraConfig
|
||||
from lerobot.utils.piper_sdk import PIPER_CALIBRATION_MODES
|
||||
|
||||
|
||||
from ..config import RobotConfig
|
||||
|
||||
@ -50,10 +50,8 @@ class PiperFollowerConfigBase:
|
||||
# Calibration precision:
|
||||
# homing_offset/range_min/range_max are stored as "degree * calibration_scale".
|
||||
calibration_scale: int = 1000
|
||||
# Calibration policy:
|
||||
# - required: always require calibration
|
||||
# - off: never require calibration
|
||||
calibration_mode: str = "required"
|
||||
# Whether calibration is required on connect when no calibration file exists
|
||||
require_calibration: bool = True
|
||||
|
||||
# Gripper forwarding behavior
|
||||
sync_gripper: bool = True
|
||||
@ -80,8 +78,8 @@ class PiperFollowerConfig(RobotConfig, PiperFollowerConfigBase):
|
||||
raise ValueError("`enable_timeout_s` must be >= 0.")
|
||||
if self.calibration_scale <= 0:
|
||||
raise ValueError("`calibration_scale` must be > 0.")
|
||||
if self.calibration_mode not in PIPER_CALIBRATION_MODES:
|
||||
raise ValueError("`calibration_mode` must be one of: required, off.")
|
||||
if not isinstance(self.require_calibration, bool):
|
||||
raise ValueError("require_calibration must be true or false.")
|
||||
if self.startup_sleep_s < 0:
|
||||
raise ValueError("`startup_sleep_s` must be >= 0.")
|
||||
if not (0 <= self.gripper_effort_default <= 5000):
|
||||
|
||||
@ -29,7 +29,6 @@ from lerobot.utils.piper_sdk import (
|
||||
get_piper_sdk,
|
||||
milli_to_unit,
|
||||
parse_piper_log_level,
|
||||
should_require_piper_calibration,
|
||||
unit_to_milli,
|
||||
)
|
||||
from lerobot.utils.utils import enter_pressed, move_cursor_up
|
||||
@ -98,7 +97,7 @@ class PiperFollower(Robot):
|
||||
should_auto_calibrate = (
|
||||
not self.is_calibrated
|
||||
and calibrate
|
||||
and should_require_piper_calibration(self.config.calibration_mode)
|
||||
and self.config.require_calibration
|
||||
)
|
||||
if should_auto_calibrate:
|
||||
logger.info(
|
||||
@ -125,7 +124,7 @@ class PiperFollower(Robot):
|
||||
logger.info("%s connected.", self)
|
||||
|
||||
def _use_uncalibrated_passthrough(self) -> bool:
|
||||
return not self.is_calibrated and not should_require_piper_calibration(self.config.calibration_mode)
|
||||
return not self.is_calibrated and not self.config.require_calibration
|
||||
|
||||
@property
|
||||
def is_calibrated(self) -> bool:
|
||||
|
||||
在新工单中引用
屏蔽一个用户