Computer Science 221: Assignment #05
Spring 2007
Department of Informatics
Donald Bren School of Information and Computer Sciences
University of California, Irvine
The
goal of this project is to implement a particle filter (Monte Carlo Recursive Bayesian Network Solver) to solve the robot localization problem
- This is an individual project. Your work should be done on your own.
- You can do this project in any language/environment that you want.
- The deliverable is an animation of the particle filter working.
- This assignment is now extra credit/optional.
- Download a map of the environment
(an office building)
- Map in bmp format: here.
- Download the observation data
- Located here.
- The main reason why this is an extra credit assignment is because I ran out of time to figure out the format of the observation file. It is mostly obvious, but there are some orientation issues that aren't clear.
- All of this data comes from RADISH if that helps at all. In particular this data is from freiburg.
- Write code
- Write code to load the map image into an occupancy grid.
- An occupancy grid is a 2-D array that has a number from 0.0 to 1.0 indicating the probability that there is an obstruction in the location which is represented by that grid cell. Basically a grayscale bitmap.
- For example, a 10m by 10m room which is divided into 20 cells on each side would become an array with 400 elements in it. Each element would be a probability that there is an obstruction in the .5m by .5m cell represented by an entry in the array.
- The image above has 5 cm x 5 cm cells.
- Write a function which returns the distance to a wall:
- float scanDistance(map,x,y,theta);
- to do this you have to orient the map and the theta.
- I used postive y to be up in the bitmapped image.
- I used positive x to be right in the bitmapped image.
- I used 0 degrees to be north/up, 90 degrees to be east/right.
- Write a sensor model which uses the scanDistance function
- float sensorModel(x,y,theta, map, list of scans)
- This function takes a position, map and list of scans and returns a number from 0.0-1.0 indicating the probability that this list of scans could be generate with this pose (x,y,theta).
- You could do this by calculating the probability of each individual scan and multiplying them together.
- The probability of each individual scan could be a gaussian with a mean given by "scanDistance"
- Write a motion model which given a position and an estimated motion returns a new position
- (x,y,t) motionModel(x,y,t,dx,dy,dt)
- This would simple be adding if dx, and dy weren't estimates. So instead of adding, this should return a randomly generated new pose (x,y,theta) which is "close" to (x+dx, y+dy,t+dt). I don't know the real error parameters of the robot so you'll have to guess here as to what form "random" takes. (gaussian?)
- Write a class/object/data structure which represents the state (aka a particle)
- A state is a robot's pose (x,y,theta) and the particle's weight.
- Write a function that visualizes the current probability distribution
- Displays the map and overlays the collection of particles.
- Put it all together
- Generate a collection of particles randomly.
- Loop Forever
- Visualize the state
- Get all the new ODOM (odometry) observations up to the next LASER observation
- Combine them into one odometry observation
- Move your particles, using your motion model and the combined odometry observation.
- Get a new LASER observation
- Reweight all your recently moved particles using the sensor model and the LASER observation
- Resample with replacement the particles to create a new particle set based on the weights after the LASER observation.
- Capture a sequence of still frames. Combine them into an animation. Turn the animation into Don with any necessary explanation. (djp3@ics.uci.edu).