Kidnapped Vehicle Project

Udacity - Self-Driving Car NanoDegree

This repository contains all the code for the final project for the Localization course in Udacity’s Self-Driving Car Nanodegree.

Project Introductions

A robot has been kidnapped and transported to a new location! Luckily it has a map of this location, a (noisy) GPS estimate of its initial location, and lots of (noisy) sensor and control data.

In this project I implemented a 2 dimensional particle filter in C++. This particle filter is given a map and some initial localization information (analogous to what a GPS would provide). At each time step the filter also gets observation and control data.

Running the Code

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/11 Bash on Ubuntu to install uWebSocketIO.

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. ./particle_filter

Alternatively some scripts have been included to streamline this process, these can be leveraged by executing the following in the top directory of the project:

  1. ./
  2. ./
  3. ./

Note that the programs that needed to be written to accomplish the project are src/particle_filter.cpp, and (optionally) particle_filter.h

The program main.cpp had already been filled out. My job was to build out the methods in particle_filter.cpp until the simulator output said:

Success! Your particle filter passed!

The things the grading code is looking for are:

  1. Accuracy: the particle filter should localize vehicle position and yaw to within the values specified in the parameters max_translation_error and max_yaw_error in src/main.cpp.

  2. Performance: the particle filter should complete execution within the time of 100 seconds.

Directory Structure

The directory structure of this repository is as follows:

|   CMakeLists.txt
|   |   
|   |   map_data.txt
    |   helper_functions.h
    |   main.cpp
    |   map.h
    |   particle_filter.cpp
    |   particle_filter.h

The Map*

map_data.txt includes the position of landmarks (in meters) on an arbitrary Cartesian coordinate system. Each row has three columns

  1. x position
  2. y position
  3. landmark id
  • Map data provided by 3D Mapping Solutions GmbH.


View Github