Self-Driving Car Engineer Nanodegree Program
The included source implements the unscented Kalman filter in C++. The data folder contains simulated lidar and radar measurements for an object that travels in a figure eight around a sensor. The Kalman filter estimates the object's position and velocity. The metric used to measure the deviation from the ground truth is root mean square error (RMSE). The metric used to measure consistency is Normalized Innovations Squared (NIS). See: web.stanford.edu/group/arl/sites/default/files/public/publications/Robust_TRN_Framework.pdf
The source can be compiled without error using cmake
and make
using mingw on the PC.
The source can be compiled without error using Microsoft Visual Studio on the PC.
The source can be compiled without error using cmake
and make
on the Macintoch.
RMSE: 0.0684014 0.0825572 0.336129 0.218017
Screenshot from PC:
Screenshot from Macintosh:
The data set result is visualized using a chart in Microsoft Excel. The green line is the ground truth object location. The orange markers are lidar/radar measurements. The blue line is the UKF estimate of position.
The Normalized Innovations Squared result is visualized below using a chart in Microsoft Excel. The green line is the windowed average NIS. The orange markers are single NIS values. The deshed blue line is the 95 percentile NIS threshold of 7.8.
Important: A modified kalman_tracker.py
script is included.
Usage: python kalman_tracker.py src/UnscentedKF.exe
To optimize the Kalman filter program for real-time use with the Unity Visualizer, the Python script adds a flag to the internal command line (subprocess). This instructs the filter program to utilize only the last 10 items of the input file. The RMSE reports in the Visualizer therefore correspond to the 10 most recent measurements.
1 of 3: Below is the fused result of a run with Lidar and Radar enabled. The green markers indicate the UKF estimate of position:
2 of 3: Below is the result with only Radar enabled:
3 of 3: Below is the result with only Lidar enabled:
- cmake >= 3.5
- All OSes: click here for installation instructions
- make >= 4.1
- 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 as make - [install Xcode command line tools]((https://developer.apple.com/xcode/features/)
- Windows: recommend using MinGW
- Clone this repo.
- Make a build directory:
mkdir build && cd build
- Compile:
cmake .. && make
- On windows:
cmake .. -G "Unix Makefiles" && make
- On windows:
- Run it:
./UnscentedKF path/to/input.txt path/to/output.txt
. Sample inputs can be found in 'data/'.- eg.
./UnscentedKF ../data/obj_pose-laser-radar-synthetic-input.txt output.txt
- eg.
A debug version can be made using: cmake -DCMAKE_BUILD_TYPE=Debug .. && make
Conforms to Google's C++ style guide.