控制命令
这些是按 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 | 应用空间中的力(单位:牛顿) |
在一个帧内,力值会进行累加。来自多个来源(如您使用的应用、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
对3个关节施加扭矩(角度力模式控制)。
{
"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 的模式保持一致而被接受,但这不会影响抓取。
自动漂移使用 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 (例如)发送请求时,设备的状态会随每次响应自动更新。探针仅在只读监控会话中才有用。