Skip to content

Ariadne: grl-snam ariadne cars runs libcvc's multi-car template, with GRL-SNAM's policy as a baseline - #155

Merged
transfix merged 3 commits into
mainfrom
feat/ariadne-cars-template
Nov 7, 2026
Merged

transfix merged 3 commits into
mainfrom
feat/ariadne-cars-template

Conversation

@transfix

@transfix transfix commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Why

The lab's researchers want to test their own multi-car controllers on Ackermann cars in the 3-D sim, in Python. Joe asked for that to be general, not GRL-SNAM-specific. So the template lives in libcvc, as pycvc_gl.cars:

GRL-SNAM gets a thin entry to it, and its trained policy as one optional baseline.

What

  • The entry: grl-snam ariadne cars (or python -m grl_snam.ariadne cars) runs libcvc's template, and --copy DIR writes it out to edit. Every flag is the template's:

    • --vehicle (kinematic, humvee, roboracer, dynamic[:presets]);
    • --world (data, the Austin default; generated; flat);
    • --uri and --set key=value;
    • --controller navigator;
    • --headless --frames N --log run.npz.

    With a pycvc_gl before 3.7.12, the entry says what to install and exits 2.

  • --grl-policy: libcvc's navigator (GRL-SNAM's navigator, in C++) drives with the published grl-snam-weights policy. It is exported to .cvcnav and run in its trained frame (1 unit = 300 m, through the template's --nav-scale).

  • Removed: the first cut's grl_snam/cars.py and the template copy under grl_snam/ariadne/template/. They now live in libcvc.

  • Docs: the README (links, a CLI row, a short Ariadne section with the cvcpkg install line), the quickstart, PLANTS.md and grl_snam/ariadne/README.md describe the ports and the entry, and link to libcvc's docs/CARS.md for the template's guide.

Tests

tests/test_ariadne_cars.py has 5 tests:

  • the port is the entry;
  • the message without the template;
  • a headless run logs every tick and the settings;
  • --copy;
  • the navigator driving on GRL-SNAM's exported policy, in its frame.

Results:

Order

Merge after transfix/libcvc#1031 and #1035, and a libcvc release that carries them (pycvc-gl 3.7.12). Then a GRL-SNAM release puts the entry in grl-snam-cp31X. Until then, the entry tells you to update pycvc-gl.

…tic or Jolt physics

grl-snam ariadne cars runs N Ackermann cars that a controller of the user's own
drives: controller(s, p) at the top of a copyable cars.py gets every car's state
(pose, speed, wheel angle, goal, range rays, collisions, limits) as numpy arrays each
tick and returns (steer, accel) per car, bypassing the navigator. --copy DIR writes
cars.py and cars.ari to edit. The document's sliders feed the controller's parameters
(ctl.*), New goals / Reset call back into Python, and the panels show a row per car
and two plots. --headless --frames N --log run.npz|csv runs without GL and records
every tick's states and commands.

grl_snam.cars is the library under it: plants kinematic (nav's bicycle), jolt
(roboracer, humvee, or a comma list cycled over the cars) and dynamic; worlds flat,
blocks (scaled to the cars) and austin. With a pycvc that has nav_sim_world_override
(transfix/libcvc#1031) every plant runs in libcvc's sim_world with the command in its
navigator's place; with an older pycvc, kinematic runs the same bicycle in numpy and
jolt drives physics_world.drive (no reverse). navigator=True runs libcvc's navigator
as a baseline.

The README, the quickstart and PLANTS.md link the Ariadne ports and the template;
grl_snam/ariadne/README.md gains a 'Write your own multi-car controller' section:
the state, the panels, why the plant is the host's choice and not the document's,
what kinematic vs Jolt means for a controller (steering rate, the driver model, tire
slip, measured), and batch runs. tests/test_cars.py: 23 tests (3 need the override
binding and skip without it; none needs torch).
…s data store

--world austin drew the city with load_geometry_bundle, which paints the terrain one
colour, so the aerial image never showed. cars.ari now has the city node live.ari has
(source: data city, shown only on the Austin world), and cars.py loads Austin into the
data store at data.city: an installed bundle when there is one, else
scene-austin-south-small from cvcpkg.org, downloaded once and cached. The terrain is
drawn with satellite.png draped, and grl_snam.cars builds its occupancy and terrain
from the same loaded objects (austin_world(city=...)), so the bundle is read once.
A headless test runs the port on Austin when a bundle is installed.
…ator baseline

The template moved to libcvc as pycvc_gl.cars (transfix/libcvc#1035, on #1031's
bindings): general rather than GRL-SNAM specific, with the plant and the navigator's
settings in the document's state tree, Austin from the data: block by default, the
terrain generator as an alternative, rasters and coefficient panels, and the same
run headless. GRL-SNAM keeps a thin entry: grl-snam ariadne cars runs it (or --copy),
and --grl-policy gives libcvc's navigator the published grl-snam-weights policy,
exported to .cvcnav and run in its trained frame (--nav-scale). With a pycvc_gl
before 3.7.12 the entry says what to install.

grl_snam/cars.py and the template copy are gone. The README, the quickstart, PLANTS.md
and grl_snam/ariadne/README.md link to libcvc's docs/CARS.md.
tests/test_ariadne_cars.py: 5 tests (the entry, its message without the template, a
headless run, --copy, the navigator on GRL-SNAM's policy).
@transfix
transfix merged commit 0528a01 into main Nov 7, 2026
4 checks passed
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