From fece62dba18ed1d18794a5107d4ab9f46e36b7d5 Mon Sep 17 00:00:00 2001 From: Vinman Date: Tue, 30 Jun 2026 15:24:42 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=20README=20=E2=80=94?= =?UTF-8?q?=20=E5=8C=85=E5=90=8D=E9=87=8D=E5=91=BD=E5=90=8D=E3=80=81CLI=20?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=BF=AE=E6=AD=A3=E3=80=81=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 29 ++++---- README_ZH.md | 33 +++++----- .../scripts/uf_download_resources.py | 66 ------------------- 3 files changed, 32 insertions(+), 96 deletions(-) delete mode 100644 src/lerobot_robot_ufactory/scripts/uf_download_resources.py diff --git a/README.md b/README.md index 99cd6e6..6f8e9ee 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,8 @@ UFACTORY robot arm integration with the LeRobot framework for robot learning, da ### Base Install ```bash -git clone https://github.com/xArm-Developer/ufactory_lerobot.git -cd ufactory_lerobot +git clone https://github.com/xArm-Developer/lerobot_robot_ufactory.git +cd lerobot_robot_ufactory # Create conda environment conda create -n uf_lerobot python=3.10 -y @@ -151,11 +151,11 @@ Test teleop-to-robot control loop without recording. ```bash # Generic usage -uf-robot-teleop -c path/to/config.yaml -uf-robot-teleop -c path/to/config.yaml -f 60 # specify frequency +uf-robot-teleop --config_path path/to/config.yaml +uf-robot-teleop --config_path path/to/config.yaml --fps 60 # specify frequency # Example: xArm6 + UMI teleop -uf-robot-teleop -c config/umi/xarm6_umi_record_config.yaml +uf-robot-teleop --config_path config/umi/xarm6_umi_record_config.yaml ``` ### 2. Data Collection @@ -164,11 +164,11 @@ Record datasets via teleop. ```bash # Generic usage -uf-lerobot-record -c path/to/record_config.yaml -uf-lerobot-record -c path/to/config.yaml --resume # resume recording +uf-lerobot-record --config_path path/to/record_config.yaml +uf-lerobot-record --config_path path/to/config.yaml --resume true # resume recording # Example: xArm6 + UMI data collection -uf-lerobot-record -c config/umi/xarm6_umi_record_config.yaml +uf-lerobot-record --config_path config/umi/xarm6_umi_record_config.yaml ``` ### 3. Policy Training @@ -208,10 +208,10 @@ Run inference with a trained policy. ```bash # Generic usage -uf-lerobot-eval -c path/to/config.yaml --policy.path your_train_path +uf-lerobot-eval --config_path path/to/config.yaml --policy.path your_train_path # Example: run inference with trained ACT policy -uf-lerobot-eval -c config/umi/xarm6_umi_record_config.yaml --policy.path ../../../../lerobot_datas/train/xarm6_umi_datas/checkpoints/last/pretrained_model/ +uf-lerobot-eval --config_path config/umi/xarm6_umi_record_config.yaml --policy.path ../../../../lerobot_datas/train/xarm6_umi_datas/checkpoints/last/pretrained_model/ ``` ## Tools @@ -274,17 +274,18 @@ lerobot-edit-dataset \ ## Project Structure ``` -ufactory_lerobot/ +lerobot_robot_ufactory/ ├── src/ -│ ├── ufactory_lerobot/ +│ ├── lerobot_robot_ufactory/ # LeRobot plugin package │ │ ├── robots/ # Robot control │ │ │ ├── uf_robot/ # xArm physical robot │ │ │ ├── uf_mock_robot/ # Mock robot simulator │ │ ├── teleoperators/ # Teleop drivers +│ │ │ ├── base_teleop/ # Shared base class │ │ │ ├── gello_teleop/ # GELLO (Dynamixel leader) │ │ │ ├── pika_teleop/ # Pika Sense (handheld + Vive) │ │ │ ├── umi_teleop/ # UMI (dual-arm support) -│ │ │ ├── space_mouse/ # SpaceMouse (3D mouse) +│ │ │ └── space_mouse/ # SpaceMouse (3D mouse) │ │ ├── cameras/ # Camera modules │ │ │ └── umi_camera/ # UMI camera │ │ ├── devices/ # External device drivers @@ -296,6 +297,7 @@ ufactory_lerobot/ │ │ │ ├── uf_lerobot_eval.py # Policy evaluation │ │ │ ├── uf_camera_view.py # Camera viewer tool │ │ │ └── vive_calibrate.py # Vive Tracker calibration +│ │ ├── context.py # Teleop context registry │ │ └── utils/ # Utilities ├── config/ # YAML config files │ ├── gello/ @@ -303,7 +305,6 @@ ufactory_lerobot/ │ ├── umi/ │ └── spacemouse/ ├── rules/ # udev device rules -├── xvsdk/ # XVSDK system dependency ├── pyproject.toml └── README.md ``` diff --git a/README_ZH.md b/README_ZH.md index 16a4484..b8f26f5 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -52,8 +52,8 @@ UFACTORY(深圳市众为创造科技有限公司) 机械臂与 LeRobot 框架集 ### 基础项目安装 ```bash -git clone https://github.com/xArm-Developer/ufactory_lerobot.git -cd ufactory_lerobot +git clone https://github.com/xArm-Developer/lerobot_robot_ufactory.git +cd lerobot_robot_ufactory # 创建 conda 环境 conda create -n uf_lerobot python=3.10 -y @@ -150,11 +150,11 @@ sudo udevadm control --reload-rules && sudo udevadm trigger ```bash # 通用格式 -uf-robot-teleop -c path/to/config.yaml -uf-robot-teleop -c path/to/config.yaml -f 60 # 指定频率 +uf-robot-teleop --config_path path/to/config.yaml +uf-robot-teleop --config_path path/to/config.yaml --fps 60 # 指定频率 -# 示例:xArm6 + UMI 遥操作 -uf-robot-teleop -c config/umi/xarm6_umi_record_config.yaml +# 示例: xArm6 + UMI 遥操作 +uf-robot-teleop --config_path config/umi/xarm6_umi_record_config.yaml ``` ### 2. 数据采集 @@ -163,11 +163,11 @@ uf-robot-teleop -c config/umi/xarm6_umi_record_config.yaml ```bash # 通用格式 -uf-lerobot-record -c path/to/record_config.yaml -uf-lerobot-record -c path/to/config.yaml --resume # 续录 +uf-lerobot-record --config_path path/to/record_config.yaml +uf-lerobot-record --config_path path/to/config.yaml --resume true # 续录 -# 示例:xArm6 + UMI 数据采集 -uf-lerobot-record -c config/umi/xarm6_umi_record_config.yaml +# 示例: xArm6 + UMI 数据采集 +uf-lerobot-record --config_path config/umi/xarm6_umi_record_config.yaml ``` ### 3. Lerobot训练 @@ -204,10 +204,10 @@ lerobot-train \ ```bash # 通用格式 -uf-lerobot-eval -c path/to/config.yaml --policy.path your_train_path +uf-lerobot-eval --config_path path/to/config.yaml --policy.path your_train_path # 示例:使用训练好的 ACT 策略进行推理 -uf-lerobot-eval -c config/umi/xarm6_umi_record_config.yaml --policy.path ../../../../lerobot_datas/train/xarm6_umi_datas/checkpoints/last/pretrained_model/ +uf-lerobot-eval --config_path config/umi/xarm6_umi_record_config.yaml --policy.path ../../../../lerobot_datas/train/xarm6_umi_datas/checkpoints/last/pretrained_model/ ``` ## 工具集 @@ -270,17 +270,18 @@ lerobot-edit-dataset \ ## 项目结构 ``` -ufactory_lerobot/ +lerobot_robot_ufactory/ ├── src/ -│ ├── ufactory_lerobot/ +│ ├── lerobot_robot_ufactory/ # LeRobot 插件包 │ │ ├── robots/ # 机器人控制 │ │ │ ├── uf_robot/ # xArm 实体机器人 │ │ │ ├── uf_mock_robot/ # 仿真 Mock 机器人 │ │ ├── teleoperators/ # 遥操作器 +│ │ │ ├── base_teleop/ # 共享基类 │ │ │ ├── gello_teleop/ # GELLO (Dynamixel 示教臂) │ │ │ ├── pika_teleop/ # Pika Sense (手持示教器 + Vive) │ │ │ ├── umi_teleop/ # UMI (含双机械臂) -│ │ │ ├── space_mouse/ # SpaceMouse (3D 鼠标) +│ │ │ └── space_mouse/ # SpaceMouse (3D 鼠标) │ │ ├── cameras/ # 摄像头模块 │ │ │ └── umi_camera/ # UMI 相机 │ │ ├── devices/ # 外部设备驱动 @@ -292,6 +293,7 @@ ufactory_lerobot/ │ │ │ ├── uf_lerobot_eval.py # 策略评估 │ │ │ ├── uf_camera_view.py # 摄像头查看工具 │ │ │ └── vive_calibrate.py # Vive Tracker 校准 +│ │ ├── context.py # Teleop 上下文注册 │ │ └── utils/ # 工具函数 ├── config/ # YAML 配置文件 │ ├── gello/ @@ -299,7 +301,6 @@ ufactory_lerobot/ │ ├── umi/ │ └── spacemouse/ ├── rules/ # udev 设备规则 -├── xvsdk/ # XVSDK 系统依赖 ├── pyproject.toml └── README.md ``` diff --git a/src/lerobot_robot_ufactory/scripts/uf_download_resources.py b/src/lerobot_robot_ufactory/scripts/uf_download_resources.py deleted file mode 100644 index de44ddd..0000000 --- a/src/lerobot_robot_ufactory/scripts/uf_download_resources.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python -"""Download XVSDK binaries and UMI shared libraries after install.""" -import os -import sys -import urllib.request -import subprocess -import site - -RESOURCES = "https://raw.githubusercontent.com/xArm-Developer/ufactory_resources/main/fastumi" - -FILES = [ - # (url_path, subdir) - ("libxvlib.so", ""), - ("opencv/libopencv_core.so.4.2", ""), - ("opencv/libopencv_imgproc.so.4.2", ""), -] - -DEB_FILE = "sdk/XVSDK_focal_amd64.deb" - - -def get_pkg_dir(): - """Find the installed ufactory_lerobot package directory.""" - for sp in site.getsitepackages(): - path = os.path.join(sp, "ufactory_lerobot", "devices", "umi", "xvlib") - if os.path.isdir(path): - return path - # fallback: try user site - usp = site.getusersitepackages() - if usp: - return os.path.join(usp, "ufactory_lerobot", "devices", "umi", "xvlib") - sys.exit("Error: cannot find installed ufactory_lerobot package.") - - -def download(url, dest): - print(f" -> {dest}") - os.makedirs(os.path.dirname(dest), exist_ok=True) - urllib.request.urlretrieve(url, dest) - - -def main(): - pkg_dir = get_pkg_dir() - print(f"Installing to: {pkg_dir}\n") - - for name, subdir in FILES: - url = f"{RESOURCES}/{name}" - dest = os.path.join(pkg_dir, os.path.basename(name)) - print(f"Downloading {name} ...") - download(url, dest) - - # .deb: download to /tmp and install - deb_url = f"{RESOURCES}/{DEB_FILE}" - deb_path = "/tmp/XVSDK_focal_amd64.deb" - print(f"\nDownloading {DEB_FILE} ...") - download(deb_url, deb_path) - - print("\nInstalling XVSDK ...") - ret = subprocess.run(["sudo", "dpkg", "-i", deb_path]).returncode - if ret != 0: - subprocess.run(["sudo", "apt", "install", "-y", "--fix-broken"]) - os.unlink(deb_path) - - print("\nDone.") - - -if __name__ == "__main__": - main() \ No newline at end of file