Kalman Filter Made Easy
It is an iterative process that uses two step predict and update.
It is mostly suitable for these type of operations because of the following factors :
- It predict the next state based on the previous state only , no need of the history of data
- computationally very fast making it well suitable for real time problems
- even if lots of noise/error/uncertainty occurs in the environment, Kalman filter will give a good result using Gaussian distribution.
Predict :
In this step the Kalman Filter predict the new values from the initial value and then predict the uncertainity/error/variance in our prediction according to the various process noise present in the system.
In autonomous vehicle process noise can be understood by taking a simple example of a car moving infront of our vehicle. Our model will assume the car to move with a constant velocity due to zero acceleration but in reality it will have acceleration i.e it speed will fluctuate from time to time. This change in acceleration of that car is the uncertainity/error/variance and we introduce it to our system using process noise.
Update :
In this step we take the actual measured value from the devices of the system . In case of autonomous vehicle these devices can be radar or Lidar .We then calculate the difference between the predicted value and the measured value and then decide which value to keep i.e predicted value or measured value by calculating the Kalman Gain. Based upon the decision made by the kalman gain we calculate the new value and and new uncertainty/error/variance .
This output from the update step is again fed back to the prediction step and the process continues till the difference between the predicted value and the measured value tend to convert to zero.This calculated value will be the prediction/educated guess done by the Kalman Filter.
Kalman Gain : It determines whether our predicted or measured value is close to the actual value . Its value ranges from 0 to 1 . If its value is near to 0 then it means predicted value is close to the actual value or if the value is near to 1 then it means final measured value is close to the actual value. Its value ranges from 0 to 1 because it uses the uncertainity/errors in the predicted and the measured value and is represented by the simple formula as show below.
K = Error In Prediction / (Error in Prediction + Error in Measurement)