system design · system-design
Design Fleet Management for Autonomous Vehicles (Robotaxi)
Real-time tracking, maintenance scheduling, route optimization, dispatch. Robotaxi vision system.
Theory
Explanation
Intuition first, formal definition second. Skim the bullets if you already know this; read the prose if you don't.
Autonomous fleet management = real-time location + dispatch + maintenance + charging coordination. Same primitives as Uber driver dispatch, with AV-specific constraints (no human breaks, but mandatory recharge + maintenance windows).
Fleet position cached in geo index (H3 cells). Dispatch matches rider request to nearest available AV via Hungarian algorithm batching. Routing service plans pickup → destination considering charge level, traffic. Maintenance scheduler watches odometer + diagnostics; pulls vehicles from service for inspection. Charging coordinator routes low-battery cars to Superchargers, balances utilization.
When to use
Robotaxi, autonomous trucking, delivery fleets.
When not to
Manual ride-hail (driver state different).
flowchart LR Vehicle[AV] -->|position 1Hz| Geo[(Geo Index · H3)] Rider([Rider]) --> Req[Request] Req --> Match[Matcher] Match --> Geo Match --> Dispatch[Dispatch] Dispatch --> Vehicle Vehicle --> Diag[(Diagnostics)] Diag --> Maint[Maintenance Scheduler] Maint --> Service[Service Center Queue] Vehicle --> Charge[Charging Coordinator] Charge --> Supercharger[Supercharger Network]
Key insights
- H3 hex grid gives uniform geospatial cells, better than square grids for distance queries.
- Batch matching (every 5s) outperforms greedy per-request, global optimum across simultaneous riders.
- Charging coordinator essential, fleet utilization tanks if AVs sit on chargers during demand peaks.
- Maintenance is predictive (mileage + signals), vehicles pre-emptively pulled before failure.
- Dispatch latency budget: 2-5s from request to driver assignment.