Repository navigation
generated_world: roads shape the ground, two Humvee lanes, smooth strips with a centre stripe - #1032
Merged
Merged
Conversation
…ips with a centre stripe The roads lay on the ground as it was, rising and falling with every bump and tilting with every side slope (on the 1.2 km lab world the 95th-percentile tilt across a road was 0.74), and some dipped into the water. cvc::world::road_grade gives each road node a height (the ground, above the water, relaxed along the network, held to a 12% climb and 5% into a junction, close roads held to agree) and graded_terrain presses that surface into the ground: level across, cut or banked back to the ground beside, blended where roads meet. world_builder's grade stage swaps it in for everything after the streets, the terrain mesh physics drives on included. Tilt p95 is now 0.036 (1.2 km) and 0.009 (5.3 km); nothing is under water. Every street is two lanes of world_lane_m (the Humvee's 2.18 m plus 0.4 m either side): local streets 6.0 m, collectors 7.0 m. The road mesh draws each run between junctions as one rounded, mitred strip ending on its pad's rim, in one asphalt colour, with a dark yellow centre stripe.
paint_surface's rows run south to north (row 0 = min y, the terrain's v = 0) but a cvc::image's run top down, and setTexture flips an image's rows to VTK's bottom-left origin, so the texture lay mirrored north to south on the ground: water and its sandy shores painted under dry land and buildings, ground painted over the lakes, asphalt beside the roads. The generated_world node and the C++ terrain lab now reverse the painted rows before they hand the image over.
…e whole occupied count With the roads graded, a bank lifts some deep water (occupied) to dry gravel (not occupied), so a world with a city can have fewer occupied cells than one without (macOS: 3,734 vs 3,771). The test now checks what it means: the city's wall cells are all occupied, and a world without a city has none.
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.
The generated world's roads hugged the ground: they rose and fell with every bump, tilted with every side slope, and some dipped into the water. On physics, vehicles bounced and rolled on them. Joe asked for roads that shape the terrain instead: level across, with a gradual grade along. He also asked for two Humvees' width, a cleaner surface and a centre stripe.
Roads shape the ground:
cvc::world::road_grade(new)grade_road_profilegives each road node a height:graded_terrainpresses that surface into the ground. Within a road and a mesh cell past each edge, the ground is the road's surface: level across, linear along. Past that it blends back to the original ground over a cut or bank (side slope 0.5, 2 to 30 m).In the world (
world_builder's newgradestage, after the streets)world_model::with_terraingives the same world on new ground.Measured on the terrain mesh, along every segment at 2 m spacing (
roadcheckharness):Two Humvees per street:
world_lane_mis the Humvee's 2.18 m (vehicle_desc::humvee) plus 0.4 m either side. Every street is at least two lanes: local streets 6.0 m (were 5.0), collectors 7.0 m (6.5), arterials 9.0 m.A cleaner road surface (
extrude_roads)The ground texture was upside down.
paint_surfacewrites rows south to north (row 0 = min y, the terrain's v = 0), as its header says. But acvc::imageis top-left origin, andsetTextureflips an image's rows to VTK's bottom-left convention. So the texture lay mirrored north to south on the ground:A good part of "roads go into the water" was this. The node and the C++ terrain lab now reverse the painted rows before handing the image over, and top-down renders show texture water exactly where the water is.
Tests
world_roads_test:world_road_mesh_test:world_generated_test:RoadsAreDriveable: every street fits two Humvees, tilt p95 under 0.08 and 4× under the ungraded ground's, grade p95 under 0.16, nothing under water.Not in this PR: rendering the water itself better. The water volume is near-transparent over the shallows, so ponds beside a road look like ground. That's the next piece.