This post is a summary of the Udacity Robotics Nanodegree Lab on localization using Monte Carlo Localization (MCL). The Udacity repo can be found here

To follow this tutorial, clone the repo to a folder of your choice.

C++ Implementation

The following headers are used in the lab, which are mainly from the standard c++ library. One exception is the third party plotting library found here that uses python’s matplotlib as its backend.

Next, some global variables are defined for the fixed landmarks and the world size. The random generator gets initialized and a forward declaration of two functions is made, namely mod and gen_real_random.

Robot Base Class

The lab uses a robot class that initializes a robot with a random x and y location and orientation in its constructor.

The class has the following public member variables

It uses the follwoing private methods

Global functions

Other useufl global functions

Visualization

For visualization matplotlib is used as backend.

Compile and Run

Compile with

And finally run the program with

This will output:

Results

Further details about MCL are found in the paper of Sebastian Thrun et al.

Reference

This post is a summary of the MCLLab from the Robotics Nanodegree of Udacity

Tags:

Categories:

Updated: