Self-Driving Car Engineer Nanodegree Program
This project utilizes an Unscented Kalman Filter to estimate the state of a moving object of interest with noisy lidar and radar measurements.
This project involves the Term 2 Simulator which can be downloaded here
This repository includes two files that can be used to set up and intall uWebSocketIO for either Linux or Mac systems. For windows you can use either Docker, VMware, or even Windows 10 Bash on Ubuntu to install uWebSocketIO.
Once the install for uWebSocketIO is complete, the main program can be built and ran by doing the following from the project top directory.
- mkdir build
- cd build
- cmake ..
- make
- ./UnscentedKF
Tips for setting up your environment can be found here
INPUT: values provided by the simulator to the c++ program
["sensor_measurement"] => the measurment that the simulator observed (either lidar or radar)
OUTPUT: values provided by the c++ program to the simulator
["estimate_x"] <= kalman filter estimated position x ["estimate_y"] <= kalman filter estimated position y ["rmse_x"] ["rmse_y"] ["rmse_vx"] ["rmse_vy"]
- 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
- Run it:
./UnscentedKF
Previous versions use i/o from text files. The current state uses i/o from the simulator.
The 3 important steps are
-
Initializing the matrices
On the first measurment we will update the state and covariance matrix.
-
Predict the state
Compute the time elapsed between previous and current measurment.
Use the time difference to compute the state and covariance matrix.
Predict the new state and covariance
-
Update the state
If the measurement is from Laser, set up the Laser matrices and update the new measurment.
If the measurement is from Radar, convert to linear, set up the Radar matrices and update the new measurement.
Lidar measurements are red circles, radar measurements are blue circles with an arrow pointing in the direction of the observed angle, and estimation markers are green triangles.