设备配置
设备配置包括每台设备的 configure 将其封装到映射(WebSocket)中发送,或者, /{device_type}/{id}/config/{key} 通过 HTTP 路由进行传输。所有条目均为 **持久型(persistent)**。一旦设置,将一直保持有效,直到被修改为止。
配置可用性矩阵
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
| 键 | WS configure | 超文本传输协定 config/ | 会话范围 | 备注 |
|---|---|---|---|---|
preset | ✓ | ✓ | ✓ | mount与……互斥 |
basis | ✓ | ✓ | ✓ | 会话级别和按设备分类 |
mount | ✓ | ✓ | ✓ | preset与……互斥 |
damping | ✓ | ✓ | ✓ | 标量和/或方向量 |
force_gate | ✓ | ✓ | ✓ | 防震护罩 |
handedness | — | ✓ | — | 设备全局(右/左) |
torque_scaling | — | ✓ | — | 设备全局 |
gravity_compensation | — | ✓ | — | 设备全局 |
home_return | — | ✓ | — | 在固件中尚未启用 |
navigation | ✓ | ✓ | ✓ | 模块 → 请参阅单独页面 |
preset
选择一个已命名的工厂配置,以一次性设置挂载点、基准点和工作区原点。完整列表请参阅“挂载和工作区(预设)”。
{ "inverse3": [{ "device_id": "049D", "configure": { "preset": { "preset": "arm_front_centered" } } }] }
curl -X POST "http://localhost:10001/inverse3/049D/config/preset?session=:0" \
-d '{"preset":"arm_front_centered"}'
basis
设置坐标轴重映射。有关规则和迁移注意事项,请参阅“Basis 排列”。
{ "session": { "configure": { "basis": { "permutation": "XZY" } } } }
还支持按设备划分的basis:
{ "inverse3": [{ "device_id": "049D", "configure": { "basis": { "permutation": "XZY" } } }] }
curl -X POST "http://localhost:10001/inverse3/049D/config/basis?session=:0" \
-d '{"permutation":"XZY"}'
mount
重定义物理挂载转换。有关坐标处理流程,请参阅“挂载”和“工作区”部分。
{
"inverse3": [{
"device_id": "049D",
"configure": {
"mount": {
"transform": {
"position": { "x": 0.0, "y": 0.0, "z": 0.0 },
"rotation": { "w": 1.0, "x": 0.0, "y": 0.0, "z": 0.0 },
"scale": { "x": 1.0, "y": 1.0, "z": 1.0 }
}
}
}
}]
}
curl -X POST "http://localhost:10001/inverse3/049D/config/mount?session=:0" \
-H "Content-Type: application/json" \
-d '{"transform":{"position":{"x":0,"y":0,"z":0},"rotation":{"w":1,"x":0,"y":0,"z":0},"scale":{"x":1,"y":1,"z":1}}}'
警告
mount哇 preset它们是相互排斥的请勿在同一条消息中同时发送这两项内容。系统会将其视为模糊请求并予以拒绝。
damping
同时控制均匀阻尼和定向阻尼。至少需填写一个字段。
{ "inverse3": [{ "device_id": "049D", "configure": { "damping": { "scalar": 0.5 } } }] }
方向性:
{ "inverse3": [{ "device_id": "049D", "configure": { "damping": { "vector": { "x": 0.0, "y": 1.0, "z": 0.0 } } } }] }
curl -X POST "http://localhost:10001/inverse3/049D/config/filters/damping?session=:0" \
-d '{"scalar": 0.5}'
force_gate
振动防护装置——一旦检测到振动,便会衰减输出功率。
| 值 | 效果 |
|---|---|
gain = 0.0 | 禁用 — 力量以原始强度传递 |
gain = 1.0 | 振动过程中的最大衰减 |
{ "inverse3": [{ "device_id": "049D", "configure": { "force_gate": { "gain": 0.5 } } }] }
curl -X POST "http://localhost:10001/inverse3/049D/config/filters/force_gate?session=:0" \
-d '{"gain": 0.5}'
HTTP 专用设备的配置
以下设置为设备全局设置(非会话范围),且只能通过 HTTP 进行配置:
| 端点 | 正文 | 说明 |
|---|---|---|
POST /{type}/{id}/config/handedness | "left" 或者 "right" | Inverse3 惯用手(handedness) |
POST /{type}/{id}/config/torque_scaling | { "enabled": bool } | 启用/禁用扭矩缩放 |
POST /{type}/{id}/config/gravity_compensation | { "enabled": bool, "scaling_factor": float } | 重力补偿 |
POST /{type}/{id}/config/home_return | { "enabled": bool } | 返回主页(固件中尚未启用) |
所有端点都是 GET(查询当前值), POST(设置), DELETE支持(恢复默认设置)。