控制命令
这些是每帧传输的非持久性命令,每个设备的 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 | 应用程序空间中的目标位置(单位:米) |
该服务会计算将光标移动到目标位置所需的力量。 如果“安全轨迹”(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
- 超文本传输协定
{
"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 保持模式一致性而允许使用,但这对抓握没有任何影响。
请在自动漂移功能中使用导航模块
如果需要连续移动,请手动 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 (等)时,设备状态会随所有响应自动更新。探针仅在只读监控会话中才有用。