Skip to content

refactor: unify entry points into a Click CLI (grl-snam); tools/ + demos/ packages; consolidate onto pycvc_gl - #20

Merged
transfix merged 2 commits into
mainfrom
refactor/click-cli-and-demos
Jul 27, 2026
Merged

refactor: unify entry points into a Click CLI (grl-snam); tools/ + demos/ packages; consolidate onto pycvc_gl#20
transfix merged 2 commits into
mainfrom
refactor/click-cli-and-demos

Conversation

@transfix

Copy link
Copy Markdown
Contributor

One grl-snam CLI replaces the scattered scripts/ + examples/ entry points. Verified end-to-end: grl-snam pipeline <bundle> runs world model → SDF → train → HUD video (penetration=0) from nothing but terrain.json + buildings.glb.

The CLI

grl-snam {selftest, obstacles, build-sdf, train, capture drive|multigoal, pipeline, demo NAME, lab-demo, eval, train-coef, train-geo}

New clean, linted layer under grl_snam/

  • tools/obstacles, sdf, train, capture, pipeline: the scripts' logic as importable functions (lazy pycvc_gl/VTK imports → import-safe anywhere).
  • nav.py — ONE SdfNavigator (the nav loop was copy-pasted across 4 scripts) + select_reachable_goals; emits NavMetrics every step.
  • metrics.py — live read-out of the network's coefficients (α,β,γ), clearance, mode, penetration, progress. capture draws it as an on-frame HUD; the demos publish it to the state tree (grl_snam.metrics.*) — the hook for an in-app HUD panel.
  • demos/ — the volrover demos, in the package, with a runtime vrhost guard; grl-snam demo NAME runs them via volrover3 --run-job.

Consolidation (per direction)

  • Retired grl_snam_lab/ — a redundant fork of pycvc_gl (which supersets it: same Lab/terrain_mesh/ChaseCamera/VehiclePose/scenes); its analytic demo moved to grl_snam/demos/lab.py on pycvc_gl.
  • Removed examples/ (→ grl_snam/demos), the utility scripts (→ tools/), and dead/broken legacy scripts. Kept the referenced dataset generators + the research core.
  • Fixed sdf_nav.py packaging (it was omitted from the package — a real bug). Added click. Net −2,200 lines.
  • Kept eval_coef_energy/train_coef_energy/train_on_geometry (the CoefEnergyNet track, incl. the real-time HUD source) unified under the CLI.

Tests / CI

test_cli, test_nav (SdfNavigator + metrics on a synthetic field), test_lab (rewritten). black + ruff clean; 15 tests pass.

transfix added 2 commits July 27, 2026 00:04
…es; consolidate onto pycvc_gl

A single 'grl-snam' CLI replaces the scattered scripts/ + examples/ entry points and
the two ad-hoc console scripts. Verified end-to-end: 'grl-snam pipeline <bundle>' runs
world-model -> SDF -> train -> HUD video (penetration=0) from nothing but terrain.json
+ buildings.glb.

CLI (grl_snam/cli.py): selftest, obstacles, build-sdf, train, capture {drive,multigoal},
pipeline, demo <name>, lab-demo, eval, train-coef, train-geo.

New clean, linted package layer under grl_snam/ (research core stays at root):
- tools/{obstacles,sdf,train,capture,pipeline}.py — the scripts' logic as importable
  functions (lazy pycvc_gl/VTK imports; import-safe everywhere).
- nav.py — ONE SdfNavigator (replaces nav logic copy-pasted across 4 scripts) +
  select_reachable_goals; emits NavMetrics every step.
- metrics.py — NavMetrics/NavStats + hud_lines: a live read-out of the network's
  coefficients (a,b,g), clearance, mode, penetration, progress. capture draws it as an
  on-frame HUD; demos publish it to the state tree (grl_snam.metrics.*) — the HUD hook.
- demos/{austin_freedrive,austin_learned,austin_planner,austin_patrol,lab}.py — the
  volrover demos, in the package, with a runtime vrhost/pycvc guard; 'grl-snam demo NAME'
  runs them via 'volrover3 --run-job'.

Consolidation:
- Retired grl_snam_lab/ (a redundant fork of pycvc_gl, which supersets it); its analytic
  demo moved to grl_snam/demos/lab.py on pycvc_gl.
- Removed examples/ (moved to grl_snam/demos) + the utility scripts moved to tools/ +
  dead/broken legacy scripts (spline_dataset_maximin, large_scale_ex, working_spline_pathwise,
  check_dataset). Kept the referenced dataset generators + the research core.
- pyproject: add click; fix sdf_nav.py packaging (was omitted — a real bug); grl-snam
  entry point (+ selftest/lab-demo aliases). Net -2200 lines.
- Kept eval_coef_energy/train_coef_energy/train_on_geometry (CoefEnergyNet track) at
  root/scripts, unified under the CLI (eval/train-coef/train-geo) — the real-time HUD
  source for later.

Tests: test_cli (CLI wiring), test_nav (SdfNavigator + metrics on a synthetic field),
test_lab (rewritten for grl_snam.demos.lab). black + ruff clean; 15 tests pass.
@transfix
transfix merged commit cdba118 into main Jul 27, 2026
1 check passed
@transfix
transfix deleted the refactor/click-cli-and-demos branch July 27, 2026 05:14
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