控制命令
这些是在每个设备下发送的按时发送、非持久性命令 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 | 力(单位:牛顿),在应用空间中 |
在一个帧内,力是可累加的——多个来源(您的应用、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 | 目标位置(以米为单位,在应用空间内) |
该服务计算将光标移动至目标所需的作用力。 如果启用了安全轨迹功能,光标速度将受到限制。
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
- 超文本传输协定
{
"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 握把 / 无线 Verse 握把
仅限夹持装置 rotation 会产生效果。 position 和 scale 这些
在与Inverse3 的模式一致性方面是被接受的Inverse3 对抓握没有影响。
使用“导航”模块实现自动漂移
如果您需要持续移动,请使用 导航模块
而不是手动流式传输 set_transform — 它会为您处理物理模拟、触觉
反馈以及工作区边界。
probe_position / probe_orientation
针对不发送控制命令的会话,仅进行监控性保持活动 (例如,Haply 的监测设备)。
{
"inverse3": [{ "device_id": "049D", "commands": { "probe_position": {} } }]
}
{
"verse_grip": [{ "device_id": "DEF456", "commands": { "probe_orientation": {} } }]
}
你可能不需要这些
如果您的会话已经发送了任何控制命令(set_cursor_force,
set_cursor_position(等),设备状态会在每次响应时自动刷新。探针仅适用于只读监控会话。