From b5b2dbd7a0d23acccc725a64d77c887bceb51ef8 Mon Sep 17 00:00:00 2001 From: ChenYuhan <2514158309@qq.com> Date: Tue, 18 Aug 2026 09:08:52 +0800 Subject: [PATCH] Add simpler alias to some command --- README.md | 16 ++++++++-------- README_ZH.md | 16 ++++++++-------- config/gello/xarm7_gello_record_config.yaml | 2 +- docs/gello_xarm7_smooth_safe_recording_zh.md | 2 +- pyproject.toml | 2 ++ tests/test_manual_mode.py | 2 +- 6 files changed, 21 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index ee49527..ddcf5cc 100644 --- a/README.md +++ b/README.md @@ -170,13 +170,13 @@ Boundary remains enabled at the hard floor as a final stop. ```bash # Record a new dataset -uv run uf-lerobot-record --config_path config/gello/xarm7_gello_record_config.yaml +uv run record --config_path config/gello/xarm7_gello_record_config.yaml # Continue recording on an existing dataset -uv run uf-lerobot-record --config_path config/gello/xarm7_gello_record_config.yaml -r +uv run record --config_path config/gello/xarm7_gello_record_config.yaml -r # Optional: save episodes in the background -uv run uf-lerobot-record --config_path config/gello/xarm7_gello_record_config.yaml -a +uv run record --config_path config/gello/xarm7_gello_record_config.yaml -a ``` Controls: `Space` start the episode, `→` save it, `←` discard and re-record it, `Esc` stop recording. The arm resets to its initial point between episodes. @@ -192,7 +192,7 @@ Controls: `Space` start the episode, `→` save it, `←` discard and re-record ./start_manual_record.sh -r # force resume; fails if the dataset directory does not exist ``` -The record script (`uf-lerobot-record`) reads `dataset.root` from the config and checks the path before recording, then: +The `record` command reads `dataset.root` from the config and checks the path before recording, then: - Directory does not exist → records a new dataset. - Directory already exists (valid LeRobot dataset) and no `-r` was given → asks interactively: @@ -201,7 +201,7 @@ The record script (`uf-lerobot-record`) reads `dataset.root` from the config and - `c` cancel - Directory exists but is incomplete (missing required metadata or data parquet files) → asks to overwrite it or cancel; non-interactive runs error out instead. -Pass `-r` to resume directly without asking. Note that `./start_manual_record.sh` keeps its original launcher behavior — it automatically resumes an existing valid dataset (equivalent to `-r`), so run `uv run uf-lerobot-record --config_path config/manual_mode/xarm7_manual_record_config.yaml` directly if you want to see the overwrite/resume prompt. +Pass `-r` to resume directly without asking. Note that `./start_manual_record.sh` keeps its original launcher behavior — it automatically resumes an existing valid dataset (equivalent to `-r`), so run `uv run record --config_path config/manual_mode/xarm7_manual_record_config.yaml` directly if you want to see the overwrite/resume prompt. During recording the arm is in teach mode: the actual joint state is written as both the observation and the action. Hold `C` to slowly close the gripper and `O` to slowly open it. Controls: `Space` start, `→` save, `←` discard & re-record, `Esc` stop. Reset the arm manually between episodes. @@ -244,15 +244,15 @@ uv run uf-lerobot-eval \ Replay the absolute joint states (`observation.state`) of a manual-drag episode on an xArm7. States are sent as absolute targets at the dataset FPS (default 30), so the motion matches the recording: ```bash -uv run uf-lerobot-replay \ +uv run replay \ --dataset-root /path/to/xarm7_manual_datas \ --robot-ip 192.168.1.245 # Skip the interactive confirmation (non-interactive use) -uv run uf-lerobot-replay --dataset-root /path/to/xarm7_manual_datas --robot-ip 192.168.1.245 --yes +uv run replay --dataset-root /path/to/xarm7_manual_datas --robot-ip 192.168.1.245 --yes # Replay another episode -uv run uf-lerobot-replay --dataset-root /path/to/xarm7_manual_datas --robot-ip 192.168.1.245 --episode-index 3 +uv run replay --dataset-root /path/to/xarm7_manual_datas --robot-ip 192.168.1.245 --episode-index 3 ``` The robot first moves to the xArm SDK initial point, then replays the episode and stays at the last state. Make sure the workspace is clear and the recorded initial pose matches the current arm setup. diff --git a/README_ZH.md b/README_ZH.md index 5b67982..033d09d 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -164,13 +164,13 @@ uv run uf-read-tcp-z \ ```bash # 录制新数据集 -uv run uf-lerobot-record --config_path config/gello/xarm7_gello_record_config.yaml +uv run record --config_path config/gello/xarm7_gello_record_config.yaml # 在已有数据集上续录 -uv run uf-lerobot-record --config_path config/gello/xarm7_gello_record_config.yaml -r +uv run record --config_path config/gello/xarm7_gello_record_config.yaml -r # 可选:后台异步保存 episode -uv run uf-lerobot-record --config_path config/gello/xarm7_gello_record_config.yaml -a +uv run record --config_path config/gello/xarm7_gello_record_config.yaml -a ``` 按键控制:`Space` 开始当前 episode,`→` 保存,`←` 放弃并重录,`Esc` 停止录制。每个 episode 之间机械臂会自动复位到初始点。 @@ -186,7 +186,7 @@ uv run uf-lerobot-record --config_path config/gello/xarm7_gello_record_config.ya ./start_manual_record.sh -r # 强制续录;数据集目录不存在时会报错 ``` -录制脚本(`uf-lerobot-record`)会从配置读取 `dataset.root` 并在录制前检查路径,然后: +`record` 命令会从配置读取 `dataset.root` 并在录制前检查路径,然后: - 目录不存在:直接录制新数据集。 - 目录已存在(有效 LeRobot 数据集)且未加 `-r`:交互询问: @@ -195,7 +195,7 @@ uv run uf-lerobot-record --config_path config/gello/xarm7_gello_record_config.ya - `c` 取消 - 目录存在但不完整(缺少必要元数据或数据 parquet 文件):询问覆盖或取消;非交互运行时直接报错。 -加 `-r` 可跳过询问直接续录。注意 `./start_manual_record.sh` 保持原有启动脚本行为——检测到有效数据集会自动续录(相当于 `-r`),如果想看到覆盖/续录的询问,请直接用 `uv run uf-lerobot-record --config_path config/manual_mode/xarm7_manual_record_config.yaml` 运行。 +加 `-r` 可跳过询问直接续录。注意 `./start_manual_record.sh` 保持原有启动脚本行为——检测到有效数据集会自动续录(相当于 `-r`),如果想看到覆盖/续录的询问,请直接用 `uv run record --config_path config/manual_mode/xarm7_manual_record_config.yaml` 运行。 录制时机械臂处于示教模式,实际关节状态会同时作为 observation 和 action 写入数据集。按住 `C` 缓慢闭合夹爪,按住 `O` 缓慢张开。按键控制:`Space` 开始,`→` 保存,`←` 放弃并重录,`Esc` 停止。episode 之间手动复位机械臂。 @@ -239,15 +239,15 @@ uv run uf-lerobot-eval \ ```bash # 默认回放第一条 -uv run uf-lerobot-replay \ +uv run replay \ --dataset-root /path/to/xarm7_manual_datas \ --robot-ip 192.168.1.245 # 跳过交互确认(无人值守) -uv run uf-lerobot-replay --dataset-root /path/to/xarm7_manual_datas --robot-ip 192.168.1.245 --yes +uv run replay --dataset-root /path/to/xarm7_manual_datas --robot-ip 192.168.1.245 --yes # 回放其他 episode -uv run uf-lerobot-replay --dataset-root /path/to/xarm7_manual_datas --robot-ip 192.168.1.245 --episode-index 3 +uv run replay --dataset-root /path/to/xarm7_manual_datas --robot-ip 192.168.1.245 --episode-index 3 ``` 回放开始前机械臂会先移动到 xArm SDK 初始点,播放结束后保持最后一帧姿态并断开连接。执行前请确认工作空间无障碍物,且数据中的初始姿态与当前设备一致。 diff --git a/config/gello/xarm7_gello_record_config.yaml b/config/gello/xarm7_gello_record_config.yaml index ed056df..e06531d 100644 --- a/config/gello/xarm7_gello_record_config.yaml +++ b/config/gello/xarm7_gello_record_config.yaml @@ -18,7 +18,7 @@ robot: min_tcp_z_mm: -2.0 # CPU-local FK/Jacobian projection keeps ServoJ free of synchronous SDK queries. tcp_z_guard_backend: "local_projection" - tcp_z_soft_margin_mm: 5.0 + tcp_z_soft_margin_mm: 0.5 local_kinematics_max_error_mm: 2.0 controller_safety_boundary: true # Append gripper initialization/read/write failures here. diff --git a/docs/gello_xarm7_smooth_safe_recording_zh.md b/docs/gello_xarm7_smooth_safe_recording_zh.md index b2c1da7..7c0cc6b 100644 --- a/docs/gello_xarm7_smooth_safe_recording_zh.md +++ b/docs/gello_xarm7_smooth_safe_recording_zh.md @@ -160,7 +160,7 @@ logs/xarm7_gripper_errors.log 正式录制: ```bash -uv run uf-lerobot-record \ +uv run record \ --config_path config/gello/xarm7_gello_record_config.yaml ``` diff --git a/pyproject.toml b/pyproject.toml index 0ba0fc3..c2cac1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,8 +35,10 @@ dependencies = [ [project.scripts] uf-robot-teleop = "lerobot_robot_ufactory.scripts.uf_robot_teleop:main" uf-lerobot-record = "lerobot_robot_ufactory.scripts.uf_lerobot_record:main" +record = "lerobot_robot_ufactory.scripts.uf_lerobot_record:main" uf-lerobot-eval = "lerobot_robot_ufactory.scripts.uf_lerobot_eval:main" uf-lerobot-replay = "lerobot_robot_ufactory.scripts.uf_lerobot_replay:main" +replay = "lerobot_robot_ufactory.scripts.uf_lerobot_replay:main" uf-vive-calibrate = "lerobot_robot_ufactory.scripts.vive_calibrate:main" uf-camera-view = "lerobot_robot_ufactory.scripts.uf_camera_view:main" uf-realsense-view = "lerobot_robot_ufactory.scripts.uf_realsense_view:main" diff --git a/tests/test_manual_mode.py b/tests/test_manual_mode.py index 4f9aea6..b6e6693 100644 --- a/tests/test_manual_mode.py +++ b/tests/test_manual_mode.py @@ -394,7 +394,7 @@ def test_manual_record_config_has_no_teleop(monkeypatch): monkeypatch.setattr( sys, "argv", - ["uf-lerobot-record", "--config_path", str(config_path)], + ["record", "--config_path", str(config_path)], ) config = get_cfg()