Project 1: EKF and Particle Filter Localization

What we expect

The project is due on Monday, October 29th. The key goal of this project is to get an understanding of the properties of Kalman filters and particle filters for state estimation. You should try to "play around" with the parameters of the algorithm, so as to see how they deal with different levels of noise. Also, try to see how the algorithms handle global localization and the kidnapped robot problem.

You will present what you learned during class on Tuesday, October 30th. The presentation should be short (at most 10min) and informal, mostly demonstrating the system in different contexts. For example, you can show how the filters work if some of the assumptions are violated (bad initial belief).

1. Get a project partner

For the projects in this class, you should work with another person. However, we assume that everybody understands the derivation and implementation of the algorithms.

2. Get to know Matlab

Matlab is available on the CSE machines from /projects/matlab/bin/matlab. If you have access to these machines, but can't get Matlab running, talk to benson. If you don't have access to Matlab in general, talk to Dieter.

There are a lot of useful tutorials online if you don't know how to use Matlab. Here's the first hit from Google: http://www.math.ufl.edu/help/matlab-tutorial/. I'm not saying that it's good (or bad); I'm just saying that it was the first hit.

Matlab has a lot of useful functions, so don't reinvent the wheel! Need to sum a whole list of numbers (hint, hint)? Use sum! Need to know more about function <function-name>? Type help <function-name>. You will find help to be very helpful. Additionally, randn is a good one to use.

3. Get the files

The files are accessible here: project1.tgz

4. Get to know the files

Here are the descriptions of the files that you'll find in the tarball. You may end up not using every single file. Some are utilities for other files, and you don't really need to bother with them. Some have useful utilities, so you won't have to reinvent the wheel. Some have fuller descriptions in the files themselves.

Things to implement

run.m -- Main update loop, should call ekfUpdate and pfUpdate
ekfUpdate.m -- EKF update
pfUpdate.m -- Particle filter update
resample.m -- particle filter resampling, called by pfUpdate

Tools

(you should not need to use these files)
generateScript.m -- generates data according to initial mean and noise parameters
generateMotion.m -- simulates simple motion commands

prediction.m -- move robot according to specified motion
sampleOdometry.m -- implements Table 5.6
sample.m -- samples from a covariance matrix
meanAndVariance.m -- returns the mean and variance for a set of non-weighted samples (illustrates handling of angles)
getfieldinfo.m -- gets field information
minimizedAngle.m -- normalizes an angle to [-pi, pi]
endPoint.m -- returns the location of an observation
matlab.el -- customization file for emacs

Display functions

plotcircle.m -- draws a circle
plotcov2d.m -- draws a 2-D covariance matrix
plotfield.m -- draws the field with landmarks
plotmarker.m -- draws an 'x' at a specified point (useful for drawing samples)
plotrobot.m -- draws the robot
plotSamples.m -- plots particles from the pf

5. Data format

State: [x,y,theta];
Observation: [bearing to landmark, landmark ID];
Control: [drot1,trans,drot2];

6. Get to work

You are to write a particle filter and a Kalman filter for robot localization. The script generates motion information according to the odometry-based motion model. Observations are landmark detections. Each landmark has a unique ID.