Self-Driving Car Engineer ND Program
In this project we utilize Kalman Filter (KF) and Extended Kalman Filter (EKF) to estimate the state of a moving object of interest with noisy LIDAR and RADAR measurements.
LIDAR (LIght Detection And Ranging):
linear measurement function -> KF
RADAR (RAdio Detection And Ranging):
nonlinear measurement function -> EKF
H is the matrix that projects current state into the measurement space. For RADAR, H is nonlinear, we need to linearize it by Jacobian, which is EKF.
If we were in an autonomous vehicle tracking a bicycle, pedestrian or another car, we would not be able to model the internal forces of the other object; hence, we do not know for certain what the other object's acceleration is. Instead, we will ignore the control input and represent acceleration as a random noise.
This project uses the Term 2 Simulator which can be downloaded here.
This repository includes two files that can be used to set up and install 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. Please see this concept in the classroom for the required version and installation scripts.
Once the install for uWebSocketIO is complete, the main program can be built and run by doing the following from the project top directory.
- mkdir build
- cd build
- cmake ..
- make
- ./ExtendedKF
INPUT: values provided by the simulator to the c++ program
["sensor_measurement"] => the measurement 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"]
Refer Udacity link's Other Important Dependencies section.
After having the dependencies above met :
- 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
- src/main.cpp : Read the sensor data line by line from the client and stores the data into a measurement object that it passes to the Kalman filter for processing. Also a ground truth list and an estimation list are used for tracking RMSE.
- src/FusionEKF.cpp :
- initialized variables and matrices
- update the F and Q matrices based on the elapsed time between measurements
- update step for lidar or radar sensor measuremen
- kalman_filter.cpp : implement the prediction and update equations.
- tools.cpp : implemented functions to calculate root mean squared error and the Jacobian matrix.