Skip to content

NavMap A*: terrain costs and limits, and links between surfaces - #130

Merged
fmrico merged 1 commit into
rollingfrom
navmap_terrain_planner
Oct 16, 2026
Merged

fmrico merged 1 commit into
rollingfrom
navmap_terrain_planner

Conversation

@fmrico

@fmrico fmrico commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Closes #129

All options are off by default, so existing configurations plan as before.

  • Slope cost. terrain.slope_weight adds slope_weight × tan²(slope) per meter on each NavCel. Gentle slopes cost little and steep ones a lot, whether the robot goes up, down or across them. A gentle ramp is therefore preferred to a steep one that reaches the same height. With 100, 5° adds 0.8 per meter, 10° adds 3 and 20° adds 13; flat ground costs cost_factor (2).
  • Shortcut. The line-of-sight shortcut never replaces part of the path by a segment that is steeper or costlier than the waypoints it removes. Before, it could straighten a detour back over the slope.
  • Hard limits. terrain.max_slope_deg, max_step, max_roughness and min_clearance make the NavCels beyond the robot's limits untraversable. They are computed from the NavMap descriptors once per map geometry.
  • Links. Links between surfaces of the allowed kinds are search edges (links.types, by default generic, ramp and door). The path keeps the two ends of a link, with no waypoints in the air and no shortcut across it.
  • Graph cache. It now detects a new map by its geometry id.

Planning time on real maps is unchanged, about 1 ms on the excavation (30 000 NavCels) and on the parking garage (38 000). The first plan after a map loads takes 6–35 ms, depending on the limits enabled. On the excavation, with slope_weight 100, the steepest NavCel on a 20 m path drops from 21.6° to 9.1°, at the cost of a 3 m detour.

Nine new tests cover:

  • the terrain is ignored by default;
  • a hill is avoided;
  • a gentle ramp is preferred to a steep one to the same height;
  • the slope, step, roughness and clearance limits;
  • links by kind and direction;
  • reconfiguration;
  • a new map.

All off by default. terrain.slope_weight adds slope_weight * tan^2 of
the slope of each NavCel per meter: gentle slopes cost little and steep
ones a lot, up, down or across, so a gentle ramp is preferred to a steep
one to the same height. The line-of-sight shortcut never replaces part
of the path by a steeper or costlier segment. terrain.max_slope_deg,
max_step, max_roughness and min_clearance make the NavCels beyond the
robot's limits untraversable, from the NavMap descriptors computed once
per geometry. Links between surfaces of the allowed kinds (links.types,
generic, ramp and door by default) are search edges, and the path keeps
their two ends. The graph cache now tells a new map by its geometry id.

Signed-off-by: Francisco Martín Rico <fmrico@gmail.com>
@fmrico
fmrico merged commit 8b0b644 into rolling Oct 16, 2026
1 check passed
@fmrico
fmrico deleted the navmap_terrain_planner branch October 16, 2026 06:17
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.

NavMap A* ignores the terrain: slopes, steps, low ceilings and links between surfaces

1 participant