If an obstacle has been detected on the planned trajectory, we want the car to decrease speed with a constant negative acceleration.
A very simple approach is using the distance to the obstacle, assuming the obstacle is static.
A drawback of not using the speed of an object is that the braking distance is too long or too short, because the obstacle might have moved while approaching it.
Further, usually one does not want to brake directly in front of the obstacle but to keep a safety distance.
The following paragraphs will discuss the different cases and resulting equations.