The Harbor Yard loop road is seven lanelets. Each one has a left boundary, a right boundary, a direction, and a speed limit. Individually, they are correct. Geometrically, they are precise. Topologically, they are seven disconnected fragments.
A mission planner handed these seven lanelets cannot route a cargo tug from the loading dock to the exit gate. It needs to know which lanelet follows which, which turns are legal, and which paths conflict. Without that knowledge, the map is a drawing of a road network. With it, the map is a navigable graph.
Chapter 19 introduced the three topological relations: successor, adjacency, and conflicting. This chapter goes deeper: how those relations are built, validated, and assembled into a routing graph the planner can execute.
The glue: node sharing
Continuity in Lanelet2 is not a spatial query. It is a data integrity constraint. Two successive lanelets are connected when the end nodes of the first lanelet’s borders are the exact same nodes as the start nodes of the second lanelet’s borders.
Not close. Not a millimeter apart. The same node IDs.
If the left border of lanelet A ends at node 451 and the left border of lanelet B begins at node 452 (a different node, even if it sits at identical coordinates), the topology layer will not create a successor edge. The planner will see two lanelets that happen to be near each other. It will not see a path.
Intersections: virtual lanes in unmarked space
Highway intersections have painted lanes, turn arrows, and signal phases. The Harbor Yard loop road has none of these. It has asphalt, a faded centerline, and a corner where the main loop meets the dock approach road. There is no lane marking telling the cargo tug where to turn.
In Lanelet2, you model an intersection by creating virtual lanelets that connect incoming lanes to outgoing lanes. These virtual lanelets have the same structure as any other lanelet (left and right borders, a direction), but their boundaries are not traced from physical markings. They are drawn to define the legal path through the intersection.
Each virtual lanelet inside an intersection must carry the turn_direction attribute from Chapter 21, set to left, right, or straight. Inside an intersection the tag does extra work: beyond firing the turn indicator, it tells the planner which successor to choose when computing a route through unmarked space.
The routing graph
Once every lanelet is connected and every intersection is modeled, the Lanelet2 framework converts the XML data into a routing graph. This graph represents every possible maneuver at Harbor Yard: the loop circuit, the dock approaches, the gate exit, and every conflicting path where two routes intersect.
The planner reads this graph. It finds the lanelet the vehicle is currently in. It follows successor edges until it reaches the destination lanelet. It checks conflicting edges to identify where it must yield. It reads adjacency edges to know when a lane change is legal. The graph is the map in the form the planner consumes: a mathematical network of nodes and edges, with rules attached.
Try this
[10 min] Validate the topological path from the Harbor Yard loading dock to the exit gate.
- Start at the lanelet facing the loading dock. Identify its successor by checking which lanelet shares its terminal border nodes.
- Follow the chain: dock approach → main loop → gate approach → exit. At each transition, verify that the left and right border ways of the current lanelet share their terminal nodes with the start nodes of the next.
- Find the intersection where the dock approach meets the main loop. Verify that the virtual lanelet through the intersection has a
turn_directionattribute.
If the chain is unbroken, the planner can route a cargo tug from the dock to the gate. If a single node is unshared, the path ends there. The robot never reaches the gate because the map never told it the way.
Found an error or have a suggestion?
Report an erratum or send feedback →