跳到主要内容

设置参考

本文档列出了 /settings/ 端点返回的所有设置项,包括每项的 key、type(来自 type_hint)以及约束条件(来自 metadata.constraint.range 及 locked,如适用)。

标记为 locked 的设置项在运行时为只读。可以通过配置文件或 Haply Hub 设置页面进行修改,但需要完整重启服务后更改才会生效。下表中这些设置项标记为 boot。

配置​

用于在服务启动时覆盖设置的配置文件位于以下位置:

平台位置
WindowsC:\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_settingsbool—在 GET /settings 列表中包含标记为 advanced 的设置(默认 false)。等同于每次请求都传入 ?advanced=true。
misc/deprecated_settingsbool—在 GET /settings 列表中包含标记为 deprecated 的设置(默认 false)。等同于每次请求都传入 ?deprecated=true。

类型映射​

API 返回的类型提示与以下 JSON 结构的对应关系如下:

  • STRING → string
  • BOOL → bool
  • INT → int
  • FLOAT → float
  • ARR_STRING → string[]
  • VEC3 → vec3(包含 {x, y, z} 的对象)
  • GENERIC → json(任意结构化值)

communication/…​

HTTP、WebSocket 及事件流服务器的网络端口与绑定地址。大多数条目仅在启动时生效。

键类型约束描述
communication/serial/enabledbool—启用或禁用串口设备通信。
communication/bind_addressstringbootHTTP 与 WebSocket 服务器绑定的 IP 地址。
communication/bind_all_interfacesboolboot将服务器绑定到 0.0.0.0 而非 localhost。
communication/http/portintbootHTTP REST API 端口(默认 10000)。
communication/websocket/portintboot主 v3.1 WebSocket 端口(默认 10001)。
communication/websocket/legacy_portintboot旧版 v3.0 WebSocket 端口(默认 10000)。
communication/events/portintboot事件流 WebSocket 端口(默认 10020)。

devices/…​

devices/detection/…​

串口扫描策略。所有条目均为高级设置。

KeyTypeConstraintsDescription
devices/detection/scan_period_msintrange 100–10000; boot串口扫描的间隔(毫秒)。
devices/detection/handshake_timeout_sintrange 1–15每个端口的握手超时时间(秒)。
devices/detection/max_retriesintrange 1–10每个端口的最大握手重试次数。
devices/detection/failure_log_delay_sintrange 1–60重新记录检测失败日志前的延迟(秒)。
devices/detection/block_looping_portsbool—检测到环回端口时阻止设备就绪。
devices/detection/excluded_portsjson—检测期间需要跳过的串口路径。
devices/detection/additional_portsstring[]—无条件扫描的额外串口路径。
devices/detection/allowed_vendor_id_filterstring[]—端口枚举期间允许的 USB 厂商 ID。
devices/detection/port_name_substring_filterstring[]—需要匹配的平台相关端口名称子字符串。
devices/detection/wireless_verse_grip_description_filterstring[]—用于检测无线 VerseGrip 的端口描述子字符串。
devices/detection/inverse3x_description_filterstring[]—用于检测 Inverse3x 的端口描述子字符串。
devices/detection/extra_ports (已弃用)string[]—请改用 devices/detection/additional_ports。读写操作会透明地转发至规范键。

devices/*inverse/…​

应用于每个 Inverse3 系列设备的全局默认值。每会话覆盖设置优先。

3.5.1 中已重命名

在 3.5.0 中,通配符为 devices/inverse*/…;现在前导 * 位于 inverse 之前。使用旧字面量的配置文件在 3.5.1 上将无法绑定——请更新它们。键名本身没有其他变化。

KeyTypeConstraintsDescription
devices/*inverse/filters/force_scale/gainfloatrange 0.0–2.0应用于所有设备的全局力输出倍率。
devices/*inverse/filters/force_gate/gainfloatrange 0.0–1.0新会话的默认力门控增益。
devices/*inverse/control_timeout_msintrange 50–10000释放设备控制锁之前的超时时间(毫秒)。
devices/*inverse/query_orientation_on_idlebool—设备空闲时从固件查询机身姿态。
devices/*inverse/body_orientation_poll_interval_msintrange 0–5000会话激活期间两次机身姿态实时读取之间的间隔(毫秒);默认 50(同时也是下限),0 表示禁用。仅适用于固件 7.9 及以上版本。
devices/*inverse/safeties/expose_in_snapshotbool—在 GET /devices/{id} 快照中包含每台设备的安全标志。

devices/presets​

KeyTypeConstraintsDescription
devices/presetsjson—每种设备类型的默认设备配置预设(安装变换、基座等,适用于 inverse_arm_front_*、inverse_led_front_*、minverse_*、verse_grip_default、wireless_verse_grip_default、custom_verse_grip_default)。

devices/wireless_verse_grip/…​

KeyTypeConstraintsDescription
devices/wireless_verse_grip/battery/low_thresholdint—电量百分比低于此值时触发低电量警告。
devices/wireless_verse_grip/battery/critical_thresholdint—电量百分比低于此值时触发临界电量告警。
devices/wireless_verse_grip/battery/reset_marginint—清除电量警告之前的滞回裕度。
devices/wireless_verse_grip/filters/orientation_filterjsonboot无线 VerseGrip 姿态的 One Euro 滤波器配置。

features/…​

features/calibration/…​

KeyTypeConstraintsDescription
features/calibration/hall_thresholdintrange 1–32校准期间判定笔已连接时的霍尔传感器电平。

features/grip_hook/…​

自动抓握钩行为——握持手柄保持直立时锁定光标。

KeyTypeConstraintsDescription
features/grip_hook/enabledbool—握持手柄保持直立时启用抓握钩自动锁定。
features/grip_hook/use_hallbool—使用霍尔传感器阈值而非姿态进行抓握检测。
features/grip_hook/hallintrange 1–32触发抓握锁定的霍尔传感器数值阈值。
features/grip_hook/hold_durationintrange 10–1000触发后保持锁定的时长(毫秒)。

features/navigation/bubble/…​

Bubble 导航模块的默认值——在首次激活 bubble 行为时传入会话。各字段的运行时语义请参阅 导航模块 页面。

KeyTypeConstraintsDescription
features/navigation/bubble/centervec3—Default bubble centre position.
features/navigation/bubble/center_enabledbool—Apply the configured center when a bubble behaviour is first activated.
features/navigation/bubble/rotation_enabledbool—Apply the workspace rotation to the navigation direction.
features/navigation/bubble/scale_enabledbool—Apply the workspace scale to the navigation velocity.
features/navigation/bubble/center_drift_speedfloat≥ 0Drift speed (m/s) in auto_follow centre mode.
features/navigation/bubble/max_velocityfloat—Maximum navigation velocity in the velocity zone (m/s).
features/navigation/bubble/velocity_zone_widthfloat—Width of the velocity zone outside the bubble surface (m).
features/navigation/bubble/reset_velocity_on_entrybool—Reset velocity to zero when the cursor enters the bubble.
features/navigation/bubble/spring_innerfloat—Spring coefficient at the bubble centre (N/m).
features/navigation/bubble/spring_surfacefloat—Spring coefficient at the bubble surface (N/m).
features/navigation/bubble/spring_outerfloat—Spring coefficient at the outer boundary (N/m).
features/navigation/bubble/damping_innerfloat—Damping coefficient at the bubble centre (Ns/m).
features/navigation/bubble/damping_surfacefloat—Damping coefficient at the bubble surface (Ns/m).
features/navigation/bubble/damping_outerfloat—Damping coefficient at the outer boundary (Ns/m).
features/navigation/bubble/wall_stiffnessfloat—Stiffness of the hard wall at the outer boundary (N/m).
features/navigation/bubble/bump_widthfloat—Width of the tactile bump at the bubble surface (m).
features/navigation/bubble/bump_stiffnessfloat—Stiffness of the tactile bump at the bubble surface (N/m).
features/navigation/bubble/stop_at_collisionbool—Block the bubble centre from drifting into the collision direction when a collision is active.
features/navigation/bubble/collision_thresholdfloat> 0External-force magnitude (N) at which a collision is detected.
features/navigation/bubble/collision_inflate_scalefloat≥ 1Multiplier applied to velocity_zone_width while a collision is active.
features/navigation/bubble/collision_exit_ratiofloatrange (0,1]Hysteresis ratio — exit collision when |ext_force| drops below collision_threshold × this. 1.0 disables hysteresis.
features/navigation/bubble/avatar_boundary_enabledbool—Clamp the avatar world position to the configured avatar_boundary SDF shape.

features/safe_trajectory/…​

末端执行器运动的速度限制器。

键类型约束描述
features/safe_trajectory/enabledbool—启用安全轨迹速度限制器。
features/safe_trajectory/max_velfloat范围 0.01–2.0允许的最大末端执行器速度(m/s)。

features/screensaver/…​

设备未被会话驱动时,在 Inverse3 设备上播放的空闲动画。

键类型约束描述
features/screensaver/enabledbool—在 Inverse3 设备上启用空闲屏保动画。
features/screensaver/speedfloat范围 0.001–0.2屏保动画速度。
features/screensaver/distracted_speedfloat范围 0.001–0.2用户靠近但未参与交互时的动画速度。

features/sdf/…​

有符号距离场(SDF)触觉效果模块(SDF HFX)。

键类型约束描述
features/sdf/enabledbool—启用或禁用 SDF 触觉效果模块。
features/sdf/state_outputbool—默认在设备输出负载中包含 SDF 状态。
features/sdf/max_countint范围 0–128同时活动的 SDF 效果最大数量(0 表示不限)。
features/sdf/events/createdbool—创建新 SDF 效果时发出事件。
features/sdf/events/deletedbool—删除 SDF 效果时发出事件。
features/sdf/events/updatedbool—更新 SDF 效果时发出事件。
features/sdf/probe_on_zero_force/enabledbool—施加力接近零时自动探测 SDF 场。
features/sdf/probe_on_zero_force/delayfloat范围 0.001–60.0力降为零后自动探测前的延迟(s)。

features/verse_grip_pairing/…​

跟踪 Inverse3 与(有线或无线)Verse Grip 之间的连接/断开状态。为 Haply Hub 配对界面提供支持。

键类型约束描述
features/verse_grip_pairing/enabledbool—启用配对 / 连接-断开状态跟踪。
features/verse_grip_pairing/hall_threshold_vgint范围 1–32有线 VerseGrip 被视为已连接时的霍尔电平。
features/verse_grip_pairing/hall_threshold_wvgint范围 1–32无线 VerseGrip 被视为已连接时的霍尔电平。
features/verse_grip_pairing/detach_debounce_msint范围 0–1000确认断开前的防抖时间窗口(ms)。
features/verse_grip_pairing/heartbeat_msint范围 100–10000强制重新通知之间的间隔(ms)。
features/verse_grip_pairing/force_attachedbool—绕过霍尔传感器,将已连接状态永久强制为 true(硬件故障的临时方案)。

session/serialization/…​

变换输出格式,影响 WebSocket 和 HTTP JSON 载荷。这些键在 3.5.1 中从 serialization/* 迁移至 session/serialization/*,以体现其按会话作用域的特性。旧路径仍可通过已弃用的别名解析。

键类型约束说明
session/serialization/explicit_fieldsbool—在序列化输出中包含与恒等默认值相等的变换字段(例如 position: {0,0,0}、rotation: {w:1,…})。当客户端要求每个字段都显式存在时很有用。默认值:false。
session/serialization/force_complete_transformsbool—在每个变换输出中始终输出 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_hzint范围 20–500触发警告前可接受的设备最低仿真频率(Hz)。

rate/…​

服务节流控制。3.5.1 版本引入。以下四个 rate/websocket/* 键此前位于 session/commands/* 下;旧路径仍可通过已弃用的别名解析。

键类型约束说明
rate/websocket/zoh_window_msint—零阶保持窗口——抑制在该窗口内接收到的探测(ms)。
rate/websocket/drop_warning_thresholdint—在窗口内丢弃的命令数达到此值时触发警告。
rate/websocket/drop_warning_window_msint—用于统计丢弃命令数的滑动窗口大小(ms)。
rate/websocket/tick_on_empty_batchbool高级即使整个 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 访问它们以便调试,但请注意,它们可能会在后续的次要版本中被转正、重命名或移除。请勿将客户端行为绑定到这些设置上。