修改控制按钮;增加enter以确认当前轨迹;增加backspace以丢弃当前轨迹。
Some checks are pending
Secret Leaks / trufflehog (push) Waiting to run

This commit is contained in:
2025-05-07 21:05:28 +08:00
parent 5bf422ca6f
commit ac85a0d17e
2 changed files with 33 additions and 8 deletions

View File

@@ -291,6 +291,28 @@ def record(
single_task=cfg.single_task,
)
# 录制完成后等待用户确认是否保存
if not events["stop_recording"] and not events["rerecord_episode"]:
log_say("Episode recorded. Press Enter to save, Backspace to discard, Esc to end session", cfg.play_sounds)
print("Confirmation controls: Enter to save, Backspace to discard, Esc to end recording session")
# 等待用户确认是否保存该段录制
waiting_for_confirmation = True
events["confirm_save"] = False
events["discard_episode"] = False
while waiting_for_confirmation and not events["stop_recording"]:
time.sleep(0.1)
if events["confirm_save"]:
log_say("Saving episode", cfg.play_sounds)
waiting_for_confirmation = False
elif events["discard_episode"]:
log_say("Discarding episode", cfg.play_sounds)
events["rerecord_episode"] = True
waiting_for_confirmation = False
elif events["stop_recording"]:
waiting_for_confirmation = False
# Execute a few seconds without recording to give time to manually reset the environment
# Current code logic doesn't allow to teleoperate during this time.
# TODO(rcadene): add an option to enable teleoperation during reset