镜像自地址
https://github.com/MINT-SJTU/Evo-RL.git
已同步 2026-11-20 18:17:06 +00:00
fix(human-inloop): reset to stored pose after success
- return the robot to the stored reset pose for both success and failure outcomes - clarify reset logging so it matches the generalized behavior - add a controller test covering success-triggered resets
这个提交包含在:
@ -43,6 +43,7 @@ from lerobot.scripts.lerobot_record import (
|
||||
)
|
||||
from lerobot.scripts.lerobot_replay import DatasetReplayConfig, ReplayConfig, replay
|
||||
from lerobot.scripts.lerobot_teleoperate import TeleoperateConfig, teleoperate
|
||||
from lerobot.utils.recording_annotations import EPISODE_SUCCESS
|
||||
from tests.fixtures.constants import DUMMY_REPO_ID
|
||||
from tests.mocks.mock_robot import MockRobot, MockRobotConfig
|
||||
from tests.mocks.mock_teleop import MockTeleop, MockTeleopConfig
|
||||
@ -277,6 +278,34 @@ def test_human_inloop_failure_reset_controller_reuses_existing_pose(tmp_path):
|
||||
mock_save.assert_not_called()
|
||||
|
||||
|
||||
def test_human_inloop_failure_reset_controller_resets_on_success(tmp_path):
|
||||
robot_cfg = MockRobotConfig()
|
||||
teleop_cfg = MockTeleopConfig()
|
||||
dataset_cfg = DatasetRecordConfig(
|
||||
repo_id=DUMMY_REPO_ID,
|
||||
single_task="Dummy task",
|
||||
root=tmp_path / "hil_with_policy_success_reset",
|
||||
num_episodes=1,
|
||||
episode_time_s=0.1,
|
||||
reset_time_s=0,
|
||||
push_to_hub=False,
|
||||
)
|
||||
cfg = RecordConfig(
|
||||
robot=robot_cfg,
|
||||
dataset=dataset_cfg,
|
||||
teleop=teleop_cfg,
|
||||
play_sounds=False,
|
||||
)
|
||||
controller = _HumanInloopFailureResetController(cfg)
|
||||
controller.failure_reset_pose = {"motor_1.pos": 1.0, "motor_2.pos": -2.0}
|
||||
|
||||
with patch("lerobot.scripts.lerobot_human_inloop_record._slow_reset_all_arms_to_pose") as mock_reset:
|
||||
controller.on_episode_outcome(robot=MagicMock(), teleop=MagicMock(), episode_success=EPISODE_SUCCESS)
|
||||
|
||||
mock_reset.assert_called_once()
|
||||
assert mock_reset.call_args.kwargs["target_pose"] == {"motor_1.pos": 1.0, "motor_2.pos": -2.0}
|
||||
|
||||
|
||||
def test_slow_reset_all_arms_to_pose_uses_interpolation():
|
||||
robot = MockRobot(MockRobotConfig(n_motors=2, random_values=False, static_values=[0.0, 0.0]))
|
||||
teleop = MagicMock()
|
||||
|
||||
在新工单中引用
屏蔽一个用户