refactor: unify entry points into a Click CLI (grl-snam); tools/ + demos/ packages; consolidate onto pycvc_gl - #20
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One
grl-snamCLI replaces the scatteredscripts/+examples/entry points. Verified end-to-end:grl-snam pipeline <bundle>runs world model → SDF → train → HUD video (penetration=0) from nothing butterrain.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 (lazypycvc_gl/VTK imports → import-safe anywhere).nav.py— ONESdfNavigator(the nav loop was copy-pasted across 4 scripts) +select_reachable_goals; emitsNavMetricsevery step.metrics.py— live read-out of the network's coefficients (α,β,γ), clearance, mode, penetration, progress.capturedraws 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 runtimevrhostguard;grl-snam demo NAMEruns them viavolrover3 --run-job.Consolidation (per direction)
grl_snam_lab/— a redundant fork ofpycvc_gl(which supersets it: sameLab/terrain_mesh/ChaseCamera/VehiclePose/scenes); its analytic demo moved togrl_snam/demos/lab.pyonpycvc_gl.examples/(→grl_snam/demos), the utility scripts (→tools/), and dead/broken legacy scripts. Kept the referenced dataset generators + the research core.sdf_nav.pypackaging (it was omitted from the package — a real bug). Addedclick. Net −2,200 lines.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.