Skip to content

Unscented Kalman Filter Project for UDACITY Self-driving Car Nanodegree

License

Notifications You must be signed in to change notification settings

camigord/Unscented-Kalman-Filter

Repository files navigation

Unscented Kalman Filter Project

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.

  1. cd build
  2. cmake ..
  3. make
  4. ./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.

Other Important Dependencies

Tuning process noise

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.

Overestimating uncertainty Underestimating uncertainty Tuning noise parameters
σlongitudinal acceleration = 30 m/s2
σyaw acceleration = 30 rad/s2
σlongitudinal acceleration = 0.1 m/s2
σyaw acceleration = 0.1 rad/s2
σlongitudinal acceleration = 1 m/s2
σyaw acceleration = 0.8 rad/s2

RMSE results before and after tuning

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

Comparing UKF to EKF

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.

UKF performance

Here we can compare the UKF estimates to the ground truth provided by the simulator.

Which sensor is better?

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.

About

Unscented Kalman Filter Project for UDACITY Self-driving Car Nanodegree

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published