/CarND-Extended-Kalman-Filter-Project

Self-Driving Car Nanodegree Program Starter Code for the Extended Kalman Filter Project

Primary LanguageC++MIT LicenseMIT

Extended Kalman Filter Project

Self-Driving Car Engineer Nanodegree Program (Udacity Starter Code)

In this project we utilize a kalman filter to estimate the state of a moving object of interest with noisy lidar and radar measurements. Passing the project requires obtaining RMSE values that are lower than the tolerance outlined in the project rubric.

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 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 the uWebSocketIO Starter Guide page in the classroom within the EKF Project lesson 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.

  1. mkdir build
  2. cd build
  3. cmake ..
  4. make
  5. ./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"]


Dependencies

Basic Build Instructions

  1. Clone this repo.
  2. Make a build directory: mkdir build && cd build
  3. Compile: cmake .. && make
    • On windows, you may need to run: cmake .. -G "Unix Makefiles" && make
  4. Run it: ./ExtendedKF

My Simulator and Environment Set-up (Ubuntu 20.04.1 LTS)

Simulator Setup

The instructions are from here.

  1. Download the (.deb) package of Unity (3D) version 5.5.1f1 that the Udacity Simulator uses.
  2. Install dependencies : sudo apt install gconf-service lib32gcc1 lib32stdc++6 libc6-i386 libgconf-2-4 npm
  3. Run the install : sudo dpkg -i ~/Downloads/unity-editor_amd64-5.5.1xf1Linux.deb
  4. If you get error about unmet dependencies you may need to run, and retry sudo apt --fix-broken install
  5. With Unity working now, download and run the latest release of the Udacity Term 2 Simulator.

Environment Setup

I used VSCode IDE for this project. Follow the thorough instructions provided by yosoufe to setup the environment. The instructions cover debugging as well which maybe useful.

Results

I ran the simulation four times:

  1. Dataset1, using lidar and radar
  2. Dataset1, using lidar only
  3. Dataset1, using radar only
  4. Dataset2, using lidar and radar

The output files and plotting script are in the ./output_files folder.

Dataset1, using both the lidar and radar (lidar = true, radar = true)

The conde works well, with RMSE = [0.0964425, 0.0852905, 0.415426, 0.431636]. Check output file.

The simulator output is shown below :

Position RMSE

Dataset1, using lidar alone (lidar = true, radar = false)

The predictions are slightly worse, with RMSE = [0.146952, 0.115285, 0.609732, 0.537763]. Check output file.

The simulator output is shown below :

Position RMSE

Dataset1, using radar alone (radar = true, lidar = false)

The predictions are the worst of the three options, with RMSE = [0.22789, 0.346044, 0.572788, 0.796972]. Check output file.

The simulator output is shown below :

Position RMSE

Dataset2, using both the lidar and radar (lidar = true, radar = true)

The predictions for dataset2 are about as good as those for datase1 while using lidar and radar measurements, with RMSE = [0.0725678, 0.0964738, 0.421634, 0.493199]. Check output file.

The simulator output is shown below :

Position RMSE