This project utilizes an Unscented Kalman Filter to estimate the state of a moving object of interest with noisy lidar and radar measurementsand obtaining RMSE values that are lower that the tolerance outlined in the project rubric.
In order to validate the Unscented Kalman Filter performance, the filter was applied in three scenarios. While using: both the radar and lidar sensors, only the lidar sensor and only the radar sensor. After comparing the three respective oucomes we validate that the fusion of both the radar and lidar sensors provided the best result.
Simulation with both Radar and Lidar - On: youtube video
Simulation with only the Lidar - On: youtube video
Simulation with only the Radar - On: youtube video
The table below summarizes the results for the three runs. It is clear that sensor fusion provided the best results for all the RMSE values (X, Y, VX, VY):
Sensor | X | Y | VX | VY |
---|---|---|---|---|
Both | 0.0890 | 0.0947 | 0.3949 | 0.2078 |
Lidar | 0.1090 | 0.1109 | 0.4554 | 0.2679 |
Radar | 0.2285 | 0.2227 | 0.4423 | 0.3913 |
The program calculates the NIS as can be seen in the following sample run:
The NIS distribution follows the table below with df = 3
for the radar and df = 2
for the lidar.
df | x^2.950 | x^2.900 | x^2.100 | x^2.050 |
---|---|---|---|---|
2 | 0.103 | 0.211 | 4.605 | 5.991 |
3 | 0.352 | 0.584 | 6.251 | 7.815 |
From the sample run we can see that we are slightly underestimating the lidar performance since only 3.212% percent of the measurements exceed the 5% line. However, the radar NIS is 4.819% which is very close to 5%.
The results that we obtained using the unscented kalman filter are sligthly better than the results that we got using the extended kalman filter on the same set of data.
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 install 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.
- 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
- On windows, you may need to run:
cmake .. -G "Unix Makefiles" && make
- Run it:
./UnscentedKF
$ mkdir build && cd build
$ cmake .. && make
$ ./UnscentedKF
Note: If you want to run the program with different sensor configuration see the ./src/constants.h
file.
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 measurement 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"]
If you'd like to generate your own radar and lidar data, see the utilities repo for Matlab scripts that can generate additional data.