Repository navigation
nav_native, squad: a physics plant option (libcvc P6) - #119
Merged
Merged
Conversation
With a pycvc carrying libcvc's P6 physics bindings, a native sim_world's
agents can drive cvc::physics vehicles on Jolt instead of nav's
kinematic bicycle:
- nav_native.JoltPlant: a physics world (flat ground; the truth grid's
occupied cells as static boxes, merged by obstacle_boxes) and a
nav_plant over its vehicles ("roboracer" by default, the size of
GRL-SNAM's 0.7 m bodies; "humvee"; or a pycvc.vehicle_desc), with
the vehicle state and energy ledger, the drift summary and
terrain_config_of.
- NativeSimWorld gains set_plant / plant_kind, the P5 terrain calls,
pull / publish (sim_world's settings in the state tree) and tick;
sim_world_from_swarm takes plant=.
- Squad(plant=...) runs the squad in the C++ sim_world, one private
belief plane per agent, on the plant ("jolt", a preset, a JoltPlant)
or nav's C++ bicycle ("kinematic"). It keeps step, run, done, the
records and SquadResult (now with energy_J), and moving goals and
FollowGoal. On a plant the navigator plans with the vehicle's limits
(0.8 x max_accel, a_lat_g g), not the trained metric's 2 g. A start
inside an occupied cell is refused there. The Python path stays the
default and stays kinematic.
On the city story (96 cells, two agents crossing): Python 583 ticks,
native kinematic 441, Jolt RoboRacers 842 with 3.3 and 3.7 kJ drawn;
all arrive with no penetration. tests/test_squad_plant.py (9) passes
against a local libcvc P6 pycvc and skips without it.
transfix
marked this pull request as ready for review
October 19, 2026 16:26
3 of 4 tasks
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.
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.
The GRL-SNAM part of libcvc's P6 (the vehicle physics roadmap): a physics plant option on the native path. A native
sim_world's agents drivecvc::physicsvehicles on Jolt instead of nav's kinematic bicycle, andSquad(plant=...)runs a squad that way.Draft until libcvc's P6 is released. It needs a pycvc carrying P6's physics bindings: transfix/libcvc
feat/pycvc-physics, which opens after P3–P5 merge. Until thennav_native.HAS_PLANTis False everywhere, the new tests skip, and nothing else changes.What it adds
nav_native.JoltPlant: a physics world plus anav_plantover its vehicles.ground_mu,rolling_resistance). The truth grid's occupied cells become static boxes, merged into rectangles byobstacle_boxes. A vehicle that leaves the plan meets the building it would have met."roboracer"(the default; the UT-AV lab's 1/10 car, the size of GRL-SNAM's 0.7 m bodies),"humvee", or apycvc.vehicle_desc.vehicle_state(i)(wheels, pedals and the energy ledger),energy_J(i),drift_summary()(the plant against nav's bicycle, binned by lateral g) andterrain_config_of.NativeSimWorldgains:set_plant/plant_kind;set_terrain,terrain_settings,infeasible_entries);pull/publish(sim_world's settings in the state tree);tick.sim_world_from_swarmtakesplant=.Squad(plant=...)runs the squad in libcvc's C++sim_world, one private belief plane per agent."jolt", a preset name, aJoltPlant, or"kinematic"(nav's C++ bicycle).step,run,done, the per-agent records andSquadResult, which gainsenergy_J. Moving goals andFollowGoalwork; the latter now readsSquad.position_of.vmaxand sensor overrides, material grids, and (on a plant) a start inside an occupied cell, where a physics vehicle would be wedged.Limits on a plant. GRL-SNAM's limits are in the trained metric:
a_lat_max1.0 normalized is about 2 g. On a plant the navigator plans with the vehicle's limits instead, never more than the story's:0.8 × max_accelanda_lat_gg (0.5 by default). Found while testing: with the trained metric's 2 g corner cap, a RoboRacer slid at 11–16× its tires' peak slip. It then sat nosed into a corner for 350 ticks.The Python path stays the default, and stays kinematic, since it is what trains.
Measured
City story, 96 cells, known map, two agents crossing (Windows, local libcvc P6 pycvc):
On the plant the agents drew 3.3 and 3.7 kJ from their batteries. A Humvee doesn't fit the city story's streets, as expected.
Tests
tests/test_squad_plant.py, 9 tests, all passing against the local build:mainon this box:imageiois not installed (5), and onemath.sinresult is a ULP off on Windows (1).black --checkandruff check .(ruff 0.16.0, from cvcpkg) are clean.