控制命令
这些是在每个设备下发送的按时发送、非持久性命令 commands 映射。它们被应用 一次 并被忽略——如果你停止发送这些数据,该设备将恢复待机状态。
除非另有说明,所有控制命令均仅支持WebSocket(无 HTTP 对应版本)。
对光标(末端执行器)施加一个笛卡尔力。
{
"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(等),设备状态会在每次响应时自动刷新。 探针仅适用于只读监控会话。
