docs: 更新 README — 包名重命名、CLI 参数修正、项目结构同步
This commit is contained in:
parent
bdc8ef05ab
commit
fece62dba1
29
README.md
29
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
|
||||
```
|
||||
|
||||
33
README_ZH.md
33
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
|
||||
```
|
||||
|
||||
@ -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()
|
||||
Loading…
Reference in New Issue
Block a user