Skip to content

hankkkwu/SDCND-P5-Extended_Kalman_Filters

Repository files navigation

Extended Kalman Filter Project

Self-Driving Car Engineer Nanodegree Program

In this project I utilize a kalman filter to estimate the state of a moving object of interest with noisy lidar and radar measurements. You can find the project code in src folder.

Here is the video of how my my code work in the simulator: (Lidar measurements are red circles, radar measurements are blue circles with an arrow pointing in the direction of the observed angle, and estimation markers are green triangles.)

result video

Installation and environment set up for Windows 10 users

This project involves the Term 2 Simulator which can be downloaded here.

For windows you can use either Docker, VMware, or even Windows 10 Bash on Ubuntu to install uWebSocketIO.

Here's steps for Ubuntu BASH:

  • Follow this step by step guide for setting up the utility.
  • After setting up Ubuntu BASH, open Ubuntu Bash, and run the following commands inside the Linux Bash Shell:
  1. sudo apt-get update
  2. sudo apt-get install git
  3. sudo apt-get install cmake
  4. sudo apt-get install openssl
  5. sudo apt-get install libssl-dev
  6. sudo apt install zlib1g-dev
  7. git clone https://github.com/hankkkwu/SDCND-P5-Extended_Kalman_Filters.git
  8. sudo rm /usr/lib/libuWS.so
  9. navigate to SDCND-P5-Extended_Kalman_Filters
  10. ./install-ubuntu.sh
  11. at the top level of the project repository mkdir build && cd build
  12. from /build cmake .. && make
  13. Launch the simulator from Windows and execute ./ExtendedKF for the project. If you see this message Listening to port 4567 Connected!!!, it is working!!
  • Trouble Shooting

    • .sh files not recognized on run: Try chmod a+x <filename.sh> for example chmod a+x install-ubuntu.sh

Installation and environment set up for Mac uers

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.

From the project repository directory run the script: install-mac.sh

Some users report needing to use cmakepatch.txt which is automatically referenced and is also located in the project repository directory.

  • Trouble Shooting

    • .sh files not recognized on run: Try chmod a+x <filename.sh> for example chmod a+x install-mac.sh

    • missing openssl, libuv, or cmake: install-mac.sh contains the line brew install openssl libuv cmake, which will not execute properly if homebrew is not installed. To determine if homebrew is installed, execute which brew in a terminal. If a path returns it is installed, otherwise you see brew not found. Follow the guidance here to install homebrew, then try running install-mac.sh again.

Other Important Dependencies

Basic Build Instructions

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. Clone this repo.
  2. Make a build directory: mkdir build && cd build
  3. Compile: cmake .. && make
  4. Run it: ./ExtendedKF

Here is the main protocol that main.cpp uses for uWebSocketIO in communicating with the simulator.

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

Generating Additional Data

This is optional!

If you'd like to generate your own radar and lidar data, see the utilities repo for Matlab scripts that can generate additional data.

Hints and Tips!

  • Students have reported rapid expansion of log files when using the term 2 simulator. This appears to be associated with not being connected to uWebSockets. If this does occur, please make sure you are conneted to uWebSockets. The following workaround may also be effective at preventing large log files.

    • create an empty log file
    • remove write permissions so that the simulator can't write to log

About

Implemented Extended Kalman Filter to track a moving object.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages