YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Robotwin pi0.5 + ARX X5
公开代码仓库:JackieMM/robotwin-pi05-arx
跨服务器训练专用仓库:JackieMM/robotwin-pi05-arx-training
本次训练数据:JackieMM/LQ-20260915-1-first50-2cam
全量 71 条数据:JackieMM/LQ-20260915-1-all71-2cam
这个仓库用于跑通 Robotwin/pi0.5 在 ARX X5 真机上的完整链路:
4090 ROS/相机采集 -> 官方 RoboTwin HDF5 -> LeRobot -> norm stats -> 5090 LoRA 训练 -> 离线回放 -> 只读真机推理 -> 安全单步/短 chunk。
仓库不保存模型权重、真实数据、临时 SSH key 或机器人密码。服务器路径、IP、GPU 和 checkpoint 都通过环境文件配置。
先看安全边界
- DROID base checkpoint 只能做软件 smoke test,不能直接驱动 ARX。
- 正式采集使用
record_robotwin_arx.py和topic_manifest.yaml,不要使用旧的自定义录制格式。 - 真机动作默认关闭。先执行
validate、离线推理和run_pi05_live.py --observe-only。 - 录制时按键盒
3/4/1分别表示开始/保存/丢弃;2是 GO_HOME,录制和推理期间禁止按。 - 只有现场重新测量并填写夹爪
closed/open标定后,manifest 才允许采集。
快速开始
cp config/arx.env.example config/arx.env
$EDITOR config/arx.env
source config/arx.env
# 本地静态检查(不连接机器人)
./scripts/arx_pi05.sh doctor
# 4090 容器内只读 ROS 检查
./scripts/arx_pi05.sh validate-ros
# 交互式续采:参数是数据集最终总条数,不覆盖已有 episode
./scripts/arx_pi05.sh collect 50
# HDF5 -> LeRobot(输出目录必须不存在)
./scripts/arx_pi05.sh convert
./scripts/arx_pi05.sh stats
# 在当前主机做训练 smoke;正式 5090 训练用参数化编排脚本
./scripts/arx_pi05.sh train --steps 2
# ops/stage_and_launch_bread_5090.sh
# 只读离线推理
./scripts/arx_pi05.sh offline
# 真机前最后一道门:只采集 observations 和 actions,不下发动作
./scripts/arx_pi05.sh observe
如果 4090 尚未安装锁定版本的官方工作区,先在目标机运行:
cd /home/engram/arx_pi05_stack/direct_control
bash install_robotwin_official.sh /home/engram/ydming/robotwin_arx_official
然后把生成的 manifests/topic_manifest.example.yaml 复制成
topic_manifest.yaml,按现场 ros2 topic type 结果填写 topic/字段和每个
夹爪的 closed/open 数值,再运行 validate-ros。示例中的标定数字不能
直接用于机器人。
完整操作顺序、频率约定和失败恢复见:
server/arx_direct_control/ARX_ROBOTWIN_STANDARD_PIPELINE.mdserver/arx_direct_control/ARX_ROBOTWIN_COLLECTION_GUIDE.mdserver/arx_direct_control/ROBOTWIN_OFFICIAL_ARX_PLAN.mdserver/ARX_PI05_SERVER_SETUP.md
服务器约定
历史上 4090 使用过 10.10.10.172、172.16.32.191 和直连地址
169.254.152.125,这些地址都不是永久事实。先在机器本地运行
hostname -I,再把 ARX_HOST 写入 config/arx.env。机器人侧曾使用
arx@10.10.10.154。ROS domain 固定为 195,容器名为
arx-can-safety,ARX 根目录为 /opt/arx/ARX_X5。
4090 上已验证的 RealSense 配置是三路 RGB-only、640x480,关闭 depth;
USB2 总线下不要恢复 1280x720@30 + depth。OpenPI 使用旧驱动时需要
CUDA 12.1 的 ptxas,配置文件中已给出对应环境变量。
数据与训练 ABI
策略 state/action 固定为 14 维:
[left_joint_0..5, left_gripper, right_joint_0..5, right_gripper]。
相机键固定为 cam_high、cam_left_wrist、cam_right_wrist。训练、离线
评估和部署必须使用同一个 feature order、fps、gripper calibration 和
normalization stats。RoboTwin 官方 ARX 配置是
pi05_base_aloha_full_sim_arx-x5_seed_0;官方 RoboTwin commit 和
XPolicyLab submodule commit 在 install_robotwin_official.sh 中锁定。
当前已知限制
- 必须重新确认两台服务器的网络和 SSH 授权;不要把历史临时 key 放入仓库。
topic_manifest.example.yaml中的 gripper 数值是示例/占位,不能直接用于正式采集。- 旧的 10 条 bread 数据曾出现样本少、夹爪不平衡、50 Hz 训练/20 Hz 执行失配等问题;正式数据建议至少 50 条,并留出 5--10 条验证集。
- 5090 训练机的 GPU 编号不一定是
2。通过TRAIN_GPU配置并先运行nvidia-smi。 - 真机闭环前必须用稳定有线或可靠 5 GHz 网络,并先完成 button-1 watchdog、超时和动作裁剪测试。
公开真机数据 smoke 实验
本项目已实际下载并验证一个公开的 ARX X5 真机 LeRobot 数据集:
heyuan1993/record-test-arxx5_bimanual(Hugging Face)。它包含 1 个 episode、
1734 帧、30 Hz、14 维双臂 state/action 和 4 路 640x480 RGB 视频。数据下载到
data/public_arx/(已被 .gitignore 排除),验证报告写入
reports/public_arx_validation.json。
在没有 ROS、CUDA 或 OpenPI 环境的开发机上,可重现实验的 CPU 部分:
python3 -m pip install -r requirements-tools.txt
./scripts/download_public_arx.sh
python3 scripts/validate_public_arx.py \
data/public_arx/record-test-arxx5_bimanual \
--output reports/public_arx_validation.json
本次实际结果:Parquet 中 observation.state 和 action 均为
(1734, 14) 且全为 finite;四路视频均成功解码为 1734 帧、30 FPS、
640x480;action-state 最大绝对差为约 0.32998,并非空动作数据。
该公开数据的第 7/14 维夹爪仍是约 0--3.5 的原始控制量,不是本仓库
manifest 要求的 [0,1] 归一化值,因此不能未经现场标定直接喂给现有
convert_pi05_hdf5.py 或真机策略。
已执行的 4090 smoke(本次运行)
已通过有线直连登录 4090,并在 GPU1(保留 GPU0 上已有 policy server)执行:
XLA_PYTHON_CLIENT_ALLOCATOR=platform CUDA_VISIBLE_DEVICES=1 \
$OPENPI/.venv/bin/python direct_control/train_pi05_lora.py \
--repo-id ARX-public-real-smoke \
--assets-dir direct_control/pi05_assets \
--base-params /home/engram/ydming/model_weights/openpi/openpi-assets/checkpoints/pi05_droid/params \
--checkpoint-dir /home/engram/ydming/model_weights/arx_pi05/checkpoints/ARX-public-real-smoke-lora-platform \
--steps 1 --batch-size 1 --fsdp-devices 1
结果:step 0 loss=1.8683、grad_norm=11.8023,Orbax checkpoint 已保存到
.../ARX-public-real-smoke-lora-platform/0。XLA_PYTHON_CLIENT_ALLOCATOR=platform
是避免 4090 GPU1 首次尝试 OOM 的关键设置。原始 10-step 尝试还暴露出 OpenPI
会查询 Hugging Face dataset refs;4090 无外网时会失败,因此正式长训前应预热
本地缓存或为训练环境提供出网能力。
随后把 LeRobot 第 0 帧按 HDF5 ABI 打包(scripts/lerobot_frame_to_hdf5.py),
在同一 checkpoint 上完成离线推理:输出 (50, 14) action chunk、全部 finite,
单次推理约 14.1 s。报告见 reports/public_arx_offline_inference_smoke.json,
训练日志见 reports/train_lora_platform.log。
因此当前软件链路已实际跑通:公开数据下载/校验 -> v2.1/v3.0 转换 -> norm stats
-> 4090 LoRA step -> checkpoint 加载 -> 离线 action 推理。仍未执行 ROS 动作发布、
CAN 控制或真实机器人闭环;observe 仍是只读门禁,必须现场完成夹爪标定和安全测试后
才允许进一步操作。
2026-09-16:前 50 条真机数据训练
4090 的 /home/engram/Downloads/1/LQ_20260915_1_LeRobotDatasetV3.0/trainable
包含 71 条 episode、25920 帧。按用户要求取 episode 0..49 共 50 条(18191 帧),
只保留主视角 camera_h 和右臂 camera_r,转换为:
LQ-20260915-1-first50-2cam
OpenPI 的 AlohaInputs 对缺失的左腕相机自动生成黑图并设置 image_mask=false,
所以训练没有把左臂画面复制成第三路。训练命令已在 4090 GPU1 后台启动:
HF_LEROBOT_HOME=/home/engram/ydming/datasets/lerobot \
XLA_PYTHON_CLIENT_ALLOCATOR=platform CUDA_VISIBLE_DEVICES=1 \
PATH=/usr/local/cuda-12.1/bin:$PATH \
XLA_FLAGS="--xla_gpu_cuda_data_dir=/usr/local/cuda-12.1 --xla_gpu_enable_triton_gemm=false" \
python direct_control/train_pi05_lora.py \
--repo-id LQ-20260915-1-first50-2cam \
--assets-dir direct_control/pi05_assets \
--base-params /home/engram/ydming/model_weights/openpi/openpi-assets/checkpoints/pi05_droid/params \
--checkpoint-dir /home/engram/ydming/model_weights/arx_pi05/checkpoints/LQ-20260915-1-first50-2cam-pi05-lora-30000 \
--steps 30000 --batch-size 1 --fsdp-devices 1 \
--two-cameras --video-tolerance-s 0.04
双卡实测通信开销过大,已按用户要求切回单卡 GPU1(此前的 watermelon policy
server 已按授权停止)。当前 PID 为 1792135,日志在服务器:
/home/engram/ydming/datasets/public_arx/train_LQ_first50_2cam_30000.log。
训练参数为 CUDA_VISIBLE_DEVICES=1、batch_size=1、fsdp_devices=1,并设置
save_interval=5000、keep_period=5000。当前约 step 22,单卡实际约 1.2 秒/step,
预计约 10 小时。--video-tolerance-s 0.04 用于容忍导出视频容器 PTS 与 30 Hz
名义时间戳约 6 ms 的偏差,不改变图像内容或采样顺序。