Two cars, a street wide enough for one and a half, parked cars on one side, no lane markings and no right of way. Every driver in India solves this many times a day. It is hard for an autonomous car, because predicting where the other car will go is not enough. You need to know what its driver wants: will they move over, hold their line, or stop and wave you through? I spent two years on learning-based driving for Indian roads at Minus Zero, and this is the scenario I keep coming back to. This post is about a behaviour planner that reasons about the person in the other car, the simulator I built to test it, and the bug in my own model of human drivers that the test exposed.
TL;DR
The planner decides what to do (go, yield, squeeze past, wait) by keeping a belief over who the oncoming driver is, edging out to see how they react, and committing only to paths that stay safe whatever they do next.
Across 400 simulated drivers it had 0 contacts (95% CI 0 to 0.9%), against 10 for a planner that only predicts motion (2.5%, CI 1.4 to 4.5%; Fisher’s exact p = 0.002). Half of those drivers had a driving style the planner’s model did not know about.
The bigger lesson came from a failure: my hand-written model of human drivers predicted their next move 31% of the time, worse than always guessing the most common move (58%), and it read bold drivers as cautious. A driver model learned from logged driving fixed both (77%, and the risk read flipped from r = -0.57 to +0.57).
Ablations say the gain comes mostly from that better driver model, not from the clever parts I was proudest of.
The setup
The simulator is deliberately simple-looking: MuJoCo for geometry and rendering, boxy cars, no cameras and no photorealism, because the point is the planner. It still does not give the planner a perfect view. The planner works from noisy simulated detections with range-dependent noise, line-of-sight occlusion, dropouts and a tracker, and the car follows its plan through a bicycle model and a tracking controller, so it never goes exactly where it planned.
Underneath sits a standard sampling planner: 810 candidate paths in a road-aligned (Frenet) frame, re-planned ten times a second, each checked against everyone’s predicted motion [3]. The behaviour layer on top is what this post is about.
The simulated drivers each have a psychology, not just a speed. They perceive like people (looming time-to-contact, about 0.8 s of reaction time, attention to only a couple of things at once) and they choose like people: social value orientation (how much your time matters to them), a risk set point with a comfort band, impatience that builds while they wait, and imperfect, satisficing choices [1, 2].
What the planner does
Instead of only predicting motion, the planner keeps a particle belief over the oncoming driver’s traits and updates it by asking, for each particle, “if they were this person, what would they be doing right now?” Then it does three things:
it edges out a little, which shows its intent and makes the other driver reveal theirs [4];
it updates what it believes they intend: will they make room, hold their line, or stop?
it commits only to paths that stay collision-free under every plausible reaction, so a wrong read costs time rather than a crash.
Video 1 — Same road, same assertive oncoming driver, same 810 candidate paths. Left: a planner that only predicts motion ends nose to nose and stops. Right: the intent-aware planner reads the driver and gets through.
One clip proves nothing, and this one flatters the method: over 20 runs of this exact scene the gap is smaller than it looks (2 standoffs against 1). The population test below is the real evidence.
The bug in my model of people
My first version used a hand-written model of how people drive to interpret what the oncoming driver did. Before trusting it, I checked how well it predicted held-out decisions. On 2,787 held-out choices it was right 31% of the time, worse than always guessing the most common choice (58%).
The cause was simple once I looked. The model assumed a driver holding their line would keep full speed, but simulated people who hold their line slow to about 45% of their speed, because the oncoming car makes them uneasy. So a bold driver who held their line and slowed down looked, to the model, like a cautious one. Risk tolerance came out backwards: across 400 drivers the inferred risk correlated with the true risk at r = -0.57.
Figure 1 — Next-move accuracy on 2,787 held-out decisions (95% Wilson intervals). The hand-written model was worse than a constant guess.
Replacing it with a small driver model learned from logged driving fixed both problems: 77% next-move accuracy, and risk tolerance read the right way round (r = +0.57, and +0.51 on drivers whose style the model had never seen).
Figure 2 — Inferred against true risk tolerance for 400 simulated drivers. Left: the hand-written driver model reads bold drivers as cautious (r = -0.57). Right: the learned model reads them the right way round (r = +0.57 on model-matched drivers, +0.51 on drivers with a hidden style).
Results on 400 drivers
I tested four planners on the same 200 randomly drawn drivers, twice: once with drivers that behave the way the planner’s model assumes, and once with a hidden execution style it does not know about. Every planner met the same people.
planner
contacts, model-matched
contacts, hidden style
stalls (both)
motion-only baseline
4 / 200
6 / 200
20
two-way intent guess
3 / 200
3 / 200
13
driver model, hand-written
2 / 200
1 / 200
10
driver model, learned
0 / 200
0 / 200
7
Figure 3 — Runs with contact per planner and population, with 95% Wilson intervals. The intervals overlap within each population; the pooled comparison is what reaches significance.
Pooled, that is 0 of 400 against 10 of 400 for the baseline (Fisher’s exact p = 0.002). Per population the paired test against the baseline is weaker (McNemar p = 0.125 model-matched, 0.031 hidden style), so I would not lean on either half alone.
The planner also behaves differently with different people, which is the point of a behaviour planner. With drivers whose style it was not told, it gives way to bold, selfish drivers (median 16.2 s to get through, n = 30) and goes first past cautious, considerate ones (10.6 s, n = 42).
Figure 4 — One planner, two kinds of oncoming driver, two decisions. Identical for the first three seconds; then the cooperative driver moves over (will yield 0.97) and the planner commits, while the assertive one holds their line (0.03) and it waits.
What the ablations say
variant of the learned-model planner
contacts, model-matched
contacts, hidden style
stalls (both)
full planner
0 / 200
0 / 200
7
no emergency gate
0 / 200
0 / 200
8
no edging-out probe
0 / 200
1 / 200
11
belief frozen at the prior
0 / 200
0 / 200
9
told the driver’s true traits
0 / 200
3 / 200
9
This is the part I would want a reviewer to read. Removing the edging-out probe, freezing the belief instead of updating it, or removing the emergency gate barely changes contacts: all stay at 0 or 1 in 200. Even giving the planner each driver’s true traits does not help on the hidden-style population (3 contacts). So the improvement comes mostly from the learned model making better predictions of what people do, which the contingency check then uses. The online reading of personality, the part that makes the best demo, is not yet pulling its weight in the numbers.
Caveats
Everything is simulated, and the simulated people are mine. The learned driver model was trained on simulated logs that include each driver’s true traits; with real logs the traits are latent, and that is a harder problem. Zero against ten in 400 is a real difference but a small number of events. Next is the same planner in a much messier scene: a crowded crossroads.
References
Schwarting, W., Pierson, A., Alonso-Mora, J., Karaman, S. and Rus, D. Social behavior for autonomous vehicles. PNAS, 2019.
Fuller, R. Towards a general theory of driver behaviour. Accident Analysis and Prevention, 2005.
Werling, M., Ziegler, J., Kammel, S. and Thrun, S. Optimal trajectory generation for dynamic street scenarios in a Frenet frame. ICRA, 2010.
Sadigh, D., Sastry, S., Seshia, S. A. and Dragan, A. D. Planning for autonomous cars that leverage effects on human actions. RSS, 2016.