控制命令
这些是按周期(每个 tick)发送、不持久保存的命令,置于每个设备的 commands 映射下。它们只会被应用一次,之后即被丢弃——如果停止发送,设备将恢复为空闲状态。
除非另有说明,所有控制命令均仅适用于 WebSocket(没有 HTTP 的等效命令)。
set_cursor_force
对光标(末端执行器)施加笛卡尔力。
{
"inverse3": [{
"device_id": "049D",
"commands": {
"set_cursor_force": {
"vector": { "x": 0.0, "y": 0.0, "z": 1.5 }
}
}
}]
}
| 字段 | 类型 | 描述 |
|---|---|---|
vector | vec3 | 应用空间中的力,单位为牛顿(N) |
力在单个控制周期(tick)内是可叠加的——多个来源(你的应用、SDF HFX、导航)的力会先求和,再发送到设备。
set_cursor_position
将光标指令设置到目标位置(位置模式控制)。
{
"inverse3": [{
"device_id": "049D",
"commands": {
"set_cursor_position": {
"position": { "x": 0.0, "y": -0.12, "z": 0.15 }
}
}
}]
}
| 字段 | 类型 | 描述 |
|---|---|---|
position | vec3 | 目标位置,单位为米,位于应用空间中 |
该服务会计算使光标朝目标移动所需的力。 若启用了安全轨迹(safe-trajectory),则会对光标速度进行速率限制。
set_angular_torques
对三个关节施加力矩(角力模式控制)。
{
"inverse3": [{
"device_id": "049D",
"commands": {
"set_angular_torques": {
"torques": { "a0": 0.0, "a1": 0.0, "a2": 0.0 }
}
}
}]
}
| 字段 | 类型 | 说明 |
|---|---|---|
torques | angles3 | 关节扭矩 |
set_angular_position
控制关节运动至目标角度(角度位置模式控制)。
{
"inverse3": [{
"device_id": "049D",
"commands": {
"set_angular_position": {
"angles": { "a0": 30.0, "a1": 45.0, "a2": 60.0 }
}
}
}]
}
| 字段 | 类型 | 描述 |
|---|---|---|
angles | angles3 | 目标关节角度,单位为度 |
set_transform
设置工作空间变换(设备空间 → 应用空间)。与其他命令不同,set_transform 是持久性的:服务会记住你最后发送的值。你可以在相机运动期间持续推送该值,也可以只发送一次,之后保持不变。
- WebSocket
- HTTP
{
"inverse3": [{
"device_id": "049D",
"commands": {
"set_transform": {
"transform": {
"position": { "x": 1.0, "y": 0.0, "z": 0.0 },
"rotation": { "x": 0.0, "y": 0.0, "z": 0.0, "w": 1.0 },
"scale": { "x": 1.0, "y": 1.0, "z": 1.0 }
}
}
}
}]
}
curl -X POST "http://localhost:10001/inverse3/049D/state/transform?session=:0" \
-H "Content-Type: application/json" \
-d '{"transform":{"position":{"x":1,"y":0,"z":0},"rotation":{"w":1,"x":0,"y":0,"z":0},"scale":{"x":1,"y":1,"z":1}}}'
Verse grip / 无线版 Verse grip
对于握持设备,仅 rotation 有效。position 和 scale 为了与 Inverse3 保持 schema 一致而被接受,但对握把没有任何作用。
使用 Navigation 模块实现自动漂移
如果需要持续移动,请改用 Navigation 模块,而不是手动流式发送 set_transform。它会为您处理物理计算、触觉反馈和工作空间边界限制。
probe_position / probe_orientation
仅用于监控的保活机制,适用于不发送控制命令的会话(例如使用 Haply Hub 观察设备的场景)。
{
"inverse3": [{ "device_id": "049D", "commands": { "probe_position": {} } }]
}
{
"verse_grip": [{ "device_id": "DEF456", "commands": { "probe_orientation": {} } }]
}
你可能并不需要这些
如果你的会话已经在发送任何控制命令(set_cursor_force、set_cursor_position 等),设备状态会随每次响应自动刷新。探测命令仅适用于只读监控会话。