Self-Driving Car Engineer Nanodegree Program
The goal of this project is to build an Unscented Kalman Filter using C++ and use it to estimate the state of a moving object of interest with noisy LIDAR and RADAR measurements.
The measurements data is provided in the form of a simulator.
The key metrics are RMSE values for both position and velocity of the tracked object.
The success metrics for this project are the RMSE values.
The values shoule be below:
0.09
forP x
,0.10
forP y
,0.40
forV x
,0.30
forV y
.
The folowing table lists the results of both datasets:
RMSE | Dataset 1 |
---|---|
P x | 0.0606247 |
P y | 0.0860925 |
V x | 0.329898 |
V y | 0.213063 |
As we can see the results are below the desired values indicating a successful Unscented Kalman Filter implementation.
A run with only one sensor, radar
or lidar
was also measured.
You can test this yourself by setting the vars
use_laser_
anduse_radar_
insrc/ukf.cpp
.
Here are the results:
RMSE | only RADAR | only LIDAR |
---|---|---|
P x | 0.155448 | 0.100553 |
P y | 0.200174 | 0.0981127 |
V x | 0.362301 | 0.60588 |
V y | 0.320537 | 0.238563 |
Interesting points here:
- With only
Radar
data the results are worse then with both sensors but quite similar in terms of velocityVx
. - With only
Lidar
data the positionPx
andPy
are far better then with onlyRadar
, velocityVx
is 2x worse andVy
is ~30% better - Overall the performance with a single sensor is worse than with both, as we would expect.
With both
Radar
andLidar
data.
The red and blue dots are the Radar and Lidar measurements and the green dots the predicted position.
The code skeleton for this project was provided by udacity on this repo.
The main program in under the src
directory.
.
├── json.hpp
├── main.cpp
├── measurement_package.h
├── tools.cpp
├── tools.h
├── ukf.cpp
└── ukf.h
The main changes were to the folowing files:
ukf.cpp
- initializes the Unscented Kalman filter, calls the predict and update function, defines the predict and update functionstools.cpp
- function to calculate RMSE
The code is not tested at the moment, this is somthing I want to add in the future using Google's gTest framework.
- 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
- On windows, you may need to run:
- Run it:
./UnscentedKF
Previous versions use i/o from text files. The current state uses i/o
We've purposefully kept editor configuration files out of this repo in order to keep it as simple and environment agnostic as possible. However, we recommend using the following settings:
- indent using spaces
- set tab width to 2 spaces (keeps the matrices in source code aligned)
Please (do your best to) stick to Google's C++ style guide.