Skip to content

capture on a vehicle plant (kinematic, dynamic, Jolt), the plant in every demo, training through Jolt - #143

Merged
transfix merged 1 commit into
mainfrom
feat/capture-plant-choice
Nov 2, 2026
Merged

transfix merged 1 commit into
mainfrom
feat/capture-plant-choice

Conversation

@transfix

@transfix transfix commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

What

grl-snam capture can now drive on a vehicle plant, every demo either takes one or is documented as not yet, and GRL-SNAM can train through Jolt.

1. A plant choice in grl-snam capture drive|multigoal

--plant takes four values:

The other new options are --vehicle humvee|roboracer, --mu, --routes (libcvc's vehicle routes), --fog (the map starts unknown), --weights x.cvcnav, --reach-m, --speed and --caption. drive also gets --cam.

On a plant:

  • The whole run is kept, failures included. It plays by the clock, with a trail and the vehicle's own heading and chassis size.
  • The HUD adds three lines:
    • the plant and its grip;
    • the sideslip, the tire use (libcvc's combined slip over the peak) and the lateral g, flagged [PAST PEAK], [SPIN] and [CONTACT];
    • the energy in kJ: Jolt's ledger (source, tire, brake, aero), or the dynamic plant's port-Hamiltonian books (drive, brake, dissipated, KE, contact).
  • <out>.json records how each leg ended, plus the sim_world's nav_stats.

2. The plant in the other demos and benches

Entry point On a plant
grl-snam pipeline --plant, --vehicle, --mu (the video)
grl-snam finale --plant, plus --max-steps for a short run
record_squad, record_convoy, record_pursuit_v2 plant= (the pursuit needs runner_vmax_scale=1.0: the native world has one top speed)
squad_bench, drive_bench --plant
sim_world_from_swarm takes a plant name and clamps the navigator to the vehicle's limits, as Squad does

Also:

  • record_squad reads the native runtime's own state for clearance, goal and arrival, and records no false sensing ticks.
  • Squad gains goal_of and reached_of. Its native records now measure a moving goal where it is.

Not on a plant, with the reason in docs/PLANTS.md:

  • fog: scripted events and movers, and a recorder that reads the Python belief. capture --fog is the single-vehicle fog run on a plant.
  • material-demo: Squad(plant=...) refuses material grids.
  • swarm_bench and belief_bench: they measure the torch Swarm's sensing.

3. Training through Jolt

  • grl-snam coef-train --backend native --rollout jolt [--vehicle humvee] [--w-energy W].
  • nav_native.train_coef_mlp_jolt(...): keywords; the vehicle's wheelbase and limits by default; returns the calibration.
  • train_coef_mlp(rollout="jolt").
  • capture --weights drives the result on the plant.

Fixes found on the way

  • terrain_grid is gone. capture, build-sdf and obstacles imported terrain_grid from pycvc_gl.scenes, which libcvc #670 retired. They now read the bundle's bounds from terrain.json (tools.sdf.terrain_bounds). The live austin_* demos still import it; that is a follow-up.
  • Frame cleanup on Windows. render_drive emptied its frames with rm through os.system, which does nothing on Windows: a shorter clip after a longer one would carry the longer one's tail. All videos also shared one frames directory. Each video now gets its own, emptied with os.remove.

Verified

Every command in docs/PLANTS.md was run in a short run, on Windows, against a pycvc built from transfix/libcvc#979's branch:

  • build-sdf;
  • capture drive on Jolt (also with --routes --fog, and with --weights), and capture multigoal on the dynamic plant;
  • pipeline --plant jolt;
  • coef-train --rollout jolt, and train_coef_mlp_jolt on Austin;
  • the squad on all three plants, which both arrive on the city story with no penetration, and the convoy and the pursuit on Jolt Humvees;
  • finale --plant jolt:humvee;
  • squad_bench --plant jolt (7.5 Hz with 4 agents) and drive_bench --plant dynamic (43 ms/tick at N=8).

The finale recorded both acts. Its render step needs pycvc_gl's Lab, which this box lacks, so the render was not run here. VTK came from cvcpkg's vtk-python-cp311. pycvc_gl.scenes was libcvc's pure-Python module on the path.

Tests:

  • tests/test_plant_capture.py: 11 passed with the bindings. The pycvc-gated ones skip without them.
  • The full suite: 693 passed, 19 skipped, 7 failed. All 7 are environmental:
    • 5 test_material_raster failures: no imageio here.
    • The known last-bit math.sin equality in test_material_gate_sim.
    • test_lab: it ran because pycvc_gl was importable through the scenes module, and pycvc_gl.lab is absent.
  • ruff and black 26.5.1 (CI's) are clean.

What the plants show (Austin, the shipped coef_sdf.pt)

24 random routes of 120-400 m between open streets, Humvees, arrival within 15 m:

Runtime Arrived
point surrogate 3 / 24
kinematic bicycle 3 / 24
dynamic, mu 0.9 0 / 24
Jolt, mu 0.9 0 / 24
Jolt with vehicle routes 0 / 24

The checkpoint's frame is 300 m per unit, with a 240 m arrival radius. Three things go wrong:

  • The bicycle dead-ends where the point mass slides past.
  • The Humvees orbit: the wall-follow carrot sits inside their turning circle.
  • On grip 0.3 they slide past the peak and spin out (about 90 degrees of sideslip), because nav corners at 0.5 g whatever the grip. With the map unknown on ice, one hits a wall.

The failure reel shows these. It is not uploaded or linked yet: it waits on Joe's OK.

Needs a pycvc release carrying transfix/libcvc#979 before --plant dynamic works from a catalog install. Until then, nav_native.HAS_DYN_PLANT is False and the dynamic plant raises a clear error.

…very demo, training through Jolt

grl-snam capture drive|multigoal --plant point|kinematic|dynamic|jolt: point is
today's Python surrogate; the others drive the same policy on libcvc's
sim_world (plant_nav.PlantNavigator) on nav's bicycle, the dynamic single track
(nav_native.DynamicPlant over pycvc.dyn_bike_plant, transfix/libcvc#979) or a
Jolt vehicle, with --vehicle, --mu, --routes, --fog, --weights and --reach-m.
On a plant the run is kept whole and played by the clock with a trail, the HUD
adds the sideslip, tire use, lateral g and energy books, and <out>.json records
how each leg ended. --caption draws a line along the bottom.

The plant elsewhere: pipeline --plant; finale --plant and --max-steps;
record_squad / record_convoy / record_pursuit_v2 plant=; squad_bench and
drive_bench --plant; sim_world_from_swarm takes a plant name and clamps the
navigator to the vehicle's limits. Squad gains goal_of / reached_of, and its
native records measure the distance to a moving goal where it is.

Training through Jolt: coef-train --backend native --rollout jolt (--vehicle,
--w-energy), nav_native.train_coef_mlp_jolt (keywords, the vehicle's own
wheelbase and limits by default) and train_coef_mlp(rollout="jolt").

Fixes: capture, build-sdf and obstacles read the bundle's bounds from
terrain.json (pycvc_gl.scenes retired terrain_grid, libcvc #670); render_drive
emptied its frames with `rm` through os.system, which did nothing on Windows,
and shared one frames directory between videos.

docs/PLANTS.md runs every demo and bench on a plant and trains through Jolt;
every command in it was run. tests/test_plant_capture.py covers the CLI, the
names, the HUD, the run summary, and with the bindings each plant, low grip,
a squad on the dynamic plant and record_squad on Jolt.
@transfix
transfix merged commit 2cf3230 into main Nov 2, 2026
4 checks passed
transfix added a commit that referenced this pull request Nov 3, 2026
fleet offers torch, jolt:humvee, dynamic:humvee (when pycvc has dyn_bike_plant) and kinematic; squad --plant records on libcvc's sim_world and that plant. grl-snam ariadne <port> passes its args to python -m grl_snam.ariadne, as coef-train does.
transfix added a commit that referenced this pull request Nov 3, 2026
The Austin demos take their bounds from grl_snam.tools.sdf.terrain_bounds,
which #143 added for capture.py, so demos._common.bundle_bounds goes.
transfix added a commit that referenced this pull request Nov 3, 2026
…ts (#147)

* grl_snam.ariadne: GRL-SNAM's demos as Python hosts of Ariadne documents

Five ports, run with python -m grl_snam.ariadne <port>: live (the Austin demos in grl_snam.demos, unchanged, through an Ariadne demo host, with a Humvee for the box), fog (the six fog stories, recorded then replayed with fog_scene), squad (the finale acts, convoy and pursuit recordings replayed on Austin with true-scale Humvees), fleet (a live Squad on Austin on the torch, Jolt-Humvee or kinematic runtime) and material (the material demo's two stories as async functions, drawn with numpy). The documents hold the panels, the transport and a soft afternoon look.

The Austin demos no longer import pycvc_gl.scenes.terrain_grid, which libcvc retired: demos._common.bundle_bounds / bundle_occupancy (libcvc's C++ rasterizer when pycvc has nav_world_rasterize, else the VTK render) serve them and tools.austin.occupancy. material_demo's runs are split from its matplotlib render; fog_scene._hide_chrome skips nodes that are not geometry.

* grl_snam.ariadne: the plants (#143) and a grl-snam ariadne command

fleet offers torch, jolt:humvee, dynamic:humvee (when pycvc has dyn_bike_plant) and kinematic; squad --plant records on libcvc's sim_world and that plant. grl-snam ariadne <port> passes its args to python -m grl_snam.ariadne, as coef-train does.

* demos: the Austin bounds from tools.sdf.terrain_bounds (#143)

The Austin demos take their bounds from grl_snam.tools.sdf.terrain_bounds,
which #143 added for capture.py, so demos._common.bundle_bounds goes.
transfix added a commit that referenced this pull request Nov 7, 2026
* release: 0.3.0

95 commits since v0.2.1 (PRs #66 to #158), with new features, so the
pre-1.0 minor version goes up. The main changes:

- Ariadne hosts: GRL-SNAM's demos run as Python hosts of Ariadne documents
  (#147, #149, #153). `grl-snam ariadne cars` runs libcvc's multi-car
  template (#155), and fleet and live take its settings, worlds, plants,
  panels and log (#157). These need pycvc-gl 3.7.12.
- Vehicle plants: capture, the demos, the fog-of-war stories and training
  run on kinematic, dynamic and Jolt plants (#119, #130, #143, #145, #154).
- Torch twins of libcvc, held to its goldens: the material rollout (#118),
  terrain (#120), dyn_bike and dyn4 (#121, #123, #134-#136), the external
  force (#122, #124), the material trainer (#125), belief material
  (#128, #129, #131), U_nav (#133), and the port-Hamiltonian form, its
  energy books, wheel spin and compliant contact (#138, #139, #146).
- The vehicle-plant port-Hamiltonian whitepaper (#137 to #158).
- Training and evaluation: the base scorecard and selection (#82-#98),
  `grl-snam coef-train` (#102), the learned lam head and .cvcnav v2
  (#94, #105), and the 2026-10 audit fixes (#113).
- Data: grl-snam-weights, plus the Austin scene and Humvee as runtime
  dependencies, so `grl-snam demo` runs from a bare install (#72-#77).
- The research core moves under grl_snam/ (#103). The world clock is
  shared with libcvc's (#116, #117).

The version lives in pyproject.toml. The three cvcpkg columns mirror it in
upstream_version and in the package.files dist-info path. cvc_revision goes
back to 1 for the new upstream version. The publish job asks the server for
the next revision in any case.

* material_train_native: pass semi_implicit=False explicitly (libcvc #981)

libcvc #981 (in 3.7.12) changed nav_material_trainer_create's
ms_semi_implicit default from 0 to 1. MaterialTrainer left the L_multi
sampling args out for the legacy single start, so on pycvc-gl 3.7.12
semi_implicit=False quietly ran semi-implicit Euler. #159's CI was the
first run on 3.7.12, and four tests failed on cp311, cp312 and cp313:

- test_sampled_multi_start_args: "semi_implicit did not reach the
  rollout", because the default and semi_implicit=True were now the same
  rollout;
- test_live_native_trainer_agrees[legacy] and [legacy+ext], and
  test_live_native_trainer_agrees_on_the_belief_net[surrogate]: the
  explicit torch trainer and the native one differed by 1.3e-3 to 1.5e-3
  (tolerance 1e-5).

Now a binding that takes the args always gets them, so the integrator is
the one asked for on any pycvc. An older binding still gets the legacy
start through the old signature. GRL-SNAM's default stays explicit Euler.

tests/test_material_train_native_args.py checks both bindings. Its new
case fails without this change.
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