Runtime Config Module (config.ts)
Module path: web_rviz/src/config.ts
Purpose
Handles browser-side runtime configuration load/save behavior. During connection setup, the default
packageRootUrl value can be translated into a ROS-host-specific runtime asset root.
Public API
RuntimeConfig
Field |
Type |
Description |
|---|---|---|
|
|
ROS bridge WebSocket URL. |
|
|
RViz config URL. |
|
|
URDF fallback path when |
|
|
HTTP root path for |
|
|
Scene fixed frame. |
|
|
Default point cloud topic name. |
|
|
Max sampled points to keep for rendering. |
|
|
Render target FPS. |
defaultConfig
Provides default values for first-time load or invalid local cache.
packageRootUrldefaults to/ros_pkgs.When callers keep that default, the connect flow in
main.tsmay derive the effective runtime URL ashttp(s)://<rosbridge-host>:8081/ros_pkgs.
loadConfig(): RuntimeConfig
Loads webrviz-runtime-config from localStorage and falls back to defaults on parse errors.
saveConfig(config: RuntimeConfig): void
Serializes and persists runtime config to localStorage.
Behavior Notes
Auto-derived runtime asset roots are connection-scoped helpers; they do not need to overwrite the persisted
packageRootUrlvalue.If a user enters a custom
packageRootUrl, that explicit value is preserved and auto-derivation is skipped.