Self-Driving Car Engineer Nanodegree Program
The included source implements the extended 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 source can be compiled without error using cmake
and make
.
The source can be compiled without error using Microsoft Visual Studio.
Data set 1 RMSE: 0.0651795 0.0605726 0.544212 0.544226
Data set 2 RMSE: 0.185791 0.190311 0.474852 0.805316
Data set 1 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 EKF estimate of position.
Important: A modified kalman_tracker.py
script is included.
Usage: python kalman_tracker.py src/ExtendedKF.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 EKF 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 deal 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, you may need to run:
cmake .. -G "Unix Makefiles" && make
- On windows, you may need to run:
- Run it:
./ExtendedKF path/to/input.txt path/to/output.txt
. Sample inputs can be found in 'data/'.- eg.
./ExtendedKF ../data/sample-laser-radar-measurement-data-1.txt output.txt
- eg.
A debug version can be made using: cmake -DCMAKE_BUILD_TYPE=Debug .. && make
Conforms to Google's C++ style guide.