Home›Part 4 How Automated Driving Works›4.5

Part 4 · How Automated Driving Works

4.5 Prediction and motion planning

Reading others’ moves to decide how to drive

10-minute readPrerequisites: 4.2 System overview, 1.4 Expected value and variance▶ Video (about 6 min)

What you will learn

  • Explain why prediction of others’ motion is treated as “several futures with probabilities”, and the three levels of planning (route, behaviour, trajectory)
  • Compare candidate manoeuvres by expected cost, and confirm by calculation why unlikely but harmful futures must be taken into account
  • Estimate with simple formulas why deciding early allows gentler stops, and what following distance lets you stop even if the car ahead brakes hard

Build intuition

This lesson is about what goes on inside the “planning” stage of 4.2. A skilled driver who sees a pedestrian near a crosswalk thinks “they might cross” and slows down early. An automated driving system likewise first predicts how surrounding vehicles and pedestrians will move, and then plans its own way of driving on that basis.

The key to prediction is not to fix the future to a single outcome. A person standing still on the pavement may keep waiting — or may start to cross. So predictions are usually given as several futures with probabilities, such as “waits 70%, crosses 30%” (multimodal prediction). Machine learning trained on past driving data is often used to predict how surrounding vehicles will move.

Planning is broadly divided into three levels:

LevelWhat it decidesExampleReplanning interval (rough)
Route planningThe roads to the destinationA satnav’s route searchMinutes or more (changed for congestion or closures)
Behaviour decisionWhat to do nextFollow the car ahead, change lanes, stop, give waySeconds
Trajectory planningPosition and speed for the next few secondsA smooth way of driving such as “25 m ahead at 20 km/h in 3 seconds”About 0.1 s

Trajectory planning generates many candidate ways of driving, evaluates each for “danger”, “comfort”, “progress” and “traffic rules”, and chooses the best. Each time new measurements and predictions come in, it plans again.

Distance travelled (m) 0 10 20 30 40 0 1 2 3 4 5 6 Time (s) crosswalk blocked if crossing (30%) A: keep speed B: stop before the crosswalk
Ways of driving drawn as time (across) against distance travelled (up). The slope of a line is the speed, and a flat line means stopped. Choose a way of driving that stays out of the region the prediction says may be blocked (example at 12 m/s, about 43 km/h).

Check with math

① Comparing futures with probabilities by expected cost

In the scene in the figure, compare option A (keep the current speed) with option B (stop before the crosswalk). Express how bad each outcome is as a number called its cost, and compare using the expected value of 1.4:

$$E[\text{cost}] = \sum_i p_i\,c_i$$
OptionPedestrian crosses (30%)Does not cross (70%)Expected cost
A: keep speed1000 (risk of a collision)00.3 × 1000 = 300
B: stop before the crosswalk3 (stop and wait)3 (stopped needlessly)3

The cost values are illustrative weights. B, with the smaller expected cost, is chosen. A would only be better if 1000p < 3 — that is, if the probability p of crossing were below 0.3%. Even when unlikely, a future with great harm weighs heavily on the decision. Planning only for the most likely future (no crossing) would lead to choosing A.

On the other hand, a vehicle that stops whenever there is the slightest possibility would never get anywhere. What weights to give harm and delay is itself a judgement about how to balance safety against progress. In practice there is also an intermediate option — “slow down and see” — and because the plan is redone every 0.1 s, the decision can be deferred a little.

② The earlier the decision, the gentler the stop

For option B, the deceleration needed to stop within d metres from 12 m/s comes from solving the braking-distance formula of 0.2, \(s = v^2/(2a)\), for a:

$$a = \frac{v^2}{2d}$$

Deciding to stop now gives d = 28 m and a = 144 ÷ 56 ≈ 2.6 m/s² (braking that does not alarm the occupants). Hesitating for 1 second means travelling 12 m in the meantime, so d = 16 m and a = 144 ÷ 32 = 4.5 m/s² — hard braking. Hesitating 2 seconds gives d = 4 m and a = 18 m/s², a deceleration impossible even on a dry road (the limit is around 8 m/s²). Noticing risks early through prediction is the key to stopping gently and safely.

③ A following distance that lets you stop even if the car ahead brakes hard

How much gap to leave when following another car can also be set by formula. The gap that lets the vehicle stop — even if the car ahead brakes with its maximum deceleration \(a_f\), and the vehicle itself brakes only after a response time ρ with a deceleration \(a_r\) it can reliably achieve — is

$$d_{\min} = v_r\,\rho + \frac{v_r^2}{2\,a_r} - \frac{v_f^2}{2\,a_f}$$

(\(v_r\) is the vehicle’s own speed and \(v_f\) that of the car ahead). It is the distance the vehicle travels before stopping minus the distance the car ahead travels before stopping. This is a simplified version of the central formula of an approach called RSS (Responsibility-Sensitive Safety). With both at 25 m/s (90 km/h), ρ = 0.5 s, \(a_r = 4\ \mathrm{m/s^2}\) and \(a_f = 8\ \mathrm{m/s^2}\),

$$d_{\min} = 12.5 + \frac{625}{8} - \frac{625}{16} \approx 12.5 + 78.1 - 39.1 \approx 52\ \text{m}$$

This is almost the same as the “two-second gap” often recommended in driving manuals (50 m at 25 m/s).

Connection to SOTIF and safety

  • Plan on the assumption that predictions will be wrong: plan so that there is room to stop safely whichever plausible future comes true, including unlikely ones. Also remember that there are behaviours nobody has yet anticipated (wrong-way driving, sudden crossings). → 5.2 The four areas
  • Too much caution is dangerous too: unnecessary emergency stops can lead to rear-end collisions from following vehicles and confusion in surrounding traffic. Like the balance between misses and false alarms in 2.7, the choice of weights in ① is a judgement whose basis should be explainable. → 2.7, 5.5 Acceptance criteria and validation targets
  • Prediction models also learn from data: they learn the driving habits of the region their training data came from, so predictions become unreliable in another country or region, or when meeting unfamiliar behaviour. → 2.8
  • A “safety envelope” that checks the plan from outside: a formula such as ③ is used to check separately whether the planned trajectory keeps a safe gap and so on, replacing it with a safe trajectory if not. Even when the inner workings of a complex planner cannot all be verified, safety is kept from the outside. → 4.2, 4.7 Three pillars of safety
  • Gather and test the hard situations: situations where prediction and planning are difficult — cut-ins, people stepping out, junctions with poor visibility — are collected and tested while varying the conditions. → 5.6 Scenario-based testing

Summary

  • Planning consists of predicting others’ motion and planning the route, behaviour and trajectory. Predictions are treated as several futures with probabilities; candidate manoeuvres are evaluated by cost and chosen, and the plan is redone in a short cycle
  • Even when unlikely, a harmful future raises the expected cost. The earlier the decision, the gentler the braking needed to stop (a = v²/2d)
  • The following distance that lets you stop even if the car ahead brakes hard can be set by formula from the response time and both vehicles’ braking (the idea behind RSS). Watching the plan with such a “safety envelope” leads to safety

Quick quiz

Q1. In example ② (12 m/s), if the decision to stop is made 20 m before the crosswalk, what deceleration is needed?

a = 12² ÷ (2 × 20) = 144 ÷ 40 = 3.6 m/s² — harder braking than when deciding 28 m before (about 2.6 m/s²).

Q2. In example ①, if the probability of the pedestrian crossing were 1%, what would the expected costs of A and B be? Which would be chosen?

A is 0.01 × 1000 = 10 and B is 3, so B (stop) is chosen — just as the calculation says B is better whenever the probability exceeds 0.3%.

Q3. Using the formula in ③, with both vehicles at 20 m/s, a response time of 0.5 s, a_r = 4 m/s² and a_f = 8 m/s², what gap is needed?

20 × 0.5 + 400 ÷ 8 − 400 ÷ 16 = 10 + 50 − 25 = 35 m.

Q4. “It is enough to plan using only the most likely future in the prediction.” What is wrong with this idea?

It ignores futures that are unlikely but very harmful, like the 30% chance of someone stepping out. Several futures must be taken into account, leaving room to stop safely whichever one comes true.

Further reading