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.
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.
Here you can check out a video of the implementation:
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.
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.
- mkdir build
- cd build
- cmake ..
- make
- ./ExtendedKF
- 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