Towards Self-driving Cars, but first, kalman filters

Kalman Filter
A Kalman filter gives us a mathematical way to infer velocity from only a set of measured locations. In this lesson, we'll learn how to create a 1D Kalman filter that takes in positions, like those shown above, takes into account uncertainty, and estimates where future locations might be and the velocity of an object!


Kalman filter assumes a gaussian distribution described below.


Gaussians are exponential function characterized by a given mean, which defines the location of the peak of a Gaussian curve, ad a variance which defines the width/spread of the curve. All Gaussian are:

  • symmetrical
  • they have one peak, which is also referred to as a "unimodal" distribution, and * they have an exponential drop off on either side of that peak
Variance
The variance is a measure of Gaussian spread; the smallest spread is Gaussian B, the largest is Gaussian A. You may also notice that larger variances correspond to shorter Gaussians.
Variance is also a measure of certainty; if you are trying to find something like the location of a car with the most certainty, you'll want a Gaussian whose mean is the location of the car and with the smallest uncertainty/spread. As seen in the answer, below.

For self-driving cars, we would want the uncertainty, and therefore the variance to be very small as much as possible.

In kalman filters, we reiterate between measurement and motion.

So having a priori, the distribution us updated upon measurement, designated by the post 
Combining these two probabilities, we get a probability distribution that is closer to the measurement.
The new peak is actually more certain than the measurement and a priori distribution combined.

Measurement Step in Kalman Filters

To get the new mean and standard deviation, we use the following equations. The updated Gaussian will be a combination of these two Gaussians with a new mean that is in between both of theirs and a variance that is less than the smallest of the two given variances; this means that after a measurement, our new mean is more certain than that of the initial belief!

Motion Update in Kalman Filters

A motion update is just an addition between parameters; the new mean will be the old mean + the motion mean; same with the new variance!

As we estimate the location of a robot or self-driving car:

  • the measurement update increases our estimation certainty
  • the motion update/prediction decreases our certainty
That is because every motion has some chance of under or overshooting its goal, and since motion is not exact, we end up losing some certainty about our exact location after each motion.

The Takeway
The beauty of Kalman filters is that they combine somewhat inaccurate sensor measurements with somewhat inaccurate predictions of motion to get a filtered location estimate that is better than any estimates that come from only sensor readings or only knowledge about movement.


Comments

Popular Posts