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
|
### Base Install
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/xArm-Developer/ufactory_lerobot.git
|
git clone https://github.com/xArm-Developer/lerobot_robot_ufactory.git
|
||||||
cd ufactory_lerobot
|
cd lerobot_robot_ufactory
|
||||||
|
|
||||||
# Create conda environment
|
# Create conda environment
|
||||||
conda create -n uf_lerobot python=3.10 -y
|
conda create -n uf_lerobot python=3.10 -y
|
||||||
@ -151,11 +151,11 @@ Test teleop-to-robot control loop without recording.
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Generic usage
|
# Generic usage
|
||||||
uf-robot-teleop -c path/to/config.yaml
|
uf-robot-teleop --config_path 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 --fps 60 # specify frequency
|
||||||
|
|
||||||
# Example: xArm6 + UMI teleop
|
# 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
|
### 2. Data Collection
|
||||||
@ -164,11 +164,11 @@ Record datasets via teleop.
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Generic usage
|
# Generic usage
|
||||||
uf-lerobot-record -c path/to/record_config.yaml
|
uf-lerobot-record --config_path path/to/record_config.yaml
|
||||||
uf-lerobot-record -c path/to/config.yaml --resume # resume recording
|
uf-lerobot-record --config_path path/to/config.yaml --resume true # resume recording
|
||||||
|
|
||||||
# Example: xArm6 + UMI data collection
|
# 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
|
### 3. Policy Training
|
||||||
@ -208,10 +208,10 @@ Run inference with a trained policy.
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Generic usage
|
# 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
|
# 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
|
## Tools
|
||||||
@ -274,17 +274,18 @@ lerobot-edit-dataset \
|
|||||||
## Project Structure
|
## Project Structure
|
||||||
|
|
||||||
```
|
```
|
||||||
ufactory_lerobot/
|
lerobot_robot_ufactory/
|
||||||
├── src/
|
├── src/
|
||||||
│ ├── ufactory_lerobot/
|
│ ├── lerobot_robot_ufactory/ # LeRobot plugin package
|
||||||
│ │ ├── robots/ # Robot control
|
│ │ ├── robots/ # Robot control
|
||||||
│ │ │ ├── uf_robot/ # xArm physical robot
|
│ │ │ ├── uf_robot/ # xArm physical robot
|
||||||
│ │ │ ├── uf_mock_robot/ # Mock robot simulator
|
│ │ │ ├── uf_mock_robot/ # Mock robot simulator
|
||||||
│ │ ├── teleoperators/ # Teleop drivers
|
│ │ ├── teleoperators/ # Teleop drivers
|
||||||
|
│ │ │ ├── base_teleop/ # Shared base class
|
||||||
│ │ │ ├── gello_teleop/ # GELLO (Dynamixel leader)
|
│ │ │ ├── gello_teleop/ # GELLO (Dynamixel leader)
|
||||||
│ │ │ ├── pika_teleop/ # Pika Sense (handheld + Vive)
|
│ │ │ ├── pika_teleop/ # Pika Sense (handheld + Vive)
|
||||||
│ │ │ ├── umi_teleop/ # UMI (dual-arm support)
|
│ │ │ ├── umi_teleop/ # UMI (dual-arm support)
|
||||||
│ │ │ ├── space_mouse/ # SpaceMouse (3D mouse)
|
│ │ │ └── space_mouse/ # SpaceMouse (3D mouse)
|
||||||
│ │ ├── cameras/ # Camera modules
|
│ │ ├── cameras/ # Camera modules
|
||||||
│ │ │ └── umi_camera/ # UMI camera
|
│ │ │ └── umi_camera/ # UMI camera
|
||||||
│ │ ├── devices/ # External device drivers
|
│ │ ├── devices/ # External device drivers
|
||||||
@ -296,6 +297,7 @@ ufactory_lerobot/
|
|||||||
│ │ │ ├── uf_lerobot_eval.py # Policy evaluation
|
│ │ │ ├── uf_lerobot_eval.py # Policy evaluation
|
||||||
│ │ │ ├── uf_camera_view.py # Camera viewer tool
|
│ │ │ ├── uf_camera_view.py # Camera viewer tool
|
||||||
│ │ │ └── vive_calibrate.py # Vive Tracker calibration
|
│ │ │ └── vive_calibrate.py # Vive Tracker calibration
|
||||||
|
│ │ ├── context.py # Teleop context registry
|
||||||
│ │ └── utils/ # Utilities
|
│ │ └── utils/ # Utilities
|
||||||
├── config/ # YAML config files
|
├── config/ # YAML config files
|
||||||
│ ├── gello/
|
│ ├── gello/
|
||||||
@ -303,7 +305,6 @@ ufactory_lerobot/
|
|||||||
│ ├── umi/
|
│ ├── umi/
|
||||||
│ └── spacemouse/
|
│ └── spacemouse/
|
||||||
├── rules/ # udev device rules
|
├── rules/ # udev device rules
|
||||||
├── xvsdk/ # XVSDK system dependency
|
|
||||||
├── pyproject.toml
|
├── pyproject.toml
|
||||||
└── README.md
|
└── README.md
|
||||||
```
|
```
|
||||||
|
|||||||
33
README_ZH.md
33
README_ZH.md
@ -52,8 +52,8 @@ UFACTORY(深圳市众为创造科技有限公司) 机械臂与 LeRobot 框架集
|
|||||||
### 基础项目安装
|
### 基础项目安装
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/xArm-Developer/ufactory_lerobot.git
|
git clone https://github.com/xArm-Developer/lerobot_robot_ufactory.git
|
||||||
cd ufactory_lerobot
|
cd lerobot_robot_ufactory
|
||||||
|
|
||||||
# 创建 conda 环境
|
# 创建 conda 环境
|
||||||
conda create -n uf_lerobot python=3.10 -y
|
conda create -n uf_lerobot python=3.10 -y
|
||||||
@ -150,11 +150,11 @@ sudo udevadm control --reload-rules && sudo udevadm trigger
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 通用格式
|
# 通用格式
|
||||||
uf-robot-teleop -c path/to/config.yaml
|
uf-robot-teleop --config_path path/to/config.yaml
|
||||||
uf-robot-teleop -c path/to/config.yaml -f 60 # 指定频率
|
uf-robot-teleop --config_path path/to/config.yaml --fps 60 # 指定频率
|
||||||
|
|
||||||
# 示例:xArm6 + UMI 遥操作
|
# 示例: xArm6 + UMI 遥操作
|
||||||
uf-robot-teleop -c config/umi/xarm6_umi_record_config.yaml
|
uf-robot-teleop --config_path config/umi/xarm6_umi_record_config.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. 数据采集
|
### 2. 数据采集
|
||||||
@ -163,11 +163,11 @@ uf-robot-teleop -c config/umi/xarm6_umi_record_config.yaml
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 通用格式
|
# 通用格式
|
||||||
uf-lerobot-record -c path/to/record_config.yaml
|
uf-lerobot-record --config_path path/to/record_config.yaml
|
||||||
uf-lerobot-record -c path/to/config.yaml --resume # 续录
|
uf-lerobot-record --config_path path/to/config.yaml --resume true # 续录
|
||||||
|
|
||||||
# 示例:xArm6 + UMI 数据采集
|
# 示例: xArm6 + UMI 数据采集
|
||||||
uf-lerobot-record -c config/umi/xarm6_umi_record_config.yaml
|
uf-lerobot-record --config_path config/umi/xarm6_umi_record_config.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3. Lerobot训练
|
### 3. Lerobot训练
|
||||||
@ -204,10 +204,10 @@ lerobot-train \
|
|||||||
|
|
||||||
```bash
|
```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 策略进行推理
|
# 示例:使用训练好的 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/
|
├── src/
|
||||||
│ ├── ufactory_lerobot/
|
│ ├── lerobot_robot_ufactory/ # LeRobot 插件包
|
||||||
│ │ ├── robots/ # 机器人控制
|
│ │ ├── robots/ # 机器人控制
|
||||||
│ │ │ ├── uf_robot/ # xArm 实体机器人
|
│ │ │ ├── uf_robot/ # xArm 实体机器人
|
||||||
│ │ │ ├── uf_mock_robot/ # 仿真 Mock 机器人
|
│ │ │ ├── uf_mock_robot/ # 仿真 Mock 机器人
|
||||||
│ │ ├── teleoperators/ # 遥操作器
|
│ │ ├── teleoperators/ # 遥操作器
|
||||||
|
│ │ │ ├── base_teleop/ # 共享基类
|
||||||
│ │ │ ├── gello_teleop/ # GELLO (Dynamixel 示教臂)
|
│ │ │ ├── gello_teleop/ # GELLO (Dynamixel 示教臂)
|
||||||
│ │ │ ├── pika_teleop/ # Pika Sense (手持示教器 + Vive)
|
│ │ │ ├── pika_teleop/ # Pika Sense (手持示教器 + Vive)
|
||||||
│ │ │ ├── umi_teleop/ # UMI (含双机械臂)
|
│ │ │ ├── umi_teleop/ # UMI (含双机械臂)
|
||||||
│ │ │ ├── space_mouse/ # SpaceMouse (3D 鼠标)
|
│ │ │ └── space_mouse/ # SpaceMouse (3D 鼠标)
|
||||||
│ │ ├── cameras/ # 摄像头模块
|
│ │ ├── cameras/ # 摄像头模块
|
||||||
│ │ │ └── umi_camera/ # UMI 相机
|
│ │ │ └── umi_camera/ # UMI 相机
|
||||||
│ │ ├── devices/ # 外部设备驱动
|
│ │ ├── devices/ # 外部设备驱动
|
||||||
@ -292,6 +293,7 @@ ufactory_lerobot/
|
|||||||
│ │ │ ├── uf_lerobot_eval.py # 策略评估
|
│ │ │ ├── uf_lerobot_eval.py # 策略评估
|
||||||
│ │ │ ├── uf_camera_view.py # 摄像头查看工具
|
│ │ │ ├── uf_camera_view.py # 摄像头查看工具
|
||||||
│ │ │ └── vive_calibrate.py # Vive Tracker 校准
|
│ │ │ └── vive_calibrate.py # Vive Tracker 校准
|
||||||
|
│ │ ├── context.py # Teleop 上下文注册
|
||||||
│ │ └── utils/ # 工具函数
|
│ │ └── utils/ # 工具函数
|
||||||
├── config/ # YAML 配置文件
|
├── config/ # YAML 配置文件
|
||||||
│ ├── gello/
|
│ ├── gello/
|
||||||
@ -299,7 +301,6 @@ ufactory_lerobot/
|
|||||||
│ ├── umi/
|
│ ├── umi/
|
||||||
│ └── spacemouse/
|
│ └── spacemouse/
|
||||||
├── rules/ # udev 设备规则
|
├── rules/ # udev 设备规则
|
||||||
├── xvsdk/ # XVSDK 系统依赖
|
|
||||||
├── pyproject.toml
|
├── pyproject.toml
|
||||||
└── README.md
|
└── 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