/sparse-localization

Project based on this repo: https://github.com/udacity/CarND-Kidnapped-Vehicle-Project

Primary LanguageC++MIT LicenseMIT

Overview

Project Introduction

Your 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, a 2-dimensional particle filter is implemented in C++. The particle filter will be given a map and some initial localization information (analogous to what a GPS would provide). At each time step the filter will also get observation and control data.

GIF of car run simulation

Example run of a simulation map and landmarks for a car. Black circles with crosses are landmarks, green lines are sensor readings, blue circle (mostly under car) is the estimated best direction and position of the car. Note how the blue circle is approximately at the same position of the car the entire run.

Set Up

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.

Running the Code

Once the install for uWebSocketIO is complete, the main program can be built and ran 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. ./clean.sh
  2. ./build.sh
  3. ./run.sh

Implementing the Particle Filter

The directory structure of this repository is as follows:

root
|   build.sh
|   clean.sh
|   CMakeLists.txt
|   README.md
|   run.sh
|
|___data
|   |   
|   |   map_data.txt
|   
|___src
    |   helper_functions.h
    |   main.cpp
    |   map.h
    |   particle_filter.cpp
    |   particle_filter.h

Inputs to the Particle Filter

The inputs to the particle filter are in the data directory.

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.

All Other Data (such as observations and controls)

Provided by the simulator