lucascoelhof / CarND-Extended-Kalman-Filter-Project

An Extended Kalman Filter Project implemented during my Self-Driving Car Nanodegree

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extended Kalman Filter Project

Udacity Self-Driving Car Engineer Nanodegree Program

In this project, I implemented a Kalman Filter to estimate the state of a moving car. This car has two sensors, a Laser and a Radar, and both measurements are noisy. The objective is to use a Kalman Filter to combine the two measurements and have an improved measurement that is more accurate.

Implementation

The implementation involved creating the equations for a Kalman Filter and a Extended Kalman filter (available here). The setup of the Kalman Filter, initialization, prediction step and update step can be found here. There is also a file with common tools used on the code here.

To comply with the requirement of the project, I tried to make the code as efficient as possible, and also avoid type conversions. I replaced all float references to double, to avoid precision loss between calculations. In my experimentation, I noticed that this created a lot of impact, making my error reduce 50% during validation phase.

Results

Here you can check out a video of the implementation:

Self driving

The red and blue points are radar and laser measurements, and the green points are the output of the Kalman filter. On the right, we can see the error values for the filter. On final time step, we can see that the error is below the error requirements.

Try it yourself

In my case, I found easier to use a Ubuntu virtual machine that I already had with the simulator running on Windows. So I had to set up a port forwarding. Here is an article about that.

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

Other Important Dependencies

About

An Extended Kalman Filter Project implemented during my Self-Driving Car Nanodegree

License:MIT License


Languages

Language:C++ 98.5%Language:C 1.2%Language:CMake 0.2%Language:Shell 0.1%