Skip to content

Expand ${VAR} env references in obelisk config values - #172

Merged
wdc3iii merged 1 commit into
mainfrom
feat/config-env-var-expansion
Jul 14, 2026
Merged

Expand ${VAR} env references in obelisk config values#172
wdc3iii merged 1 commit into
mainfrom
feat/config-env-var-expansion

Conversation

@wdc3iii

@wdc3iii wdc3iii commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

load_config_file previously passed every YAML string through verbatim, forcing downstream configs (e.g. legged_locomotion_rl's nav/mpc configs) to hard-code absolute paths like /home//.../nav_graphs.

Add _expand_env_vars, run per-file in _load_config_recursive right after load (before include-processing and merging). This expands ${VAR} in every string leaf -- include paths, node params, sim sensor config_path, etc. -- in the launch process, before values are serialized into ROS parameters, so downstream nodes (Python and C++) receive fully-resolved absolute paths and need no env-var awareness.

  • Only the braced ${VAR} form is expanded; a bare $ is left untouched.
  • An undefined variable raises KeyError naming the offending file, so a typo fails fast at launch instead of surfacing as a file-not-found in a node.
  • No-op on any string without ${, so existing configs are unaffected.

Add coverage in test_launch_utils.py: value expansion (params + sim config_path), undefined-var raise, scalar/bare-$ passthrough, and ${VAR} inside an include path.

load_config_file previously passed every YAML string through verbatim,
forcing downstream configs (e.g. legged_locomotion_rl's nav/mpc configs)
to hard-code absolute paths like /home/<user>/.../nav_graphs.

Add _expand_env_vars, run per-file in _load_config_recursive right after
load (before include-processing and merging). This expands ${VAR} in every
string leaf -- include paths, node params, sim sensor config_path, etc. --
in the launch process, before values are serialized into ROS parameters, so
downstream nodes (Python and C++) receive fully-resolved absolute paths and
need no env-var awareness.

- Only the braced ${VAR} form is expanded; a bare $ is left untouched.
- An undefined variable raises KeyError naming the offending file, so a typo
  fails fast at launch instead of surfacing as a file-not-found in a node.
- No-op on any string without ${, so existing configs are unaffected.

Add coverage in test_launch_utils.py: value expansion (params + sim
config_path), undefined-var raise, scalar/bare-$ passthrough, and ${VAR}
inside an include path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wdc3iii
wdc3iii merged commit 61729a5 into main Jul 14, 2026
@wdc3iii
wdc3iii deleted the feat/config-env-var-expansion branch July 15, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant