Skip to content

Extended Kalman Filter for self-driving cars with noisy LIDAR and RADAR measuremets in c++

Notifications You must be signed in to change notification settings

shaoyuanxun/CarND-Extended-Kalman-Filter-Project

Repository files navigation

Extended Kalman Filter Project.

Self-Driving Car Engineer ND Program

1. Overview

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.

2. Sensor Comparison

alt text LIDAR (LIght Detection And Ranging):
linear measurement function -> KF

RADAR (RAdio Detection And Ranging):
nonlinear measurement function -> EKF

3. Sensor Fusion Process

alt text

3.1 Kalman Filter Scheme

alt text 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.

4. Setting Up

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.

  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"]


5. Other Important Dependencies

Refer Udacity link's Other Important Dependencies section.

5.1 Basic Build Instructions

After having the dependencies above met :

  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

5.2 Project Implementation details.

  • 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 :
    1. initialized variables and matrices
    2. update the F and Q matrices based on the elapsed time between measurements
    3. 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.

About

Extended Kalman Filter for self-driving cars with noisy LIDAR and RADAR measuremets in c++

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages