Self-Driving Car Engineer Nanodegree Program
This repo implements a particle filter localization method for a simulation car with a known map.
mkdir build && cd build
cmake .. && make
./particle_filter
The implementation follows strictly what has been taught in the lectures.
void ParticleFilter::init()
initializes the particles using a known initial state of the car with randomly-generated noise.void ParticleFilter::prediction()
uses a simple motion model to predict each particle's state.void ParticleFilter::updateWeights()
uses a Gaussian cross-correlation between predicted landmark features and observed landmark features to re-weight each particle.void ParticleFilter::resample()
randmoly re-draws the same number of particles from the exsiting particle pool depending on the weight of each particle; particles with higher weight may be drawn multiple times.void ParticleFilter::dataAssociation()
uses a nearest-neighbor algorithm to assign observed features to map features. A simple linear search algorithm is used in this implementation. However, since the map is static, a faster search algorithm for this function is to use a K-d tree to represent the map landmarks. I will revisit this in the future.
./run.sh
will give the following result (passed):