Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Unscented Kalman Filter Project

Self-Driving Car Engineer Nanodegree Program


Overview

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

Compilation

The source can be compiled without error using cmake and make using mingw on the PC.

Kalman filter cmd compile

The source can be compiled without error using Microsoft Visual Studio on the PC.

Kalman filter mvs compile

The source can be compiled without error using cmake and make on the Macintoch.

Kalman filter cmd compile

Results for Included Data Set

RMSE: 0.0684014 0.0825572 0.336129 0.218017

Screenshot from PC:
Kalman filter results

Screenshot from Macintosh:
Kalman filter results

Results Visualization

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.

Kalman filter results visualization

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.

Kalman filter results visualization

2-D Unity Visualizer

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:
Unity visualization LR


2 of 3: Below is the result with only Radar enabled:
Unity visualization R


3 of 3: Below is the result with only Lidar enabled:
Unity visualization L

Dependencies

Basic Build Instructions

  1. Clone this repo.
  2. Make a build directory: mkdir build && cd build
  3. Compile: cmake .. && make
    • On windows: cmake .. -G "Unix Makefiles" && make
  4. 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

A debug version can be made using: cmake -DCMAKE_BUILD_TYPE=Debug .. && make

Code Style

Conforms to Google's C++ style guide.