Self-Driving Car Engineer Nanodegree Program
Implementing an Unscented Kalman filter to estimate the state of a moving object with noisy LiDAR and radar measurements. The project employs the simulation environment provided by UDACITY which can be downloaded from here.
This repository includes two files that can be used to set up and intall uWebSocketIO for either Linux or Mac systems. For windows you can use either Docker, VMware, or even Windows 10 Bash on Ubuntu to install uWebSocketIO.
Once the install for uWebSocketIO is complete, the main program can be built and ran by doing the following from the project top directory.
- cd build
- cmake ..
- make
- ./UnscentedKF output_file_name.txt
NOTE: The script will save all the data in the provided output file in order to analyze the results and generate the figures below. The files Tuning_NIS.ipynb and Visualizing.ipynb can be used to visualize the filter performance and interact with the figures.
- cmake >= 3.5
- All OSes: click here for installation instructions
- make >= 4.1 (Linux, Mac), 3.81 (Windows)
- Linux: make is installed by default on most Linux distros
- Mac: install Xcode command line tools to get make
- Windows: Click here for installation instructions
- gcc/g++ >= 5.4
- Linux: gcc / g++ is installed by default on most Linux distros
- Mac: same deal as make - install Xcode command line tools
- Windows: recommend using MinGW
It was important to tune the process noise parameters (std_a & std_yawdd) in order to get the filter working properly. NIS (Normalized Innovation Squared) was used to analyze the results and adjust the noise estimates. The main idea is that only around 5% of the NIS values computed after receiving each sensor measurement should be above the 95% confidence line presented in the figures below. Having few points above the line indicate that we may be overestimating the uncertainty in the process, while having too many values indicate the opposite.
Name | RMSE X | RMSE Y | RMSE Vx | RMSE Vy |
Overestimating noise | 0.094 | 0.120 | 0.861 | 0.942 |
Underestimating noise | 0.126 | 0.130 | 0.432 | 0.303 |
Tuning noise parameters | 0.064 | 0.083 | 0.333 | 0.238 |
We can also compare the performance of the UKF with our previous EKF project. The figure below shows that UKF performs significantly better than the EKF, although it is important to clarify that we did not tune the EKF parameters.
Here we can compare the UKF estimates to the ground truth provided by the simulator.
It is hard to say if one sensor in particular is better than the other provided the results below. Radar measurements seem to generate smooth estimates, but LiDAR measurements follow the ground truth more closely (specially during curves). We can conclude, however, that fusing the measurements from both sensors results in more accurate estimates.