Files
acRealman_xr/README.md
2026-05-20 14:17:43 +08:00

156 lines
4.4 KiB
Markdown
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# XR-RM75 双臂阶段一遥操作 ROS2 工作空间
这个 `src/` 目录面向 **Ubuntu 22.04 + ROS2 Humble**,用于先跑通阶段一闭环:
```text
PICO 4 Ultra 双手柄 UDP 位姿/按键
-> /xr/left_controller 与 /xr/right_controller
-> 左右 RM75 相对位移速度遥操
-> 右手 trigger 输出 OmniPicker 归一化力控指令
-> PC 端查看 D405/D405/D435 视频,后续再接记录节点
```
当前配置参考了最新 `acDual-arm-YikaiFuTest` 中的双臂 acRealman 参数,但本项目仍然采用 PICO 手柄相对位移遥操,不直接搬用戴盟的绝对 `PoseStamped` retarget 链路。
## 当前范围
- 已纳入PICO 双手柄输入、左右 RM75 相对位移控制、右手 OmniPicker trigger 指令出口。
- 暂不纳入AUBO 移动底盘、升降柱、剪刀手、XR 视频流、自动采摘算法。
## 关键配置来源
来自 `acDual-arm-YikaiFuTest/realman_pkg/core/arg_cfg.py`
- 左臂 IP`192.168.192.18`
- 右臂 IP`192.168.192.19`
- 左右臂 TCP 端口:`8080`
- 左右臂工作空间:`x[-0.50, 0.50] y[-0.60, -0.20] z[0.10, 0.50]`
- 左右臂工作空间和 IP 沿用最新 acDual-arm 配置。
`dual_arm_rm75.yaml` 里的左右 `xr_to_robot_matrix` 依据论文中的 OpenXR/PICO 手柄坐标和现场双臂 base 坐标图设置:
- PICO/OpenXR`+X` 向右,`+Y` 向上,`+Z` 向后。
- 左臂:`+X` 向下,`+Z` 向右,前方工作区对应 `-Y`
- 右臂:`+X` 向上,`+Z` 向左,前方工作区对应 `-Y`
真机上仍需低速确认方向。
## 构建
在包含 `src/` 的工作空间根目录执行:
```bash
source /opt/ros/humble/setup.bash
rosdep update
rosdep install --from-paths src -y --ignore-src
colcon build --symlink-install
source install/setup.bash
```
## 优先验证:双臂 mock
mock 模式不会连接真实 RM75适合先验证 UDP 输入、左右手柄路由、相对位移控制和 trigger 夹爪指令。
终端 1
```bash
source /opt/ros/humble/setup.bash
source install/setup.bash
ros2 launch xr_rm_bringup dual_arm_mock.launch.py
```
终端 2
```bash
source /opt/ros/humble/setup.bash
source install/setup.bash
ros2 run xr_rm_input sample_udp_sender --hand both --host 127.0.0.1 --port 15000
```
检查话题:
```bash
ros2 topic echo /xr/left_controller
ros2 topic echo /xr/right_controller
ros2 topic echo /omnipicker/right/force_ratio
```
## 连接双 RM75
先安装睿尔曼 Python API2并确认两台控制器网络可达。
```bash
source /opt/ros/humble/setup.bash
source install/setup.bash
ros2 launch xr_rm_bringup dual_arm_realman.launch.py \
left_robot_ip:=192.168.192.18 \
right_robot_ip:=192.168.192.19
```
单臂入口仍保留,默认按右臂配置:
```bash
ros2 launch xr_rm_bringup single_arm_mock.launch.py
ros2 launch xr_rm_bringup single_arm_realman.launch.py robot_ip:=192.168.192.19
```
## UDP JSON 格式
单个手柄数据:
```json
{
"hand": "right",
"grip": true,
"trigger": 0.2,
"pos": [0.12, 1.05, -0.32],
"quat": [0.0, 0.0, 0.0, 1.0]
}
```
也支持一次发送左右手柄:
```json
{
"controllers": {
"left": {
"grip": true,
"trigger": 0.0,
"pos": [-0.12, 1.05, -0.32],
"quat": [0.0, 0.0, 0.0, 1.0]
},
"right": {
"grip": true,
"trigger": 0.4,
"pos": [0.12, 1.05, -0.32],
"quat": [0.0, 0.0, 0.0, 1.0]
}
}
}
```
`grip` 是机械臂运动使能:按下时锁定当前手柄和 TCP 起点,之后只跟随相对位移;松开、超时或节点退出都会发送零速度。
## OmniPicker 接口
`gripper_trigger_bridge` 会把右手 `trigger` 映射为:
```text
/omnipicker/right/force_ratio std_msgs/Float32
```
默认范围是 `0.0` 开爪、`0.15-0.45` 柔性闭合/保持。实际接 OmniPicker 驱动前,请根据番茄压伤测试收紧 `dual_arm_rm75.yaml` 里的 `max_close_command`
## 真机前方向验证
第一轮保持 `max_linear_speed <= 0.04`,先只上右臂:
1. 按住右手 `grip`,手柄缓慢上移,确认 TCP 方向。
2. 手柄缓慢前推/后拉,确认 TCP 方向。
3. 手柄缓慢左移/右移,确认 TCP 方向。
4. 若任一方向相反,只改 `dual_arm_rm75.yaml` 中对应臂的 `xr_to_robot_matrix` 符号。
5. 右臂确认后再开放左臂。
6. 最后接 OmniPicker并从低力控上限开始抓取番茄。
当前双臂是两个独立控制节点,没有跨臂碰撞模型;首次测试请让两臂工作区物理分离。