From Coursera, State Estimation and Localization for Self-Driving Cars by University of Toronto

https://www.coursera.org/learn/motion-planning-self-driving-cars

## Dynamic Object Interactions

### Motion Prediction

**Definition**

- Motion prediction of the dynamic object’s attempts to estimate the future position, heading and velocity
- Important as it allows:
- Planning a set of maneuvers to correctly interact with dynamic objects
- Avoid collisions on a planned trajectory

**Requirements for Motion Prediction Models**

- Mandatory Requirements:
- Class of the Dynamic Object
- Current dynamic object states: position, heading and velocity

- Optional Requirements:
- History of Vehicle states: the position, heading and velocity
- Requires object tracking States between identifications over a set amount of time

- Current high definition roadmap
- Image of the current dynamic object

- History of Vehicle states: the position, heading and velocity

**Assumptions in Motion Prediction for simplification**

- Cars
- Physics-based prediction: vehicles must follow a set of physical constraints governing their movement, e.g. Vehicle Kinematics and Dynamics
- Maneuver-based assumptions: all motions by a vehicle on the road are made up of a finite set of maneuvers in a restricted domain in the environment, e.g. vehicles on the road will stay on the road and follow the driving rules like unlikely to drive over sidewalks or lawns or through obstacles
- Interactions-aware Assumptions: incorporate the assumption that the dynamic objects will react and interact with each other. e.g. the vehicle in the destination lane will slow down to make more room for the incoming vehicle to maintain a safe following distance.

- Pedestrians:
- the same three categories assumptions as the cars
- Pedestrians are unpredictable
- Can rapidly change speed and heading
- Pedestrians use crossings Pedestrians use sidewalks
- Pedestrians have right of way, but will stop if threatened

**Constant Velocity Prediction Model**

- Simple
- Computationally efficient
- Assumption is that the dynamic object will maintain its
- velocity
- Magnitude
- Heading

Algorithm:

- Input:
- $T$: time horizon to predict over
- $dt$: time between predictions
- $x_{obj}$: current dynamic object state
- Position: $x_{obj}.pos$
- Velocity: $x_{obj}.vel$

- Output:
- $x_{1:T}$: list of future vehicle states

1 | $t <- 0$ |

Issues

- Don’t account for Vehicle Dynamics fully
- Don’t account for the Road (Position,adjustment)
- Don’t account for Road Signs(Velocity adjustment)
- Assumptions are too Strong and Incorrect for most Dynamic Object Motion

### Map-Aware Motion Prediction

**Assumptions to Improve Prediction**

- Positional Assumptions
- Vehicles on driving lane usually follow the given drive lane
- Changing drive lanes is usually prompted by an indicator signal

- Velocity Assumptions
- Vehicles usually modify their velocity when approaching restrictive geometry(tight turns)
- Vehicles usually modify the velocity when approaching regulatory elements

**Improvement of Position Estimation**

- Roadways with natural curvature
- Vehicles on drive lane usually follow the given drive lane
- The predicted path is set to follow the center of the driving lane which the dynamic vehicle is on

**Improvement of Path Prediction**

- Problems with the model:
- Difficult to predict lane change maneuvers without extra information
- Multiple possible lanelets such as when on an intersection

- Solution with the model:
- Most likely prediction
- Multi-hypothesis prediction

**Multi-hypothesis Approach**

- Consider the range of all possible motions
- Left, right, stay stopped

- Provides more information to local planner
- Safer due to human error (forgotten turn signal)

**Improvements to Velocity Prediction**

- Road curvature can be used to improve the velocity prediction over the path
- Improve the velocity prediction based on regulatory elements in the environment
- Stop locations, deceleration profiles
- Lanelet priors

### Time to Collision

**Definition of Time to Collision**

- Assuming all dynamic object continue along their predicted path:
- Will then be a collision between any of the objects?
- If so how far into the future?

- Time to Collision is comprised of:
- Collision point between the two dynamic objects
- Prediction of the time to arrive to the collision point

- Requirements for Accuracy:
- Accurate predicted trajectories for all dynamic objects (position, heading and velocity)
- Accurate dynamic objects geometries

**Approaches to calculate time to collision**

- Two basic approaches to calculating time to collision:
- Simulation approach
- Estimation approach

- Simulation approach
- Simulate the movement of each vehicle as time passes
- Taking account of the vehicle model over time
- Checking if any part of the two dynamic object has collided

- Estimation approach
- Geometries of the vehicles are approximated over duration of the predicted path
- Collision point is estimated based the cars predictions
- Many assumptions are usually made by this method usually to estimate time to collision

**Relative Strengths and Weaknesses**

- Simulation Approach Estimation Approach
- Computationally expensive
- Higher accuracy if simulated with high fidelity
- Offline Applications (Dataset evaluation or Simulations)

- Estimation Approach
- Computationally inexpensive
- Memory footprint
- Computational time

- Less accurate due to approximations and estimations
- Real Time Applications(In Car Prediction)

- Computationally inexpensive

**Simulation approach Pseudocode**

Inputs:

- $D$: list of all dynamic objects
- Predicted paths

- $dt$: time between simulation steps
- $N_c$: number of circles for collision approximation

Outputs: - $P_{coll}$: list of all collision points
- $TTC$: list of all times to collision points

**Estimation of Dynamic Object State**

- Each predicted vehicle state has a predicted time at each location
- Find the closest vehicle state along the predicted path to the current simulation time
- Efficient Collision Detection Method
- Represent each car as a set of circles
- Check if a collision will occur between two circles $$d_{i,j} = \sqrt{(x_j - x_i)^2+(y_j -y_i)^2} \quad r_i + r_j \gt d_{i,j}$$
- Calculate collision point $$C_x = \frac{(x_i
*r_j)+(x_j*r_i)}{(r_i+r_j)}, C_y = \frac{(y_i*r_j)+(y_j*r_i)}{(r_i+r_j)} $$ - Tradeoff between:
- Accuracy
- Number of computations