Repository navigation
pycvc_gl.cars: the template's panels and run pieces for other hosts; Humvees drawn as Humvees - #1040
Merged
Merged
Conversation
…mmands on any plant sim_world::override_command takes a caller's (steer, accel) for one step in the navigator's place, on nav's bicycle and on a plant (Jolt's nav_plant, the dynamic vehicle). pycvc had no way to reach it, so a Python controller could not drive the agents itself. nav_sim_world_override(sim, steer, accel) takes (N,) arrays (NaN leaves that agent to the navigator) and returns how many took a command. nav_sim_world_set_pose(sim, i, x, y, heading, speed=0) binds sim_world::set_pose, so agents can start at chosen headings before a plant attaches at their poses. test_pycvc_nav_override.py checks the overridden bicycle against libcvc's kinematic_step in numpy to float precision, NaN pass-through, one-step scope, the lock and top-speed holds, malformed arrays, set_pose, and a Jolt Humvee attached at a set pose driving straight then turning left on a positive steer.
pycvc.plant_host binds cvc::physics::plant_host: the plant a sim_world drives on, chosen by name (kinematic, humvee, roboracer, a comma list, dynamic[:presets], dynamic4w[:presets]), in code (use) or live from the state tree (pull reads <prefix>.nav_plant.vehicle and the plant's own knobs). set_geometry takes a world_geometry (a city bundle's data_world, a generated world) as the colliders and starts the vehicles on its terrain (plant_host_options' ground_height, which nothing set before, so vehicles spawned at ground_z under a city's relief). kind, driving, limits, state, vehicle_state and body read the active plant. The host holds the sim_world it drives and puts it back on the bicycle before it goes. pycvc.generate_world binds cvc::world::generate_world on a dict of its params (the generated_world node's world.* key names or the struct's) and an optional building library: world() for physics and nav, terrain(), height(), info(). It is a pure function of its params, so Python gets the scene node's world from the same keys. test_pycvc_plant_host.py: 24 checks (generator determinism and errors; the presets; Jolt Humvees and their limits; a Humvee started on a generated world's terrain and driven by an override; a live switch from the state tree to RoboRacers, an unknown name ignored, back to the bicycle and on to the dynamic plant; both lifetimes).
…iadne document python -m pycvc_gl.cars --copy DIR writes cars.py and cars.ari: controller(s, p) gets every car's state as numpy arrays each tick and returns (steer, accel) per car, which each car's plant takes in the navigator's place (nav_sim_world_override). - The world: the document's data: block (scene-austin-south-small from cvcpkg.org by default; Run's URI or --uri loads another package or a local bundle), libcvc's terrain generator (the World window's world.* keys, Regenerate; Python generates the world for the cars, the navigator and the physics, the scene's generated_world node draws the same one), or a flat square. Each gives the same occupancy, terrain height and collision geometry. - The plant: nav_plant.vehicle (plant_host): kinematic, humvee, roboracer, a comma list, dynamic[:presets], dynamic4w; it switches live, the cars keeping their poses. - Settings: libcvc's own keys (nav.*, nav.vehicle.*, nav_plant.*), set in init:, bound to sliders, --set / --params, or from Python; settings() lists them with their units and ranges. - Panels: readouts, a row per car, speed and gap plots, four coefficient plots (the controller's info or the navigator's telemetry: alpha, beta, gamma, ...), and rasters around the chosen car (signed distance with the predicted path, the controller's cost or the navigator's belief). - Headless: --headless --frames N --log run.npz (states, commands, coefficients, rasters, predicted paths, and the world, seed and every setting in meta); exit 1 when the controller raises, 3 when --min-arrivals is unmet. - Navigator baseline: --controller navigator, and --nav-weights for a .cvcnav policy. pycvc_gl now ships *.ari files beside its modules. docs/CARS.md describes it (the settings table generated from the keys' own metadata), linked from README.md, ARIADNE.md 9.3 and the pycvc README. test_pycvc_gl_cars.py: 39 checks, headless.
A policy is trained in a normalized frame (GRL-SNAM's published one at 1 unit = 300 m); Cars(scale=...) and --nav-scale build the sim_world in it, so --nav-weights drives in the frame it expects. The default stays nav's 0.05. The log's meta records it.
# Conflicts: # bindings/pycvc/README.md
…Humvees drawn as Humvees The panels become units in cars_panels.ari (cars_settings, cars_world, cars_world_choice, cars_coefficients, cars_rasters), which cars.ari imports by cvc:// with COMPONENTS on the host's component path. The run's pieces become functions: add_args and apply_settings (the world, --set, --params and log flags), state_from (a CarsState from a host's own arrays), raster_arrays (a belief may be a probability), raster_pictures and plot_coefficients, save_log and exit_code; make_world takes cell=. Cars takes starts= and goals=. The scene draws each Humvee (and nav's bicycle, Humvee-sized) with the Humvee's glTF model from the city's package (the Austin package carries Humvee.glb) or an installed vehicle-humvee, with a tag in the car's colour; a RoboRacer stays a box its size. docs/CARS.md, "Your own host"; test_pycvc_gl_cars 39 -> 52 checks.
…pieces # Conflicts: # bindings/pycvc/pymod_gl/cars.ari # bindings/pycvc/pymod_gl/cars.py # bindings/pycvc/test_pycvc_gl_cars.py # docs/CARS.md
transfix
added a commit
that referenced
this pull request
Nov 7, 2026
Bumps the project version and every recipe's upstream_version from 3.7.11 to 3.7.12. The v3.7.12 tag on this commit is the first release with the multi-car controller template (pycvc_gl.cars, #1031 #1035 #1040), the hidden-subtree fix in cvcGL (#1037), the discrete-gradient dyn_bike step (#978), semi-implicit Euler by default in the nav rollout (#981), the implicit contact damper (#1004, #1038), and generated_world's roads and water (#1032, #1034).
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.
Why
GRL-SNAM's Ariadne ports (
fleet,live) now take the multi-car template's settings, worlds, plants, panels and headless log (#1035). They reuse the template's pieces rather than copying them, so this makes those pieces importable.Joe also asked why the template drew boxes rather than the Humvee model. The Austin package it loads carries
Humvee.glb, so the template now draws with it.What
The panels become units in
pymod_gl/cars_panels.ari, whichcars.ariimports bycvc://cars_panels.ari:cars_settings(window): the navigator, vehicle and plant knobs;cars_world(window): the generator's parameters;cars_world_choice(group): the World combo, the city's URI and Load;cars_coefficients(group): the four coefficient plots;cars_rasters(window): the two pictures; argcostis the second one's caption.pycvc_gl.cars.COMPONENTSis the directory a host passes as a component path.run()passes it, and so do GRL-SNAM's ports.The run's pieces become functions:
add_args(parser):--world,--uri,--data-path,--set,--params,--log,--raster-every,--min-arrivals;apply_settings(host, args, flags):--params, then--set, thenflags, then--world; then--uripointsdata.citythere;state_from(world, x, y, heading, speed, goal, ...): aCarsStatefor cars a host steps some other way, with the ranges and contacts worked out on the world, soCarsLog, the pictures and the panels take them;raster_arrays(...), where a belief may now be a probability (an agent that has not seen everything), andraster_pictures(...);plot_coefficients(...),chosen(host, n),raster_size(host, length);save_log(log, host, path, **meta): every setting and theworld.*keys in its meta;exit_code(code, error=, arrivals=, min_arrivals=): 0, 1 or 3.make_worldtakescell=, andCarstakesstarts=andgoals=.run()is built from these pieces and behaves as before.Humvees are drawn as Humvees:
vehicle-humvee's, else the Austin package's: from the city, or, with another world in use, asked for once asdata.vehicles(from the data cache after the first download).Docs.
docs/CARS.mdgets a new section, "Your own host", and a note on the scene. Its known-limits note onvisible:now says cvcGL: a hidden scene node hides its whole subtree, and generated_world's parts follow it #1037 fixed it;show_world()'s workaround stays and is harmless.Tests
test_pycvc_gl_carsgoes from 39 to 52 checks. The new ones:cars.ariloads with its panels fromcars_panels.ari(no import or unit warnings);state_from, andCarsLogtaking it;raster_arrays(a probability belief stays one) andraster_pictures;plot_coefficients;Cars(starts, goals);add_argswithapply_settings(--setover--params);save_log's meta andexit_code.data.vehiclesin 0.4 s from the cache.fleetandliverun on these pieces; their port tests (27, plus the nav and squad suites) pass against this branch.GRL-SNAM's branch
feat/ariadne-ports-settingsneeds this and #1035 (merged) in a release (3.7.12).