Udacity Self-Driving Car Nanodegree - Kidnapped Vehicle project
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data
images
src Fixing a problem when the weight is near zero Aug 3, 2017
.gitignore
CMakeLists.txt
LICENSE
README.md
_config.yml
build.sh
clean.sh
cmakepatch.txt
install-mac.sh
run.sh

README.md

CarND-Kidnapped-Vehicle-P3

Udacity Self-Driving Car Nanodegree - Kidnapped Vehicle project

Overview

This project implements a Particle Filter applied to a Kidnapped robot(car) problem. A simulator is provided by Udacity (it could be downloaded here). This simulator will generate noisy landmark observation from a car to the Particle Filter using WebSocket. The Particle Filter uses the uWebSockets WebSocket implementation to respond to this observation with the estimated car position. Udacity provides a seed project to start from on this project (here).

Prerequisites

The project has the following dependencies (from Udacity's seed project):

  • cmake >= 3.5
  • make >= 4.1
  • gcc/g++ >= 5.4
  • Udacity's simulator.

For instructions on how to install these components on different operating systems, please, visit Udacity's seed project. As this particular implementation was done on Mac OS, the rest of this documentation will be focused on Mac OS. I am sorry to be that restrictive.

In order to install the necessary libraries, use the install-mac.sh.

Compiling and executing the project

In this project, Udacity's seed repo provides scripts to clean, compile and run it. These are the following commands you need to run from this repo directory

> ./clean.sh
> ./build.sh
> ./run.sh

You will see a message indicating the filter is listening:

> ./run.sh
Listening to port 4567

When you open the simulator the following screen appears:

Simulator first screen

Using the right arrow, you need to go to the Kidnapped Vehicle project:

Simulator Kidnapped Vehicle project

Clicking on "Select," the simulator for the Kidnapped project start and the Particle Filter informs it is connected:

Simulator Kidnapped Vehicle project first screen

Clicking on "Start" button, the vehicle starts moving, and the blue circle(the filter calculated position) moves with it. After a while, the simulator informs you if your Particle Filter passed or failed. Here is an example of the filter passing the test:

Simulator Kidnapped Vehicle Passed

Code description

The Particle Filter is implemented in src/particle_filter.cpp:

Almost the rest of the magic happens on src/main.cpp. The event handler declared at line 49 parse the received message and call the above described Particle Filter methods.