设置参考
本文档列出了 /settings/ 端点返回的所有设置项,包括每项的 key、type(来自 type_hint)以及约束条件(来自 metadata.constraint.range 及 locked,如适用)。
标记为 locked 的设置项在运行时为只读。可以通过配置文件或 Haply Hub 设置页面进行修改,但需要完整重启服务后更改才会生效。下表中这些设置项标记为 boot。
配置
用于在服务启动时覆盖设置的配置文件位于以下位置:
| 平台 | 位置 |
|---|---|
| Windows | C:\ProgramData\Haply\Inverse\haply-inverse-service-config.json |
| MacOS | /Library/Application Support/Haply/Inverse/haply-inverse-service-config.json |
| Linux | /etc/haply-inverse-service/haply-inverse-service-config.json |
该配置文件是一个扁平的 JSON 对象,将设置项的 key 映射到覆盖值。key 必须是 /settings/ HTTP 路由返回的有效设置 key(参见 API 参考)。未指定的 key 将使用服务默认值。
例如,网络配置覆盖项如下:
{
"communication/http/port": 8400,
"communication/websocket/port": 8500,
"communication/events/port": 9000,
"communication/bind_all_interfaces": true
}
可见性与过滤
/settings 列表端点(GET /settings、GET /settings/)默认仅返回基础设置。传入 ?advanced=true 可包含标记为高级的设置,传入 ?deprecated=true 可包含已弃用的别名。隐藏设置仅供内部使用,只有通过 POST /settings/misc/hidden_settings 将 misc/hidden_settings 设为生效后才会显示(没有对应的查询参数)。过滤标志之间为逻辑与关系,同时标记为 advanced 和 hidden 的键需要两个开关都打开。对已知键执行 POST 和 DELETE 不受这些限制。
单键读取(GET /settings/<key>)在使用准确的规范键名时会绕过高级/已弃用的过滤限制,适用于已事先了解键名的客户端。隐藏键仍受限制。
三个运行时开关用于初始化上述过滤门控,其值在服务的整个生命周期内保持有效:
| 键 | 类型 | 约束 | 描述 |
|---|---|---|---|
misc/advanced_settings | bool | — | 在 GET /settings 列表中包含标记为 advanced 的设置(默认 false)。等同于每次请求都传入 ?advanced=true。 |
misc/deprecated_settings | bool | — | 在 GET /settings 列表中包含标记为 deprecated 的设置(默认 false)。等同于每次请求都传入 ?deprecated=true。 |
类型映射
API 返回的类型提示与以下 JSON 结构的对应关系如下:
STRING→stringBOOL→boolINT→intFLOAT→floatARR_STRING→string[]VEC3→vec3(包含{x, y, z}的对象)GENERIC→json(任意结构化值)
communication/…
HTTP、WebSocket 及事件流服务器的网络端口与绑定地址。大多数条目仅在启动时生效。
| 键 | 类型 | 约束 | 描述 |
|---|---|---|---|
communication/serial/enabled | bool | — | 启用或禁用串口设备通信。 |
communication/bind_address | string | boot | HTTP 与 WebSocket 服务器绑定的 IP 地址。 |
communication/bind_all_interfaces | bool | boot | 将服务器绑定到 0.0.0.0 而非 localhost。 |
communication/http/port | int | boot | HTTP REST API 端口(默认 10000)。 |
communication/websocket/port | int | boot | 主 v3.1 WebSocket 端口(默认 10001)。 |
communication/websocket/legacy_port | int | boot | 旧版 v3.0 WebSocket 端口(默认 10000)。 |
communication/events/port | int | boot | 事件流 WebSocket 端口(默认 10020)。 |
devices/…
devices/detection/…
串口扫描策略。所有条目均为高级设置。
| Key | Type | Constraints | Description |
|---|---|---|---|
devices/detection/scan_period_ms | int | range 100–10000; boot | 串口扫描的间隔(毫秒)。 |
devices/detection/handshake_timeout_s | int | range 1–15 | 每个端口的握手超时时间(秒)。 |
devices/detection/max_retries | int | range 1–10 | 每个端口的最大握手重试次数。 |
devices/detection/failure_log_delay_s | int | range 1–60 | 重新记录检测失败日志前的延迟(秒)。 |
devices/detection/block_looping_ports | bool | — | 检测到环回端口时阻止设备就绪。 |
devices/detection/excluded_ports | json | — | 检测期间需要跳过的串口路径。 |
devices/detection/additional_ports | string[] | — | 无条件扫描的额外串口路径。 |
devices/detection/allowed_vendor_id_filter | string[] | — | 端口枚举期间允许的 USB 厂商 ID。 |
devices/detection/port_name_substring_filter | string[] | — | 需要匹配的平台相关端口名称子字符串。 |
devices/detection/wireless_verse_grip_description_filter | string[] | — | 用于检测无线 VerseGrip 的端口描述子字符串。 |
devices/detection/inverse3x_description_filter | string[] | — | 用于检测 Inverse3x 的端口描述子字符串。 |
devices/detection/extra_ports (已弃用) | string[] | — | 请改用 devices/detection/additional_ports。读写操作会透明地转发至规范键。 |
devices/*inverse/…
应用于每个 Inverse3 系列设备的全局默认值。每会话覆盖设置优先。
在 3.5.0 中,通配符为 devices/inverse*/…;现在前导 * 位于 inverse 之前。使用旧字面量的配置文件在 3.5.1 上将无法绑定——请更新它们。键名本身没有其他变化。
| Key | Type | Constraints | Description |
|---|---|---|---|
devices/*inverse/filters/force_scale/gain | float | range 0.0–2.0 | 应用于所有设备的全局力输出倍率。 |
devices/*inverse/filters/force_gate/gain | float | range 0.0–1.0 | 新会话的默认力门控增益。 |
devices/*inverse/control_timeout_ms | int | range 50–10000 | 释放设备控制锁之前的超时时间(毫秒)。 |
devices/*inverse/query_orientation_on_idle | bool | — | 设备空闲时从固件查询机身姿态。 |
devices/*inverse/body_orientation_poll_interval_ms | int | range 0–5000 | 会话激活期间两次机身姿态实时读取之间的间隔(毫秒);默认 50(同时也是下限),0 表示禁用。仅适用于固件 7.9 及以上版本。 |
devices/*inverse/safeties/expose_in_snapshot | bool | — | 在 GET /devices/{id} 快照中包含每台设备的安全标志。 |
devices/presets
| Key | Type | Constraints | Description |
|---|---|---|---|
devices/presets | json | — | 每种设备类型的默认设备配置预设(安装变换、基座等,适用于 inverse_arm_front_*、inverse_led_front_*、minverse_*、verse_grip_default、wireless_verse_grip_default、custom_verse_grip_default)。 |
devices/wireless_verse_grip/…
| Key | Type | Constraints | Description |
|---|---|---|---|
devices/wireless_verse_grip/battery/low_threshold | int | — | 电量百分比低于此值时触发低电量警告。 |
devices/wireless_verse_grip/battery/critical_threshold | int | — | 电量百分比低于此值时触发临界电量告警。 |
devices/wireless_verse_grip/battery/reset_margin | int | — | 清除电量警告之前的滞回裕度。 |
devices/wireless_verse_grip/filters/orientation_filter | json | boot | 无线 VerseGrip 姿态的 One Euro 滤波器配置。 |
features/…
features/calibration/…
| Key | Type | Constraints | Description |
|---|---|---|---|
features/calibration/hall_threshold | int | range 1–32 | 校准期间判定笔已连接时的霍尔传感器电平。 |
features/grip_hook/…
自动抓握钩行为——握持手柄保持直立时锁定光标。
| Key | Type | Constraints | Description |
|---|---|---|---|
features/grip_hook/enabled | bool | — | 握持手柄保持直立时启用抓握钩自动锁定。 |
features/grip_hook/use_hall | bool | — | 使用霍尔传感器阈值而非姿态进行抓握检测。 |
features/grip_hook/hall | int | range 1–32 | 触发抓握锁定的霍尔传感器数值阈值。 |
features/grip_hook/hold_duration | int | range 10–1000 | 触发后保持锁定的时长(毫秒)。 |
features/navigation/bubble/…
Bubble 导航模块的默认值——在首次激活 bubble 行为时传入会话。各字段的运行时语义请参阅 导航模块 页面。
| Key | Type | Constraints | Description |
|---|---|---|---|
features/navigation/bubble/center | vec3 | — | Default bubble centre position. |
features/navigation/bubble/center_enabled | bool | — | Apply the configured center when a bubble behaviour is first activated. |
features/navigation/bubble/rotation_enabled | bool | — | Apply the workspace rotation to the navigation direction. |
features/navigation/bubble/scale_enabled | bool | — | Apply the workspace scale to the navigation velocity. |
features/navigation/bubble/center_drift_speed | float | ≥ 0 | Drift speed (m/s) in auto_follow centre mode. |
features/navigation/bubble/max_velocity | float | — | Maximum navigation velocity in the velocity zone (m/s). |
features/navigation/bubble/velocity_zone_width | float | — | Width of the velocity zone outside the bubble surface (m). |
features/navigation/bubble/reset_velocity_on_entry | bool | — | Reset velocity to zero when the cursor enters the bubble. |
features/navigation/bubble/spring_inner | float | — | Spring coefficient at the bubble centre (N/m). |
features/navigation/bubble/spring_surface | float | — | Spring coefficient at the bubble surface (N/m). |
features/navigation/bubble/spring_outer | float | — | Spring coefficient at the outer boundary (N/m). |
features/navigation/bubble/damping_inner | float | — | Damping coefficient at the bubble centre (Ns/m). |
features/navigation/bubble/damping_surface | float | — | Damping coefficient at the bubble surface (Ns/m). |
features/navigation/bubble/damping_outer | float | — | Damping coefficient at the outer boundary (Ns/m). |
features/navigation/bubble/wall_stiffness | float | — | Stiffness of the hard wall at the outer boundary (N/m). |
features/navigation/bubble/bump_width | float | — | Width of the tactile bump at the bubble surface (m). |
features/navigation/bubble/bump_stiffness | float | — | Stiffness of the tactile bump at the bubble surface (N/m). |
features/navigation/bubble/stop_at_collision | bool | — | Block the bubble centre from drifting into the collision direction when a collision is active. |
features/navigation/bubble/collision_threshold | float | > 0 | External-force magnitude (N) at which a collision is detected. |
features/navigation/bubble/collision_inflate_scale | float | ≥ 1 | Multiplier applied to velocity_zone_width while a collision is active. |
features/navigation/bubble/collision_exit_ratio | float | range (0,1] | Hysteresis ratio — exit collision when |ext_force| drops below collision_threshold × this. 1.0 disables hysteresis. |
features/navigation/bubble/avatar_boundary_enabled | bool | — | Clamp the avatar world position to the configured avatar_boundary SDF shape. |
features/safe_trajectory/…
末端执行器运动的速度限制器。
| 键 | 类型 | 约束 | 描述 |
|---|---|---|---|
features/safe_trajectory/enabled | bool | — | 启用安全轨迹速度限制器。 |
features/safe_trajectory/max_vel | float | 范围 0.01–2.0 | 允许的最大末端执行器速度(m/s)。 |
features/screensaver/…
设备未被会话驱动时,在 Inverse3 设备上播放的空闲动画。
| 键 | 类型 | 约束 | 描述 |
|---|---|---|---|
features/screensaver/enabled | bool | — | 在 Inverse3 设备上启用空闲屏保动画。 |
features/screensaver/speed | float | 范围 0.001–0.2 | 屏保动画速度。 |
features/screensaver/distracted_speed | float | 范围 0.001–0.2 | 用户靠近但未参与交互时的动画速度。 |
features/sdf/…
有符号距离场(SDF)触觉效果模块(SDF HFX)。
| 键 | 类型 | 约束 | 描述 |
|---|---|---|---|
features/sdf/enabled | bool | — | 启用或禁用 SDF 触觉效果模块。 |
features/sdf/state_output | bool | — | 默认在设备输出负载中包含 SDF 状态。 |
features/sdf/max_count | int | 范围 0–128 | 同时活动的 SDF 效果最大数量(0 表示不限)。 |
features/sdf/events/created | bool | — | 创建新 SDF 效果时发出事件。 |
features/sdf/events/deleted | bool | — | 删除 SDF 效果时发出事件。 |
features/sdf/events/updated | bool | — | 更新 SDF 效果时发出事件。 |
features/sdf/probe_on_zero_force/enabled | bool | — | 施加力接近零时自动探测 SDF 场。 |
features/sdf/probe_on_zero_force/delay | float | 范围 0.001–60.0 | 力降为零后自动探测前的延迟(s)。 |
features/verse_grip_pairing/…
跟踪 Inverse3 与(有线或无线)Verse Grip 之间的连接/断开状态。为 Haply Hub 配对界面提供支持。
| 键 | 类型 | 约束 | 描述 |
|---|---|---|---|
features/verse_grip_pairing/enabled | bool | — | 启用配对 / 连接-断开状态跟踪。 |
features/verse_grip_pairing/hall_threshold_vg | int | 范围 1–32 | 有线 VerseGrip 被视为已连接时的霍尔电平。 |
features/verse_grip_pairing/hall_threshold_wvg | int | 范围 1–32 | 无线 VerseGrip 被视为已连接时的霍尔电平。 |
features/verse_grip_pairing/detach_debounce_ms | int | 范围 0–1000 | 确认断开前的防抖时间窗口(ms)。 |
features/verse_grip_pairing/heartbeat_ms | int | 范围 100–10000 | 强制重新通知之间的间隔(ms)。 |
features/verse_grip_pairing/force_attached | bool | — | 绕过霍尔传感器,将已连接状态永久强制为 true(硬件故障的临时方案)。 |
session/serialization/…
变换输出格式,影响 WebSocket 和 HTTP JSON 载荷。这些键在 3.5.1 中从 serialization/* 迁移至 session/serialization/*,以体现其按会话作用域的特性。旧路径仍可通过已弃用的别名解析。
| 键 | 类型 | 约束 | 说明 |
|---|---|---|---|
session/serialization/explicit_fields | bool | — | 在序列化输出中包含与恒等默认值相等的变换字段(例如 position: {0,0,0}、rotation: {w:1,…})。当客户端要求每个字段都显式存在时很有用。默认值:false。 |
session/serialization/force_complete_transforms | bool | — | 在每个变换输出中始终输出 position、rotation 和 scale,包括仅支持姿态的设备(Verse Grip、Wireless Verse Grip),这些设备原本只输出 rotation。已包含 session/serialization/explicit_fields 的功能。默认值:false。 |
serialization/explicit_fields (已弃用) | bool | — | 请改用 session/serialization/explicit_fields。读写操作会透明地转发至标准键。 |
serialization/force_complete_transforms (已弃用) | bool | — | 请改用 session/serialization/force_complete_transforms。读写操作会透明地转发至标准键。 |
session/…
会话调度器。
| 键 | 类型 | 约束 | 说明 |
|---|---|---|---|
session/min_simulation_rate_hz | int | 范围 20–500 | 触发警告前可接受的设备最低仿真频率(Hz)。 |
rate/…
服务节流控制。3.5.1 版本引入。以下四个 rate/websocket/* 键此前位于 session/commands/* 下;旧路径仍可通过已弃用的别名解析。
| 键 | 类型 | 约束 | 说明 |
|---|---|---|---|
rate/websocket/zoh_window_ms | int | — | 零阶保持窗口——抑制在该窗口内接收到的探测(ms)。 |
rate/websocket/drop_warning_threshold | int | — | 在窗口内丢弃的命令数达到此值时触发警告。 |
rate/websocket/drop_warning_window_ms | int | — | 用于统计丢弃命令数的滑动窗口大小(ms)。 |
rate/websocket/tick_on_empty_batch | bool | 高级 | 即使整个 WebSocket 批次被丢弃,仍调度一次 main_loop tick。 |
session/commands/zoh_window_ms (已弃用) | int | — | 请改用 rate/websocket/zoh_window_ms。读写操作会被透明转发。 |
session/commands/drop_warning_threshold (已弃用) | int | — | 请改用 rate/websocket/drop_warning_threshold。读写操作会被透明转发。 |
session/commands/drop_warning_window_ms (已弃用) | int | — | 请改用 rate/websocket/drop_warning_window_ms。读写操作会被透明转发。 |
session/commands/tick_on_empty_batch (已弃用) | bool | — | 请改用 rate/websocket/tick_on_empty_batch。读写操作会被透明转发。 |
仅限内部使用的设置
以下设置项族在 3.5.1 中标记为 hidden,仅供内部使用:rate/dispatch/*(AIMD 分发速率上限和背压阈值)、session/freeform/*(行为指纹识别),以及 session/serialization/preview/*(预发布序列化实验,例如欧拉四元数输出和无线VerseGrip路由)。可以通过 misc/hidden_settings 访问它们以便调试,但请注意,它们可能会在后续的次要版本中被转正、重命名或移除。请勿将客户端行为绑定到这些设置上。