Section 48.8: Route, behavior, and scenario-based planning

Driving is a stack of commitments at different time scales: which roads to take over minutes, which gap to take over seconds, and which steering angle to take right now.

On layered planning and the HD map
Big Picture

Autonomous driving planning is layered because the problem has layered commitments: where to go, how to interact, which lane or gap to choose, and which trajectory the vehicle can safely execute.

Cartoon autonomous car approaching an occluded pedestrian scenario with safe fallback motion shown as ghost paths.
Figure 48.8A: Scenario-based planning makes hidden risk visible by tying route, behavior, prediction, trajectory, control, and fallback evidence to the same road situation.

Route, Behavior, And Local Planning

Route planning chooses a coarse path through a road graph. Behavior planning chooses maneuvers such as follow, yield, merge, stop, nudge, overtake, or pull over. Local planning turns that decision into a dynamically feasible trajectory with speed, curvature, comfort, and collision constraints.

Prediction And Planning Are Coupled

The planner does not react to one fixed future. It plans against uncertain futures from other agents, then updates as those agents respond. That makes driving an interactive embodied system, not a static path search.

HD Maps And Localization

Route and behavior planning both stand on a high-definition map. Unlike a navigation map, an HD map encodes lane geometry, traffic signs, crosswalks, and stop lines to roughly 10 cm precision, organized as layers: lane centerlines and boundaries, regulatory elements (signs, signals, speed limits), and topology (which lane connects to which). The vehicle locates itself in this map by scan matching, aligning live LiDAR or camera features against the stored map, which yields a lane-relative pose far more precise than raw GNSS. Crowdsourced map updates, where the fleet reports discrepancies, keep the map fresh.

Common Failure Mode: Map Staleness

Construction zones are the canonical HD-map hazard. The map shows a lane that is now coned off, so a planner that trusts the map will route into a closed lane. The mitigation is online perception that detects cones, barriers, and lane closures and lets live evidence override the stored map; the residual risk is the set of construction layouts the detector still mishandles.

The most basic map query a planner makes is "which lane am I in, and where is its center?" The example below performs a nearest-centerline lookup: given the ego position, it returns the closest lane-centerline point, the seed of lane-relative localization and of the Frenet reference path from Section 48.4.

import numpy as np

# A tiny HD-map fragment: two lane centerlines as polylines of (x, y) points.
lanes = {
    "lane_L": np.array([[0, 1.8], [10, 1.8], [20, 1.9], [30, 2.2]], dtype=float),
    "lane_R": np.array([[0, -1.8], [10, -1.8], [20, -1.7], [30, -1.4]], dtype=float),
}

def nearest_centerline(ego_xy, lanes):
    """Return (lane_id, nearest centerline point, lateral distance) for the ego."""
    best = (None, None, np.inf)
    p = np.asarray(ego_xy, dtype=float)
    for lane_id, pts in lanes.items():
        d2 = np.sum((pts - p) ** 2, axis=1)   # squared distance to each map point
        i = int(np.argmin(d2))
        dist = float(np.sqrt(d2[i]))
        if dist < best[2]:
            best = (lane_id, pts[i], dist)
    return best

ego = (12.0, -1.2)                            # ego pose near the right lane
lane_id, cpt, lateral = nearest_centerline(ego, lanes)
print(f"ego in {lane_id}: nearest center {tuple(cpt)}, lateral offset {lateral:.2f} m")

Expected output: the ego at (12.0, -1.2) is assigned to lane_R with a nearest centerline vertex at (10.0, -1.8) and a distance of about 2.09 m (dominated by the 10 m vertex spacing of this coarse polyline; a real HD map is sampled far more densely). The lane assignment is the lane-relative localization a behavior planner needs before it can reason about gaps and maneuvers, and in a real stack the snap is refined by scan matching against the full HD map layers.

Scenario-Based Validation

Scenario testing is the bridge from impressive driving clips to engineering evidence. A scenario names the road layout, actors, initial states, behavior scripts, weather, sensor configuration, success criteria, and termination rules. OpenSCENARIO, ScenarioRunner, CommonRoad, and CARLA-style tooling make those assumptions explicit.

A useful scenario program separates functional scenarios, logical scenarios, and concrete scenarios. The functional scenario says "occluded pedestrian after parked van." The logical scenario defines parameter ranges for speed, distance, visibility, and pedestrian timing. The concrete scenario fixes one reproducible test instance with exact values.

Driving Planning Layers
LayerQuestionEvidence Metric
Route planningWhich road sequence reaches the goal?Route completion and map validity
Behavior planningWhich maneuver is socially and legally appropriate?Rule violations and interaction safety
PredictionWhat might other agents do?Calibration, miss rate, interaction coverage
Trajectory optimizationWhich path and speed are feasible now?TTC, comfort, jerk, curvature, collision margin
ControlCan the vehicle track it?Lateral error, actuator saturation, stability margin

Safety Case Thinking

A safety case connects hazards, mitigations, tests, and residual risk. For driving, this means the evidence should be organized by operational design domain: road type, weather, speed range, traffic density, lighting, map quality, sensor availability, and fallback behavior.

SOTIF-style reasoning asks whether the intended function can be unsafe even without a component failure. That question is central for learned perception and planning: the camera may work, the model may run, and the vehicle may still choose an unsafe maneuver because the scenario sits outside the validated operational design domain.

Expected output: the scenario name should identify a recognizable hazard pattern and the metric count should confirm that the planner will be judged on more than route completion alone. If your scenario card cannot name its fallback behavior or its ODD, it is not strong enough to support a safety claim.

Library Shortcut

Use CARLA and ScenarioRunner for closed-loop scenario execution, CommonRoad for planning benchmarks, OpenSCENARIO for portable scenario descriptions, and nuScenes or Waymo Open Dataset for perception and prediction grounding.

Practical Example

For an unprotected left turn, evaluate route completion only after checking gap selection, prediction uncertainty, acceleration comfort, time-to-collision, rule compliance, controller tracking, and the safety monitor's intervention threshold. A completed route with an unsafe gap is not a planning success, it is a delayed incident report.

Common Failure Mode

A scenario suite can look broad while missing the operational design domain boundary that matters most. Track weather, visibility, road topology, traffic density, map quality, and fallback assumptions explicitly.

Memory Hook

Treat route, behavior, and scenario-based planning like a control-room label. If the label does not tell a future debugger what moved, what sensed, or what failed, it is decoration rather than engineering knowledge.

Research Frontier

The frontier is interactive scenario generation: using datasets, simulation, and learned agents to discover rare but plausible cases that stress prediction, planning, control, and fallback behavior together.

Self Check

Can you turn one functional scenario into a logical parameter range and then into a concrete reproducible test case?

Exercise 48.8.1

Build a scenario suite with cut-in, unprotected left turn, occluded pedestrian, emergency vehicle, low-friction curve, and construction detour. Define one metric and one expected failure for each layer of the planning stack.

Key Takeaway

Scenario-based planning is credible when route, behavior, prediction, local trajectory, control, and safety-case evidence are tied to the same operational design domain.

Section References

CARLA ScenarioRunner. https://github.com/carla-simulator/scenario_runner

Scenario execution engine for CARLA with OpenSCENARIO support.

nuScenes. https://www.nuscenes.org/

Multimodal autonomous driving dataset for perception and prediction.

Waymo Open Dataset. https://waymo.com/open/

Large-scale autonomous driving dataset for perception and behavior research.

ASAM OpenSCENARIO. https://report.asam.net/asam-openscenario

Scenario-description standard for dynamic traffic scenarios.

ISO 21448:2022, Road vehicles, SOTIF. https://www.iso.org/standard/77490.html

Safety of the intended functionality reference for road vehicle systems.

DLR PEGASUS project. https://www.dlr.de/en/ts/research-transfer/projects/pegasus

Scenario-based validation reference for automated driving safety arguments.