Skip to the lesson
FixTheRobot Explore Robotics / Navigation / M2 Maps and Costmaps / M2-T5

Navigation · Theory · M2

M2-T5 — Roadmaps, Lanes and Semantic Maps

A grid is a map of squares. A building is also a map of places and the roads between them, and for long trips that is the better map.

  • Lesson 5 of 6
  • Module 2: Maps and Costmaps
  • Theory
  • About 6 minutes to read

Planning across a whole hospital on a fine grid is possible and wasteful. Humans do not plan door by door: they think “lobby, lift, third floor, pharmacy”. A roadmap does the same. It records the places a robot goes and the lanes between them, with the meaning attached: one-way, slow, forbidden, shared with people.

Learning objectives

After this lesson, you should be able to:

  • Represent a building as a graph of places and lanes with lengths, speeds and directions.
  • Compare the size and planning cost of a lane graph with a grid of the same building.
  • Add speed zones, one-way lanes and keep-out areas, and say where each belongs.
  • Say when a roadmap beats a grid, and why most systems use both.

The intuition

A metro map is a roadmap. It is not to scale; it records stations, the lines between them and the transfers. Its job is to answer “how do I get from here to there” quickly, and it can only answer for places and links someone put on it. For everything inside a station, you look around.

A robot roadmap works the same way. Nodes are places that matter (the lobby, a lift, a door, a charging dock), and lanes are the routes between them that are known to be traversable. Planning is a search on a graph of dozens of nodes instead of millions of cells. The grid is still needed for the last few metres, where the robot must dodge a person or a trolley.

A lane graph of a hospital floorPlaces drawn as nodes, A for the lobby, B for the lift, C for the pharmacy and D for the ward, joined by lanes with lengths. A keep-out zone is shaded beside one lane. 12 m18 m35 m9 m A lobbyB liftC pharmacyD ward keep-out (surgery) Shortest A to D: A→B→C→D = 12 + 18 + 9 = 39 m, not A→C→D = 44 m
A lane graph: places as nodes, lanes as weighted links. The shortest route follows lanes, and a keep-out zone is a property of the map that planners must respect.

The mathematics

The graph

Lane graph
G=(V, E)G=(V,\,E)
places (nodes) with a pose lanes (edges) with a length and attributes length, speed limit, direction (one-way or both), width, allowed robot types

A route is a sequence of nodes. Its cost is a sum over its edges, and the cost does not have to be length:

Edge cost
cost⁡(edge)=lengthspeedlimit+penalty⁡(attributes)\operatorname{cost}(\text{edge})=\frac{\text{length}}{\mathrm{speed}_{\text{limit}}}+\operatorname{penalty}(\text{attributes})
time, not distance
route=arg min⁡ over paths of ∑ of cost⁡(edge)\text{route}=\operatorname*{arg\,min}\,\text{over paths of}\,\sum \,\text{of}\,\operatorname{cost}(\text{edge})
found with Dijkstra or A*

Attributes that carry meaning

Lane and zone attributes
AttributeExampleWhat it changes
Speed limit0.5 m/s in the paediatric ward, 1.0 m/s in service corridorsEdge cost (time) and the controller’s speed ceiling
DirectionOne-way lane in a narrow corridorThe graph becomes directed
Keep-out zoneSurgery, MRI roomEdges or regions removed or forbidden
Semantic labelLift, door, charging dockBehaviours: wait for the lift, open the door, dock
CapacityOne robot at a time in a laneFleet reservations (module 8)

Size and speed

A hospital floor of 120 m × 60 m on a 0.05 m grid has 2400 × 1200 = 2.88 million cells. The lane graph of the same floor might have 40 nodes and 90 lanes. A search on the graph is effectively instant and can be recomputed whenever a lane is blocked.

Where roadmaps are weak

A roadmap contains only routes someone placed on it. It does not know about a cart in a lane. A robot on a lane still needs a local costmap to see the cart, and a local planner that can leave the lane, within limits. The roadmap says where to go; the grid says whether it is safe right now.

A worked example

Fastest route, not shortest. Four places A (lobby), B (lift), C (pharmacy), D (ward). Lanes: A–B 12 m, B–C 18 m, A–C 35 m, C–D 9 m. The shortest A to D is A→B→C→D = 12 + 18 + 9 = 39 m. The direct A→C→D would be 35 + 9 = 44 m.

Now add speed limits. The lane A–B is a crowded public corridor limited to 0.5 m/s: 12 / 0.5 = 24 s. B–C is 1.0 m/s: 18 s. C–D is 0.5 m/s: 9 / 0.5 = 18 s. The route A→B→C→D takes 24 + 18 + 18 = 60 s. The direct lane A–C has a limit of 1.2 m/s: 35 / 1.2 = 29 s, then C–D 18 s, a total of 47 s. The longer route is the slower one once speeds are attached: 44 m in 47 s beats 39 m in 60 s. A planner that counts only metres sends the robot through the crowd.

Keep-out. The surgery wing lies beside the lane A–C. A keep-out region is better stored as an area than as a missing lane, because the local planner must also be forbidden from cutting through it when it dodges a person. In Nav2 this is done with a keep-out filter on the costmap or a speed filter for zones.

Engineering implications and limitations

Authoring is the hard part

A roadmap is drawn, not learned. Tools such as map editors and the nav graph format of Open-RMF let facilities teams place lanes and attributes. Keep the source file under version control and load it into the robot like any other map.

Roadmap plus grid

Typical systems plan the route on the roadmap, then plan each leg on the costmap with the local planner, so a blocked lane triggers a replan on the graph instead of a stall.

Semantics and safety

Labels such as “lift” or “door” trigger behaviours. A wrong label is a safety bug, so treat map edits like code changes and test the route set after every change (module 8).

Fleets

Lane graphs are what a fleet manager reasons over: reservations, one-way rules and deadlock avoidance are all easier on a graph with a few hundred edges than on a grid (module 8).

Common misconceptions

“A roadmap replaces the costmap.”

It replaces the global search over a large area. The costmap is still what keeps the robot clear of a cart in the lane.

“The shortest route is the best route.”

Only if every lane has the same speed and risk. Edge cost should be time plus penalties.

“Semantic maps are only for AI.”

A lane marked one-way or a zone marked keep-out is semantic. It is data a planner can use without any learning.

“A grid is always more general.”

A grid represents any space but not its meaning or rules, and it is slow to search over a whole building.

Engineering takeaways

  1. A roadmap is a graph of places and lanes, with lengths, speeds, directions and zones as attributes.
  2. It is orders of magnitude smaller than a grid of the same building, so global planning is almost free.
  3. Edge cost should be time and risk, not only distance: the shortest route can be the slowest.
  4. Keep-out and speed zones belong in the map, where every planner has to respect them.
  5. Use the roadmap to decide where to go and the costmap to decide whether it is safe now.

References and further reading

Standard planning textbooks and the Open-RMF documentation.

  • H. Choset, K. Lynch, S. Hutchinson, G. Kantor, W. Burgard, L. Kavraki and S. Thrun, Principles of Robot Motion, MIT Press, 2005, chapter 5.
  • S. LaValle, Planning Algorithms, Cambridge University Press, 2006, chapter 6.
  • Open Robotics, “Open-RMF” documentation, “Traffic Editor and Navigation Graphs”, osrf.github.io/ros2multirobotbook.
  • Nav2 documentation, “Keepout Filter” and “Speed Filter”, docs.nav2.org.

Knowledge check

Three conceptual questions. Write an answer, then reveal the explanation. Your answers stay in your browser.

Question 1

A floor is 100 m × 50 m. How many 0.05 m cells is that, and why is searching a lane graph of 50 nodes cheaper?

Explanation

2000 × 1000 = 2 000 000 cells. A search over 50 nodes touches at most a few hundred edges, so it is thousands of times less work.

Question 2

Lane X is 20 m with a limit of 0.5 m/s. Lane Y is 30 m with a limit of 1.5 m/s. Which is faster, and by how much?

Explanation

X takes 40 s, Y takes 20 s. Y is 20 s faster although it is 10 m longer.

Question 3

Why is a keep-out zone better stored as a region than as a missing lane?

Explanation

A local planner that leaves the lane to avoid a person can still cut through the zone if only the lane is missing. A region forbids it for every planner.

What’s next

Last in this module: terrain and three-dimensional maps, for robots whose floor is not flat.

Next lesson

M2-T6 — Traversability and 3D Maps

Derive a terrain cost from slope, roughness and step height, and compare elevation maps with voxel maps.

Nothing below is required to finish this lesson.

  • Before
    M2-T4: Layered Costmaps

    Describe static, obstacle, inflation and social layers, and explain marking, clearing and why ghost obstacles appear.