In this project a Sensor Fusion Model is implemented in C++ to fuse LIDAR and RADAR sensor data into an Extended Kalman Filter for Localization of a moving car.
Kalman Filter is a loop of 2 Major Steps:
- Predict - Calculated State Vector x_ and State Covariance P_
- Update - Incorporate the new sensor data to the predicted state, and correcting the x_ and P_.
-
Determine dt to further calculate the F and Q matrices.
-
Predict State Vector x to determine x: position, velocity - P: State Covariance
- LIDAR and RADAR prediction functions are the same.
-
Determine whether the detected measurment is from a RADAR or LIDAR sensor:
- RADAR - Using Extended Kalman Filter Equations:
- Convert Input Polar Coordinates to Cartesian using the h function to calculate Error y.
- Calculate Jacobian Matrix H to calculate the Kalman Gain K while maintaining linearity, including the R measurement noise covariance matrix.
- Use calculated y and K to correct for the predicted x and P.
- LIDAR - Using Standard Kalman Filter Equations:
- Directly Calculate the Error y
- Calculate the Kalman Gain Matrix K, including the R measurement noise covariance matrix.
- Use calculated y and K to correct for the predicted x and P.
*For More Information check the source files to review the EKF algorithm.