Aloha真机部署#
概述#
本文档描述基于 AgileX Aloha 双臂平台部署 FluxVLA 模型进行自主操作的完整流程。
上电#
打开机器电源,对四个机械臂进行上电
检查四个机械臂是否都亮绿灯,正常上电
2. 软件环境准备#
2.1 创建 Conda 环境#
conda create -n aloha_sdk3.0 python=3.8.19
conda activate aloha_sdk3.0
2.2 安装 Piper SDK#
git clone https://github.com/agilexrobotics/piper_sdk.git
cd piper_sdk
pip3 install .
3. 启动机械臂#
启动机械臂使能与控制节点(mode:=1 为从动模式,auto_enable:=true 自动上使能):
conda activate aloha_sdk3.0
roslaunch piper start_ms_piper.launch mode:=1 auto_enable:=true
4. 启动相机#
启动三路深度相机:
roslaunch astra_camera nmulti_camera.launch
启动完成后,通过 rostopic list 确认以下 Topic 正常发布:
相机 |
Color Topic |
Depth Topic |
点云 Topic |
|---|---|---|---|
前方 (f) |
|
|
|
手部 (h) |
|
|
|
左侧 (l) |
|
|
|
右侧 (r) |
|
|
|
机械臂关节状态 Topic:
Topic |
说明 |
|---|---|
|
左主臂关节状态 |
|
右主臂关节状态 |
|
左从臂关节状态 |
|
右从臂关节状态 |
|
左从臂末端位姿 |
|
右从臂末端位姿 |
|
左臂轨迹指令 |
|
右臂轨迹指令 |
|
左臂模型输出轨迹 |
|
右臂模型输出轨迹 |
5. 运行 FluxVLA 模型推理#
在 IDE 中通过”运行与调试”启动,或直接命令行运行:
WANDB_MODE=disabled HF_ENDPOINT=https://hf-mirror.com \
python scripts/inference_real_robot.py \
--config configs/gr00t/gr00t_eagle_3b_aloha_fold_towel_3cam_4090_full_train.py \
--ckpt-path ./work_dirs/work_dirs/419acaf40_gr00t_eagle_3b_aloha_fold_towel_3cam_4090_full_train_bs256/checkpoints/step-037356-epoch-06-loss=0.0617.pt
对应的 VSCode launch.json 配置:
{
"name": "Inference gr00t eagle",
"type": "debugpy",
"request": "launch",
"program": "scripts/inference_real_robot.py",
"console": "integratedTerminal",
"args": [
"--config", "configs/gr00t/gr00t_eagle_3b_aloha_fold_towel_3cam_4090_full_train.py",
"--ckpt-path", "./work_dirs/work_dirs/419acaf40_gr00t_eagle_3b_aloha_fold_towel_3cam_4090_full_train_bs256/checkpoints/step-037356-epoch-06-loss=0.0617.pt"
],
"env": {
"WANDB_MODE": "disabled",
"HF_ENDPOINT": "https://hf-mirror.com"
}
}
6. 机械臂复位#
任务结束或需要归零时,发送复位指令将双臂回到零位(末端夹爪保持微张 0.1):
左臂复位:
rostopic pub /master/joint_left sensor_msgs/JointState "header:
seq: 0
stamp: {secs: 0, nsecs: 0}
frame_id: ''
name: ['']
position: [0,0,0,0,0,0,0.1]
velocity: [0]
effort: [0]"
右臂复位:
rostopic pub /master/joint_right sensor_msgs/JointState "header:
seq: 0
stamp: {secs: 0, nsecs: 0}
frame_id: ''
name: ['']
position: [0,0,0,0,0,0,0.1]
velocity: [0]
effort: [0]"
position中的 7 个值对应 6 个关节角度 + 1 个夹爪开合量,全部置零表示回到初始位姿,0.1使夹爪保持微张状态。