C++ implementation of Monte-Carlo localization and particle filter. Particles represent the posterior by a set of weighted samples. They can model arbitrary distributions and therefore are used when measurement or prediction distributions are non-Gausian. The localization can be summerized as follows:
- Particle Generation: Particles are generated representing the robot with random pose uniformly distributed inside the map.
- Motion Update: Particles are propogated based on the model of the system and motion model in case of localization
- Sensor Update: Given the sensor readings of the robot and measurements from the known map particles are weighted based on the likelihood of observations
- Resampling: Resampling results in the updated belief of the system state. Resamplig ensures that particles stay in the meaningful areas of the state space. New particles are drawn from the set of particles with a probability proportional to the likelihood of their observations. In case of the example implementation The resampling of the particles is done in a way similar to Stochastic universal sampling with equal spacing at 2 times the maximum weight of the particles.
Install openCV:
-
Windows: See insructions here
-
Linux: See instructions here
-
Mac: You can use
Homebrew
brew install opencv
Clone the respository and build the cvplot
package
git clone https://github.com/farzingkh/Monte-Carlo-Localization.git
cd Monte-Carlo-Localization/cvplot
mkdir build
cd build
cmake ..
make
and then build and run the application.
on the main application directory:
mkdir build
cd build
cmake ..
make
./MCL
- Ioannis M. Rekleitis. "A Particle Filter Tutorial for Mobile Robot Localization." Centre for Intelligent Machines, McGill University, Tech. Rep. TR-CIM-04-02 (2004).
- Probabilistic Robotics. Sebastian Thrun, Wolfram Burgard, and Dieter Fox. (2005, MIT Press.) 647 pages
- Wolfram Burgard, Introduction to Mobile Robotics Bayes Filter – Particle Filter and Monte Carlo Localization