Skip to content

Latest commit

 

History

History

CarND-Unscented-Kalman-Filter-Project

Writeup

Udacity - Self-Driving Car NanoDegree

Unscented Kalman Filter Project

The goals of this project are:

  1. Design an Unscented Kalman Filter algorithm to locate a vehicle in a simulated environment.
  2. The vehicle will run against a test data. The algorithm should handle inputs from multiple sensors, in this case a RADAR and LiDAR.
  3. The algorithm's output will be compared to known ground truth and RMSE value should be below a reasonable, known upper bound.

Result

Output video
Project Video

Accuracy

RMSE for x, y, vx, vy is lower than the corresponding upper bounds of [.09, .10, .40, .30].

RMSE

Also, the NIS values for both the sensors seem to be within 95% bound for the corresponding chi squared distribution with appropriate degrees of freedom (3 for the radar and 2 for the laser).

Radar NIS Laser NIS

The values of standard deviations of process noise variables were adjusted intuitively by observing how fast vehicles move and turn in the real world.

Algorithm

Prediction and measurement update logic is clearly outlined in ukf.cpp. There are two different update functions - one for Radar and another for Laser. Thus the filter can accommodate both laser and radar measurements.

The first measurement, whether it is from laser or radar is used to initialize the filter state variable.

Code Efficiency

The code in ukf.cpp computes sensor specific transformation of sigma ponits from (augmented) state to the measurement space and then uses a (somewhat) sensor agnostic function UpdateWithZSigPoints to reduce code duplication.

Build Instructions

This project involves the Term 2 Simulator which can be downloaded 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. Please see this concept in the classroom for the required version and installation scripts.

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

Tips for setting up your environment can be found here

Here is the main protcol that main.cpp uses for uWebSocketIO in communicating with the simulator.

INPUT: values provided by the simulator to the c++ program

["sensor_measurement"] => the measurment that the simulator observed (either lidar or radar)

OUTPUT: values provided by the c++ program to the simulator

["estimate_x"] <= kalman filter estimated position x ["estimate_y"] <= kalman filter estimated position y ["rmse_x"] ["rmse_y"] ["rmse_vx"] ["rmse_vy"]


Other Important Dependencies

Basic Build Instructions

  1. Clone this repo.
  2. Make a build directory: mkdir build && cd build
  3. Compile: cmake .. && make
  4. Run it: ./UnscentedKF Previous versions use i/o from text files. The current state uses i/o from the simulator.

Generating Additional Data

If you'd like to generate your own radar and lidar data, see the utilities repo for Matlab scripts that can generate additional data.