Skip to content

nav: slopes are material risk, not walls; terrain risk joins the material risk - #785

Merged
transfix merged 1 commit into
masterfrom
feat/nav-soft-slopes
Oct 24, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/nav-soft-slopes

Conversation

@transfix

@transfix transfix commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Slopes are a soft material risk by default. In terrain_config:

  • block_infeasible is now false, so infeasible slope no longer joins the occupancy as a wall.
  • The grade cost acts through the material channel's soft force (lam_grade 0.5).
  • Infeasible slope acts through the material channel's barrier (lam_grade_hard 3).

A vehicle the planner sends over a steep cell it can physically drive is no longer pinned there as against a building. Setting block_infeasible = true restores the walls.

Terrain risk is material risk wherever the drive reports or reads it:

  • drive_telemetry.mrisk is the worse of the material's risk and the grade cost. With no material stack it's the terrain's alone, reported with the terrain's weights. So the nav ledger's mrisk_mean/mrisk_max now see slopes; before this they read 0 on terrain.
  • A risk net's look-ahead (kFlagFeatRisk) takes the worse of the two at each probe point, via a new trailing coef_feats(..., terrain_risk). A null terrain_risk leaves the column exactly as before, so grl_snam parity is unchanged.
  • drive_step and drive_step_ext run a risk net on a terrain alone instead of throwing.

Why. In cvcdbg's Jolt Humvee convoy on Austin, the slope walls (max_grade 0.2) pinned the lead for the last 90 s of a 4-minute run. It sat against a ~19% downhill it could physically drive, held there by the barrier while its route sent it on. A/B over 8 paired jam seeds (2100 ticks; * = paired 95% CI excludes 0):

walls soft, hard 1 soft, hard 3
progress to objective 0.245 0.351 * 0.267
time wall-following (s) 124 88 * 99 *
min separation (m) 1.9 3.0 * 2.7 *
formation arrival 0.43 0.50 0.63 *
vehicles rolled / episode 0.25 1.9 * 1.1 *
lead rolled / episode 0 0.63 * 0

At hard weight 1 (the material channel's own lam_hard), the Humvee lead rolled on Austin's twisted ramps in most runs; at 3 it never did. That's why the default is three times the material channel's. Followers still roll more often than with walls (with righting on in cvcdbg). Feeding the plant's tip risk into the barrier (hard_scale) is the next lever.

Tests

  • New SteepSlopeIsARiskNotAWall: a ramp steeper than the limit, with no way round. As a wall, the agent never passes x = -3.5. As a risk, it crosses.
  • New TerrainRiskIsMaterialRisk: the probe column on terrain alone and over a riskless material, the telemetry's mrisk and lam_hard, and a risk net on terrain alone.
  • InfeasibleSlopeIsNeverEntered now opts into block_infeasible.

Results locally (Windows, RelWithDebInfo): nav_terrain_test 8/8, nav_binding_test 4/4, nav_material_test 29/29, nav_test 64/64. nav_plant_test (Jolt) 23/23, including NeverEntersInfeasibleSlope (0 ticks on infeasible slope under the soft defaults, on a route that goes round the ridge) and the climbing-energy gate.

Found along the way (not changed here): a kinematic agent driving straight at its initial goal, with no route follower, never stops at it. Parking brakes it by a_max·dt each tick, but the drive re-accelerates toward the parked carrot, which sits 2·v ahead, and the two settle at about 6.2 m/s. It happens with no terrain set too.

…rial risk

terrain_config's defaults make slope a soft material risk: block_infeasible
is off, so infeasible slope no longer joins the occupancy as a wall, and the
grade cost and the infeasible cells act through the material channel's soft
force (lam_grade 0.5) and barrier (lam_grade_hard 3). A vehicle the planner
sends over a steep cell it can physically drive is no longer pinned there as
against a building. The hard weight is three times the material channel's:
in cvcdbg's Jolt Humvee convoy on Austin (8 paired seeds), walls pinned the
lead for the last 90 s of a 4-minute run; soft slopes cut the time spent
wall-following by about a quarter and widened the spacing, and at 3 the lead
never rolled on Austin's twisted ramps, where at 1 it rolled in most runs.
block_infeasible = true restores the walls.

The terrain's risk is material risk where the drive reports and reads it:
- drive_telemetry.mrisk is the worse of the material's risk and the grade
  cost (the terrain's alone, with its weights, when there is no material
  stack), so the nav ledger's mrisk_mean/mrisk_max see slopes;
- a risk net's look-ahead takes the worse of the two at each probe point
  (coef_feats' new trailing terrain_risk; null leaves the column exactly as
  before), and drive_step / drive_step_ext run a risk net on a terrain alone.

Tests: SteepSlopeIsARiskNotAWall (a wall stops the agent at a ramp with no way
round, the risk lets it cross), TerrainRiskIsMaterialRisk (the probe column,
the telemetry and a risk net on terrain alone); InfeasibleSlopeIsNeverEntered
opts into block_infeasible.
@transfix
transfix merged commit c52440e into master Oct 24, 2026
25 checks passed
transfix added a commit that referenced this pull request Oct 24, 2026
Carries the master merge (#776 squash, #774, #775, #777, #780, #782,
#784, #785) up the H1 stack.
@transfix
transfix deleted the feat/nav-soft-slopes branch October 29, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant