The project "unscented Kalman filter (UKF)" is based on the same structure as the extended Kalman filter. It uses a main file that calls a function called ProcessMeasurement. Anything important happens in this function. The function is part of the class UKF.
UKF consists of the prediction with a process model and the update with a measurement model. The prediction is characterized generating sigma points, predicting sigma points, and predicting mean and covariance. The update updates the state and the covariance based on the measurement from RADAR and LIDAR sensors.
- cmake >= v3.5
- make >= v4.1
- gcc/g++ >= v5.4
- Clone this repo.
- Make a build directory:
mkdir build && cd build
- Compile:
cmake .. && make
- Run it:
./UnscentedKF path/to/input.txt path/to/output.txt
. You can find some sample inputs in 'data/'../UnscentedKF ../data/sample-laser-radar-measurement-data-1.txt ukfoutput1.txt
./UnscentedKF ../data/sample-laser-radar-measurement-data-2.txt ukfoutput2.txt
Whenever the code is modified, repeat Steps 3 and 4.
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 stick to Google's C++ style guide as much as possible.
When we run ./UnscentedKF ../data/sample-laser-radar-measurement-data-1.txt ukfoutput1.txt
, it returns:
and ./UnscentedKF ../data/sample-laser-radar-measurement-data-2.txt ukfoutput2.txt
returns
Fig 1 shows the position tracking result from data-1 fed into my UKF system. As can be seen, overall positions are well estimated besides the very first estimate.
Fig 2 shows the velocity tracking result from data-1. The velocity represents the hidden state. As can be seen, velocity estimates generally follow ground truth.