控制命令
以下是各设备的 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 | 以应用空间为基准的牛顿单位力 |
力在单个时间步长内进行**加法(additive)**处理。来自多个来源(应用、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它是**持久的(persistent)**。该服务会记住上次传输的值。您可以在摄像头移动时进行流式传输,也可以只需传输一次即可。
- 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 保持模式一致性而允许这样做,但这不会影响抓取。
请在自动漂移功能中使用导航模块
如果需要持续移动的话 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 (等)时,设备状态会随所有响应自动更新。探针仅在只读监控会话中才有用。