CmvrControlStation/docs/CONTROLLER_TCP_OFFSET.md

32 lines
1.6 KiB
Markdown
Raw Permalink 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.

# 控制器活动 TCP 偏移读取
TCP 标定页面的“从控制器读取”使用当前连接和机械臂 ID,通过已有
`cmvr.api.ArmService/ExecuteJsonCommand` 发送:
```json
{"command":"get_active_tcp_offset"}
```
服务端目前由 AuboArm 驱动调用 `getRobotConfig()->getTcpOffset()`。
其他未适配驱动返回不支持,不把失败转换成零偏移。
响应同时包含 `success`、`device_id`、`offset`(六个数)、
`transform: T_flange_tcp`、`units: m_rad` 和
`rotation_convention: RzRyRx`。这是相对法兰的活动工具偏移,不是机器人基座下的实时 TCP 位姿。
Qt 校验设备、单位、姿态约定和有限数值后,将平移转换为 mm,角度转换为度。
读取会清空本轮采样,成功后确认偏移;失败保持未确认。
切换连接或机械臂后,过期响应不会被应用。
这是按按钮实时读取,不是后台持续轮询;在示教器更换活动工具后需重新读取。
## 2026-10-10 验证
- TCP 页面测试 17 项通过。
- loopback 集成测试通过,覆盖错误单位、设备不匹配、无效值、合法零偏移及 UI 回填。
- Qt 调试程序编译通过,输出 `bin/debug/CmvrControlStation_touch_preview.exe`。
- 服务器驱动编译、链接通过,已按用户授权重启服务。
- `192.168.0.28:50052` 的 `aubo_arm` 实际读取成功,返回六项零偏移。
- 部署时原驱动备份:服务器
`/home/cmvr/Projects/cmvr-es/output/lib/libaubo_arm.so.before-tcp-20261010-162143`。
- 服务以原参数和环境后台启动,日志为服务器 `/tmp/cmvr-tcp-service.log`。
此次未更改设备配置或开机启动设置。