Skip to content

navmap_planner: no step through the corner of a hole, no graph for degenerate NavCels - #182

Open
jmguerreroh wants to merge 1 commit into
EasyNavigation:rollingfrom
jmguerreroh:navmap-planner-graph-fixes
Open

jmguerreroh wants to merge 1 commit into
EasyNavigation:rollingfrom
jmguerreroh:navmap-planner-graph-fixes

Conversation

@jmguerreroh

Copy link
Copy Markdown
Contributor

What

Two fixes in the graph AStarPlanner builds from the NavMap (ensure_graph_cache) and walks
(a_star_path), found while planning on large maps of a city with the buildings cut out as holes.

No step through the corner of a hole

A NavCel's neighbours include the NavCels that only share a vertex with it; such a step is taken
when every NavCel around that vertex is passable. At the corner of a hole there is no NavCel on
the hole's side, so nothing stopped it: two holes touching at a corner (two buildings, a
building's corner on the map's edge) left the free NavCels on both sides as neighbours through
that point, and the path went through the wall.

Now a vertex on the border of the map (an edge at it belongs to one NavCel only) is computed once
per graph (border_vertex_), and no step goes through one. Steps through a shared edge are as
before.

No graph for degenerate NavCels

NavCels with a repeated vertex (no area) are left out of the graph: they have no neighbours and
are nobody's neighbour. A map can have many on one vertex (e.g. NavCels a filter removed by
collapsing them onto it), and each one was a neighbour of all the others: quadratic time and
memory in their number when the graph is built.

Tests

New cases in navmap_planner_tests.cpp, both failing before this change:

  • HolesTouchingAtACornerAreAWall: a diagonal line of holes across the map, each touching the
    next at a corner, both ways: no path across it (a path on the same side still exists).
  • DegenerateNavCelsAreLeftOutOfTheGraph: 2000 degenerate NavCels on one vertex have no
    neighbours, no NavCel has them as neighbours, and a plan from that vertex still works.

colcon test --packages-select easynav_navmap_planner: 82 tests (with the linters), no failures.

…generate NavCels

- A step from one NavCel to another that only shares a vertex with it is not taken when that
  vertex is on the border of the map (an edge at it belongs to one NavCel only): the corner of a
  hole, e.g. a building cut out of the map. Two holes touching at a corner left the free NavCels
  on both sides as neighbours through that point, and the path went through the wall.
- Degenerate NavCels (a repeated vertex: no area) are left out of the graph. Many of them on one
  vertex (NavCels a filter removed by collapsing them) made each a neighbour of all the others:
  quadratic time and memory in their number.
@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.29630% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...lanner/src/easynav_navmap_planner/AStarPlanner.cpp 95.00% 0 Missing and 1 partial ⚠️
...ynav_navmap_planner/tests/navmap_planner_tests.cpp 97.05% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

This branch has not been deployed

No deployments
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