Repository navigation
Ariadne: every plant in a scene world: kinematic, dynamic and dynamic4w beside jolt - #1235
Merged
Merged
Conversation
…orld vehicle
A world entity takes an intent from outside its navigator: a wanted steer and
acceleration that replaces or blends with its controller's command, an external
planar force on its drive (cvc::nav::ext_force), or both. The new external
controller is driven by its intent alone.
- Keys entities.<id>.intent.{mode,steer,accel,weight} and .force.{x,y,steer},
read at each navigator tick; world: vehicles: intents: names a second table
(a relay's published namespace) read by id or name.
- WorldVehicles::set_intent / clear_intent / intent, callable from any thread.
- sim_world::override_command takes a blend weight on a plant.
- pycvc.WorldEntities (AriApp.entities(), pycvc.world_entities over a GL
host's runtime capsule, pycvc.ari.Host.entities): list, spawn, despawn and
set intents. AppRuntime::running_world finds an adapter's world too.
- entities.<id>.command.{steer,accel,by} publish what the plant took.
…4w beside jolt A scene world runs each vehicle plant in its one physics world, on its clock, against its buildings, with libcvc's existing plants: - WorldVehicles keeps a fleet (a sim_world and its plant) per plant kind on the world's grid and tick; kinematic entities get a kinematic box. - dyn_bike_plant / dyn_4w_plant: step_world = false lets a host step the world, with before_world_step / after_world_step around each step (advance() split at its world step; a hosted run is bit for bit the plant's own); add_desc; world_gone for a world rebuilt in place. - The plants' ground is the grid bilinear, not its nearest sample (the four-wheel model's grade force stalled on the old steps). - plant: dynamic:<preset> / dynamic4w:<preset>. - physics.stats.vehicles names each plant; WorldVehicles::wheels and cvcGL's pose_vehicle_wheels pose a box look's wheels where the plant has them.
transfix
enabled auto-merge (squash)
November 14, 2026 19:32
…world-plants # Conflicts: # bindings/pycvc/pycvc_ariadne.i # bindings/pycvc/test_pycvc_world_entities.py # docs/ARIADNE.md # docs/roadmap/ARIADNE_WORLDS.md # inc/cvc/ariadne/world_vehicles.h # src/cvc/ariadne/world_vehicles.cpp # src/cvc/tests/ariadne_scene_world_test.cpp # src/cvcGL/test/cvcgl_ariadne_physics.cpp
transfix
added a commit
that referenced
this pull request
Nov 15, 2026
Master's #1235 runs every plant in a scene world's one physics world (fleets per plant; dynamic chassis boxes and kinematic boxes as bodies there; wheel poses). The gym's own plant groups (the dynamic models in a world of their own, the bicycle with no body, the markers that drew it) give way to it. Kept from L4 on master's fleets: a spawn's own plant (entity_spec::plant, vehicles.spawn.plant), the gym's API (reseed, set_wander, command, set_goal, tick_seconds, steps_per_tick, grid) and its per-tick command, the velocity, steer, goal and reach in entity_info, contacts counted from the world's events (a kinematic box's obstacles by its grid footprint, two kinematic boxes by overlap), the terrain's own heights under the vehicles, and world_reset with the new ground bodies.
transfix
added a commit
that referenced
this pull request
Nov 16, 2026
…#1253, #1255, #1256, #1264, #1268, #1271, #1273, #1277) - ci.yml: the sanitizer list keeps this branch's tests (stream_test, net_ws_client_test, ariadne_host_test) and master's segmentation_intrinsics_test. - STATE_EXEC_THREADED.md: the room-call verbs (room-run is #1273's) and #1252's segment.seeded provider in the provider table, both registered without a kind. room-call's async functions stay on the app's host: a reply settles on the relay client's reader thread through host.finish, so moving them to *ictx.host needs a finisher first.
transfix
added a commit
that referenced
this pull request
Nov 22, 2026
…#1449) * Fleets: placing and removing vehicles is linear; fleet lookups build no strings Loading a fleet took about twice as long as at FL1a: 88 ms for 800 kinematic vehicles, 500 for 2000. Two causes: - Placing a kinematic vehicle recomputed its fleet's per-vehicle kinematics (kinematics()), which walks every entity with two fleet lookups each. So n vehicles took n^2 lookups (since #1235). Removing one did the same, so teardown, a restart or reseed, and a navigator rebuilt were quadratic too. - FL1b (#1403) gave a named fleet its own navigator, keyed "<plant>/<fleet>", and fleet_of() built that key on every call, which doubled each lookup. The fix: - A fleet's kinematics are marked stale when a vehicle comes or goes, and made once before its navigator next steps. Only the step reads them. - The fleets are searched by the key's parts (nav_ref, through a transparent comparator), so fleet_of() builds no string. FleetBench's [fleet doc] rows also time a reseed, with the tick after it. Medians of three runs, alternating with the code before the fix: - load, 800 vehicles: 105 to 117 ms before, 20 now; - load, 2000 vehicles: 640 to 755 ms before, 40 now; - reseed with summary keys: 228 to 28 ms at 800, 1.6 s to 118 ms at 2000. Ticks didn't change beyond the noise. The roadmap's §3.1 has the numbers. * Fleets: a step without contacts looks no vehicle up; a summary fleet's stats are one line At 2000 kinematic vehicles with summary keys a tick took 23 % longer than at FL1a (43.9 ms against 35.6), more than the seventh physics step (OW1's 120 Hz) accounts for. Timing each phase, with FL1a's code and this branch's run alternately, it was 35.5 against 40.5 ms: 14 %, the rest a busier day. Of the 5.0 ms: - A step is more than its physics: it also counts the step's contacts and moves the kinematic boxes, at 2000 vehicles about half the physics again. At FL1a's costs a step, the seventh is 2.3 ms. - count_contacts() looked up every vehicle (a map of their chassis) before it read the step's contacts, and its lookups cost more since FL1b: 0.52 ms a step at FL1a, 0.69 now. A kinematic fleet's boxes meet nothing, so there were none to count. - The navigator's tick took 0.9 ms more (the same lookups in its loops), and FL1d's pose snapshot 0.25. The fixes: - A step with no contacts that count looks nothing up. - physics.stats.vehicles gives a summary fleet's quiet vehicles one line, as entities.summary does, not a line each built from info() every tick (3.3 ms at 2000 vehicles). Alternating with the code before: 31.8 ms a tick at 2000 vehicles (40.5 before) and 9.5 at 800 (12.4), under FL1a's 35.5 and 10.9 with the seventh step. The roadmap's 3.1 has the numbers.
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.
A scene world now runs every vehicle plant, not only
jolt. Before this,WorldVehicles::spawnrefusedkinematic,dynamicanddynamic4w("the dynamic plants step a world of their own", ARIADNE_WORLDS.md §14). This PR runs them in the scene's one physics world, on its clock, against its buildings, using libcvc's existing plants. It is the new L2b row in ARIADNE_WORLDS.md.Stacked on #1233 (entity intents). Until that merges, this diff includes its commit. I'll rebase onto master once #1233 is in.
The plants
plant:joltnav_plant, as beforedynamic(dynamic:<preset>)dyn_bike_plantdynamic4w(dynamic4w:<preset>)dyn_4w_plantdynamic'skinematicOne fleet per plant. A
sim_worlddrives a single plant, soWorldVehicleskeeps a navigator and plant per plant kind, made when the first entity on it is placed. All fleets share one grid and one tick, and every body is in the same world, so they meet each other.The dynamic plants on a host's clock.
dyn_bike_plant_options::step_worldanddyn_4w_plant_options::step_world(defaulttrue, unchanged) can be turned off:before_world_step()/after_world_step()around each step, one substep each;advance()then ends the tick those steps ran and begins the next.To do that,
advance()was split, mechanically, at its world step. New tests show that a hosted plant runs bit for bit as one stepping its own world, into a wall and with wheel spin. Compliant contact (contact) steps in pieces of its own, so it can't be hosted, and the constructor refuses that combination.Also added to the plants:
add_descon both dyn plants, asnav_planthas;world_gone().SceneWorld::restartrebuilds the world in place and re-adds the scene's bodies under the same ids. Without this, the old plant's destructor would have removed scene bodies (the crate, the wall) through the old box ids. A test pins it.A smooth ground.
WorldVehiclesnow gives every plant the grid bilinear between its corner samples, where it used to give the nearest sample.dyn_4w_planttakes the slope under each wheel from differences about 3 mm apart, so the old stepped ground stopped a Humvee dead at the first cell edge on a hill. That is how I found it.dynamic:<preset>/dynamic4w:<preset>inplant:name the vehicle, as plant_host's names do. A differentvehicle:preset is an error.What you see
physics.stats.vehiclesnames each line's plant. The dynamic plants report their books' power and energy, an odometer, and throttle and brake as shares of the command.WorldVehicles::wheels(id)gives each wheel in the chassis box's frame:pose_vehicle_wheelsposes a box look's four wheels from that every frame, throughsetPoseMatrix(change-detected, published, no vertex rewrite). A mesh look keeps its own wheels.WorldEntities.list()gainsplant.Tests
Linux Release, GCC 13, Jolt:
ariadne_scene_world_test, three new tests:The kinematic walker in
SpawnsAndRemovesFromTheKeysnow spawns.cvcgl_ariadne_physics,test_every_plant_headless_and_drawn: all four plants reach the samestate_hashheadless and drawn, and the drawn four-wheeler's wheel node sits where its plant has it.physics_dyn_bike_plant_testandphysics_dyn_4w_plant_test:AHostThatStepsTheWorldRunsItTheSame(bit for bit), plus their existing tests.pycvc_world_entities: a dynamic4w spawned and driven from Python.A full build, then the related ctest set (
[Aa]riadne|[Nn]av|pycvc_world|pycvc_ari|pycvc_plant|cvcgl_ariadne|SceneWorld|[Pp]hysics|[Pp]lant|[Ww]orld[Rr]ules|arisrv|arigl): 1,211 of 1,213 passed. The other two areariadne_runtime_test, which does not compile on master since No singletons: libcvc's process-wide state per app, per object or gone [4.0, breaking] #1203; Build again after #1203: cmd_trace and the rich-text tests take their app #1225 fixes it.The writable-data scan adds nothing. clang-format 18 is clean on changed lines.
Docs
Overlap: #1170 (the gym) adds the same
add_descand its ownWorldVehicles::after_step. Whichever merges second takes the other's.