Repository navigation
physics: the dynamic plants drive the terrain and collide in a Jolt world; dyn_4w as a live plant - #869
Merged
Conversation
…orld; dyn_4w as a live plant
The dynamic plants were flat and collided with nothing: dyn_bike_plant ran dyn_plant with
grade 0, no physics world, and the four-wheel model (dyn4_plant, P8d) had no live plant at all.
The ground. Both plants now read nav_plant_options::ground_height (else ground_z), the same
function an application spawns Jolt vehicles on. dyn_bike_plant takes the sine of the slope along
its heading under the centre of gravity (over a wheelbase) into dyn_plant's grade, and its books
gain the grade line. dyn_4w_plant puts each corner's spring on the ground under its wheel, with
dyn4_params::grade_force on, and starts each vehicle at rest on the ground, its heave, roll and
pitch fitted to the four wheels.
The world. With options.physics each vehicle's chassis box (vehicle_desc::half_extents) is a
dynamic body in that world, at the model's ride height and attitude (dyn_world.h, internal). Every
substep the box is set at the pose the substep starts from, moving as the model moved, and the
world takes one step; a box that touched a body that is not the ground (a building, another
vehicle, a prop) takes the world's pose and twist back into its model (heave, roll and pitch stay
the model's) and the energy that changed is booked on a new contact line. A box that touched
nothing leaves the model's step alone, bit for bit. The substep is then the world's fixed_dt, and
the plant sets the world's contact reporting to all (a chassis pressed against a wall stays in
contact).
dyn_4w_plant (new, inc/cvc/physics/dyn_4w_plant.h): the four-wheel model as a vehicle_plant,
parameters from nav_plant::dyn4_si_of, books per vehicle:
stored now = stored at attach + drive - brake - dissipated + lever + grade + ground + limiter
+ contact + residual
plant_host: "dynamic4w" / "dynamic4w:<presets>" select it (is_dynamic4w, dynamic4w()). With Jolt
in the build both dynamic plants get a world built as the Jolt presets' is (the geometry given
with set_geometry, or the flat ground), whose terrain bodies are the ground; physics() returns it.
Without Jolt they drive the same ground and collide with nothing.
Tests (MSVC 19.44 Release):
- physics_dyn_bike_plant_test 6/6. Up a 5% ramp the single track is 2.864 m/s slower than on the
flat after 6 s (g sin(slope) t = 2.938), and its grade line is -19.86 kJ against m g dz =
-19.92 kJ. Into a wall 30 m ahead the nose stops at 30.000 m (663 colliding substeps, contact
-126.9 kJ); with no world it reaches 132.8 m.
- physics_dyn_4w_plant_test 5/5. It steps as dyn4_plant does, bit for bit, and its books close
(residual 2.0e-5 of the flow on a 30 s weave). Up the ramp it loses 3.183 m/s against
g s t = 2.942, the excess being the skyhook dampers' c zdot^2 on a steady climb; without the
grade force it climbs for free. Its nose stops at the wall at 29.999 m.
- ctest of the physics, plant, plant_log and sim_world suites: 204/204 pass (4 skipped, as on
master).
transfix
enabled auto-merge (squash)
October 28, 2026 19:54
transfix
added a commit
that referenced
this pull request
Oct 28, 2026
The project version and the cvcpkg recipe family move to 3.7.2. Every recipe is at cvc_revision 1 already, so none restarts. 3.7.2 carries the dynamic plants on the terrain and in a Jolt world, and the four-wheel plant (#869): --plant dynamic and dynamic4w drive the ground, collide with the buildings and each other, and book the collisions. It also carries dyn_4w's port-Hamiltonian form (#850), dyn_bike's wheel-frame front slip (#852), the books goldens for GRL-SNAM's twins (#848, #849), pycvc's drive telemetry (#857) and keep-alives (#864), the macOS SDK's openssl (#846), and the state_exec scheduler and evaluator work (#842, #843, #844, #861, #863).
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 dynamic plants were flat and collided with nothing.
dyn_bike_plantrandyn_plantwith grade 0 and no physics world, and the four-wheel model (dyn4_plant, P8d) had no live plant, so--plantcouldn't select it. This puts both on the scene's terrain and makes their chassis collide in a Jolt world.The ground
nav_plant_options::ground_height(elseground_z), the same function an application already spawns Jolt vehicles on.dyn_bike_planttakes the sine of the slope along its heading, under the centre of gravity and over a wheelbase, intodyn_plant's grade. Its books gain the grade line.dyn_4w_plantputs each corner's spring on the ground under its wheel, withgrade_forceon. It starts each vehicle at rest on the ground, with heave, roll and pitch fitted to the four wheels.The world
options.physics, each vehicle's chassis box is a dynamic body in that world, at the model's ride height and attitude (src/cvc/physics/dyn_world.h, internal).fixed_dt. The plant sets the world's contact reporting toall, because a chassis pressed against a wall stays in contact.dyn_4w_plant(new,inc/cvc/physics/dyn_4w_plant.h)vehicle_plant, with parameters fromnav_plant::dyn4_si_of.plant_hostdynamic4wanddynamic4w:<presets>select the four-wheel plant (is_dynamic4w,dynamic4w()).set_geometry's geometry, or the flat ground). Its terrain bodies are the ground, andphysics()returns the world.Tests (Windows, MSVC 19.44 Release):
physics_dyn_bike_plant_test6/6physics_dyn_4w_plant_test5/5dyn4_plantdoes, bit for bit. Its books close, with residual 2.0e-5 of the flow on a 30 s weave.plant_hostputs asim_world's agents on it by name, and they reach their goals.Downstream: CVC-DBG/cvcdbg wires
--plant dynamic4wand the books' new lines into demo3 (PR to follow). It is feature-tested, so it still builds against 3.7.1. A libcvc release with this change is needed for the hosted demo.