Simultaneous Localisation and Mapping (SLAM) in MATLAB
This was part of my 3rd year engineering group project to design a semi-autonomous wheelchair. Above is the SLAM simulation I produced in MATLAB using the Extended Kalman Filter. The implementation generates two motion estimates from laser scan matching and wheel odometry. The resulting pose estimate is a weighted average of the two estimates, which takes into account their relative uncertainties. The update step uses artificial landmarks such as RF beacons placed around the environment for pose correction. The diagram below summarises the system:
The code can be downloaded from the link below. Beware that it’s a bit messy and wasn’t produced with efficiency in mind.
Alternatively if you use Git then you can clone the repository from GitHub using the command:
git clone https://github.com/jaijuneja/ekf-slam-matlab.git
Run the setup file to get started and you should be good to go!
UPDATES
- 08/12/2013 – Added a setup.m file to overcome the issues people have been having with setup.
- 03/10/2014 – A number of commenters noted that they were getting the error “Undefined function ‘pdist’ for input arguments of type ‘double'”. Andrew has kindly informed me that the error arises if you don’t have the statistical toolbox installed for Matlab (this comes pre-installed with the student edition). If you don’t want to buy/install the toolbox, you can manually download the pdist.m and pdistmex.cpp files, place them in the root folder of the SLAM program, and compile pdistmex.cpp into a MEX file for Matlab. There seems to be a version of these files at this link.