Week 9 — Planning Interface, Route Following, and the Scenario System

Course 2 syllabus

Overview

This week connects the simulated world to an autonomy planning API and makes the whole thing testable through reproducible scenarios. It consolidates the planning-interface and scenario-system weeks because they are two halves of one idea: a clean planner contract is only valuable if you can drive it through repeatable situations and check the results. You build a route planner (global, over the lane graph) and a local planner (chooses a feasible, rule-respecting trajectory), then a scenario system that specifies initial conditions and a headless runner that executes scenarios deterministically for regression testing.

This is where the engine becomes a self-driving test platform, mirroring the prediction→planning contract from Course 1. Course 5’s graph algorithms power routing; Week 1’s determinism makes regression tests meaningful.

Readings

  • DPV (apply): shortest paths, graph search, dynamic programming. Extract: routing over the lane graph; local trajectory search.
  • PR: planning under uncertainty skim. Extract: planning against predicted agent motion.
  • Software-testing references: golden tests, regression harnesses. Extract: how to make a simulation a deterministic test fixture.
  • Course 1 autonomy notes: the planner contract and prediction/planning metrics. Extract: the interface shape to mirror.

Key Concepts

The planner contract

Define a typed API: input is the ego state, the semantic world (lane graph + controls + detected/known agents), and a goal; output is a feasible, rule-compliant local trajectory plus a fallback. This mirrors Course 1’s prediction→planning boundary, so the two courses’ planners are conceptually interchangeable — the engine can host Course 1’s planner and vice versa.

Route and local planning

Route planning is shortest path over the lane graph (Week 4) from current lane to goal — Dijkstra/A* (Course 5). Local planning chooses a short-horizon trajectory along the route that respects the bicycle-model feasibility (Week 6), traffic rules (Week 5), and collision avoidance against other agents — a candidate-trajectory search scored by progress, comfort, and safety.

The scenario system

A scenario is a declarative spec: road network, initial ego/agent states, agent behaviors, controls, and success/failure criteria (reaches goal, no collision, no rule violation, within time). Stored as JSON, it makes a situation reproducible. Determinism (Week 1) guarantees the same scenario yields the same outcome every run — the prerequisite for regression testing.

Headless runner and regression

A headless mode advances the simulation with no rendering (Week 1’s separation paying off), running scenarios as fast as possible. A regression harness runs a suite of scenarios and flags any whose pass/fail status changed — catching planner regressions automatically, exactly as a real AV team does.

Theory Exercises

  1. Specify the planner contract as a typed interface; justify each field against the needs of route/local planning.
  2. Formulate route planning as shortest path over the lane graph; choose a heuristic for A* and argue admissibility.
  3. Formulate local planning as a scored search over feasible candidate trajectories; define the cost terms.
  4. Define a scenario’s success/failure criteria precisely enough to be machine-checkable.
  5. Explain why determinism (Week 1) is necessary for regression testing and what breaks without it.

Implementation

Add an autonomy/ planning module: a route planner over the lane graph and a local planner producing feasible, rule-respecting trajectories that command the ego (Week 6). Build a scenario format (JSON), a scenario loader, and a headless runner. Create a regression suite (a handful of scenarios including the four-way intersection) with pass/fail criteria.

Benchmark

Route-planning latency; local-planning latency (p50/p90/p99); scenario regression results (pass/fail per scenario, run-to-run determinism check); headless throughput (sim-seconds per wall-second).

Expected baselines: routing is fast on small graphs; local planning stays within a real-time budget; the regression suite is bitwise-reproducible across runs; headless runs many times faster than real time. The ego completes the four-way scenario obeying rules and avoiding agents.

Connections

This makes the engine a deterministic AV test platform and mirrors Course 1’s planning contract, so the two can interoperate. It uses Week 4 (lane graph), Week 5 (rules), Week 6 (ego feasibility/collision), and Week 1 (determinism). Week 10 integrates it into the polished demo and scales performance.

Further Reading

  • DPV shortest-path chapters (Course 5 review).
  • Paden et al., “A Survey of Motion Planning and Control Techniques for Self-Driving Urban Vehicles.”
  • CARLA scenario-runner (conceptual comparison for the scenario system).