Repository navigation
Vehicles start on a slope, not inside it - #1202
Merged
Merged
Conversation
…a world per episode WorldVehicles runs jolt, kinematic, dynamic and dynamic4w entities, a navigator per plant (the dynamic models' chassis in a world of their own holding the world's colliders); entity_spec and vehicles.spawn.plant name it; across plants vehicles touch by their chassis boxes, and cvcGL draws a vehicle with no chassis from its pose. A world's terrain alone is its ground (SceneWorldBody::ground), so a building is an obstacle. WorldGym's regenerate makes a generated world per episode from the reset's seed (SceneWorld::regenerate_world). GymCars and --gym take the cars template's plant names; dyn_bike_plant and dyn_4w_plant gain add_desc.
A vehicle in world_gym.ari's generated world (seed 1, agent 3 at about (-51.7, 46.4)) fell straight down from its first step. The terrain collider has no hole there: a raycast at every free grid cell hits the ground. The spot is a slope of about 0.75, and nav_plant placed every start level at one ground sample (the nearest 2 m grid cell under the rear axle) plus its resting height. Facing uphill, the Humvee's origin started under the ground at its own centre and its nose more than a metre deep; a body that starts below a height field falls through it. nav_plant: with ground_height set, a start is tilted onto the plane fitted to the ground under its chassis, its origin its resting height above that plane, then lifted clear of the highest ground under the chassis and the wheels at full reach. Level ground and a constant ground_z keep the pose they had. WorldVehicles: every plant's ground height (and height_at) is the world's terrain where it has one, the physics collider's own heights, else the grid bilinear between its samples, not the nearest sample. Tests: a downward raycast at every free cell of the generated world finds the ground at the grid's height; twelve Humvees placed on its slopes (1 in 3 to 1 in 1, up and across) start above the ground and are on it 3 s later (two fell to z -27 before).
This was referenced Nov 13, 2026
Merged
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.
Stacked on #1170 (
feat/world-gym). This branch also carries 4a81d3d, the gym follow-up (every plant in a scene world, buildings as obstacles, a world per episode). That commit isn't on GitHub as its own branch yet. The fix is the top commit, 5624aad; review that one.What was wrong
In world_gym.ari's generated world (seed 1), agent 3 at about (-51.7, 46.4) fell from z 9.7 to -27 on its first steps.
nav_plant::placeput every start level, with its origin at one ground sample (the nearest grid cell under the rear axle) plus the resting height.Fix
ground_pose): withground_heightset, a start is tilted onto the least-squares plane through 9 samples under the chassis. Its origin goes its resting height above that plane, then is lifted to clear the highest ground under the chassis underside and the wheels at full reach (+3 cm). Level ground and a constantground_zkeep the pose they had, bit for bit.height_at, read the world's terrain height field (the collider's own heights) where it has one. Otherwise they interpolate the grid bilinearly, not the nearest sample.Tests
AriadneSceneWorld.AGeneratedWorldsColliderIsUnderEveryFreeCell: the raycast sweep.AriadneWorldGym.AVehicleStartedOnASlopeStaysOnTheGround: 12 Humvees on slopes from 1 in 3 to 1 in 1, facing up the slope or across it. They start above the ground and are on it 3 s later. Withground_poseoff, 2 of the 12 fall to z -27.world_gym.py --world generated, seeds 1-6, with both the policy and nav@1: every vehicle stays on the ground (its lowest point is at least 0.15 m above it). Agent 3 now starts 1.32 m above the ground.Not in this PR
Seed 1's episode still ends early (9.8 s). Agent 1 drives into the shallow water at the west edge, slides down the low-friction underwater slope, and leaves the grid at x = -150 while still on the ground. The world has no edge barrier there.