The goals of this project are:
- Design an Unscented Kalman Filter algorithm to locate a vehicle in a simulated environment.
- The vehicle will run against a test data. The algorithm should handle inputs from multiple sensors, in this case a RADAR and LiDAR.
- The algorithm's output will be compared to known ground truth and RMSE value should be below a reasonable, known upper bound.
Project Video |
RMSE for x, y, vx, vy is lower than the corresponding upper bounds of [.09, .10, .40, .30].
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.
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.
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.
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"]
- 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
- Clone this repo.
- Make a build directory:
mkdir build && cd build
- Compile:
cmake .. && make
- Run it:
./UnscentedKF
Previous versions use i/o from text files. The current state uses i/o from the simulator.
If you'd like to generate your own radar and lidar data, see the utilities repo for Matlab scripts that can generate additional data.