Touch 触觉数据
按已识别布局读取阵列、指尖力与力矩,或订阅连续触觉快照。
UF1~UF3、UT1、UT2,以及主链路阵列已确认的 UV1~UV4。UV5、UV6 的独立视触觉数据由专用 SDK 提供。
以下片段在已连接的 hand 上执行。Python 位于 async 函数内;C++ 需包含 revo3/revo3.hpp、iostream、vector、chrono 和 stdexcept,并在应用边界处理 SdkError。
layout = hand.touch.layoutif layout is None: raise RuntimeError("Touch layout is unavailable")frame = await hand.touch.snapshot()for module in frame.modules: print(module.module_id, module.sample_state)const auto layout = hand.touch().layout();const auto frame = hand.touch().snapshot();for (const auto& module : frame.modules) { std::cout << module.module_id << " " << static_cast<int>(module.sample_state) << "\n";}参数与返回值
Section titled “参数与返回值”| 操作 | 参数 | 返回值 |
|---|---|---|
| Touch.snapshot() | 可选 module_indices;按请求顺序读取 | TouchFrame |
| Touch.module_snapshot(i) | 公开模块 ID | TouchModuleData |
按操作查阅完整签名、默认值、单位与 Python / C++ 差异:
按 module_id 查找模块,先检查 sample_state,再读取可选字段。不支持的操作返回 UnsupportedCapability;不要用零值替代读取失败,也不要猜测未知布局。