控制命令
这些是按周期发送且非持久化的命令,通过字典传递 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 est persistante — 该服务会记住上次
发送的值。在摄像头移动期间,请持续发送该值;或者仅发送一次,之后保持不变。
- 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 et scale 出于与Inverse3 方案保持一致的考虑,这些选项被接受,但对手柄没有任何影响。
使用“导航”模块实现自动导航
如果您需要连续移动,请使用 模块导航
而不是传递 set_transform 手动连续操作——它会为您处理物理模拟、触觉反馈
以及工作空间的界定。
probe_position / probe_orientation
仅用于监控的保持连接(keepalive)消息,适用于不发送控制命令的会话 (例如,Haply 监视设备的 Hub)。
{
"inverse3": [{ "device_id": "049D", "commands": { "probe_position": {} } }]
}
{
"verse_grip": [{ "device_id": "DEF456", "commands": { "probe_orientation": {} } }]
}
您可能不需要这个
如果您的会话已经发送了所有控制命令(set_cursor_force,
set_cursor_position(等),设备的状态会在每次
响应时自动更新。探头仅适用于只读监控会话。