Unformatted text preview:

6.01, Fall Semester, 2007—Assignment 12, Issued: Tuesday, Nov. 20 1MASSACHVSETTS INSTITVTE OF TECHNOLOGYDepartment of Electrical Engineering and Computer Science6.01—Introduction to EECS IFall Semester, 2007Assignment 12, Issued: Tuesday, Nov. 20To do this week...in Tuesday software lab1. Start writing code and test cases for the numbered questions in the software lab. Paste allyour code, including your test cases, into the box provided in the “Software Lab” problem onthe on-line Tutor. What you submit to the tutor will not be graded; what you hand in nextTuesday will....before the start of lecture next Tuesday1. Do the lab writeup, providing written answers (including code and test cases) for everynumbered question in this handout.On Athena machines make sure you do:athrun 6.01 updateso that you can get the Desktop/6.01/lab12 directory which has the files mentioned inthis handout. You need the whole lab12 distribution for the software lab; use one of ourlaptops for the software lab.6.01, Fall Semester, 2007—Assignment 12, Issued: Tuesday, Nov. 20 2State estimationIn the next two software and two robot labs, we’ll use basic probabilistic modeling to build asystem that estimates the robot’s pose, based on noisy sonar and odometry readings. We’ll startby building up your intuition for these ideas in a simple simulated world, then we’ll move on tousing the real robots.This week we’ll start by working with a non-deterministic grid-world simulator. You should workwith your partner on this.Grid World SimulatorDon’t use the Idle Python Shell for this lab. You can use the Idle editor, but you cannotrun the code from inside Idle.In the lab12 folder you will findStateEstSM.py.Open this file in Emacs, Idle or whatever editor you like. If you use Idle as an editor, donot try to evaluate the python commands in the Idle Python Shell.Then, open a Terminal window (if you’re on Athena, remember to do add -f 6.01), then connectto the lab12 directorcd ~/ Desktop /6.01/ lab12and type python.> pythonPython 2.5 ( r25 :51918 , Sep 19 2006 , 08:4 9:13)[ GCC 4.0.1 ( Apple Computer , Inc . build 5341)] on darwinType " help " , " copyrig h t " , " credits " or " license " for more inform ation .>>>You can type commands to Python here. In this Python, type>>> from StateEs tSM import *As the lab goes along, if you edit StateEstSM.py, then you’ll need to go back to this window andtype>>> reload ( St a teEstS M )>>> from StateEs tSM import *You’ll see a command at the end of the StateEstSM.py file, that says:tw = makeG ridSi m (5 , 1 , [[] ,[] ,[[2 ,0]] ,[]] , [0 ,0] , perfec t SensorMod e l , \perf ect Mot i onM ode l )Execute this command in Python (on your Terminal window). When you evaluate it, you shouldsee a window that looks like this:6.01, Fall Semester, 2007—Assignment 12, Issued: Tuesday, Nov. 20 3This is a world with 5 possible “states”, each of which is represented as a colored square (on theleft). The possible colors of the states are white, black, red, green, and blue. In this example, foursquares are white and one is green. There is a small orange rectangle representing the square thatour simulated robot is actually occupying. On the right are five squares that start out being black;the color in those squares represents how likely the robot thinks it is that it’s in that square. Thisis called the belief state. The colors illustrating the belief state are: black, when the value is whatthe uniform distribution would assign (0.2 for 5 states), shades of green when the probability ishigher than the uniform, and shades of red when it is below the uniform value.The arguments to the makeGridSim function are:• The dimension of the world in x• The dimension of the world in y• Four lists of coordinates, each specifying the location of colored squares. The first list gives thelocations of black squares, the second red, the third green, the last blue. Squares unspecified inany of those lists are white.• A pair of indices specifying the robot’s initial location• A model of how the sensors work• A model of how the actions workSo, this grid world is 5-by-1, with one green square, the robot initially at location (0,0), and perfectsensor and motion models.You can issue commands to the robot by typing:tw . run ()and clicking on the buttons in the simulator window. The buttons correspond to the five availableactions: Stay, West, East, South and North. Clicking on the Done button returns control toPython. The window will remain after you click Done. Do not kill the window until you arecompletely done with it. You can type:tw . reset ()tw . run ()to start interacting with the window again after you’ve typed Done.Question 1. Just to get the idea of how this works, move the robot east and west a few times,and write down what is written on the screen. It shows the actual numeric values associatedwith the robot’s belief that it is in each of the squares. You should be able to relate this, atleast roughly, to the HMM example in the notes.This model is a slight variation on a hidden Markov models (HMM) that we saw during lecture.The only difference is that the robot can select different actions (like trying to move north or tryingto move south), and those different actions will cause different state-transition distributions.6.01, Fall Semester, 2007—Assignment 12, Issued: Tuesday, Nov. 20 4The sensor model, generally speaking, is supposed to specify a probability distribution overwhat the robot sees given what state it is in: P(Ot= ot|St= st). In our case otranges over white,black, red, green, and blue, and stranges over all the possible states of the robot (the different gridsquares).We have made a simplifying assumption, which is that the robot’s observation only depends onthe color of the square it’s standing in; that is, all white squares have the same distribution overpossible observations. So, we really only need to specify P(observedColor|actualColor), and thenwe can find the probability of observing each color in each state, just by knowing the actual colorof each state:P(Ot= observedColor|St= st) = P(Ot= observedColor|actualColor(st)) .In our program, we specify the observation model by a function which takes as input the trueColorand returns an instance of the Dist class. The Dist class, which we saw earlier in the term,specifies a probability distribution over a set of values as a list of [value, probability] pairs.The probabilities must sum to one.


View Full Document

MIT 6 01 - Assignment -0.01

Documents in this Course
Week 1

Week 1

3 pages

Op-Amps

Op-Amps

8 pages

Op-Amps

Op-Amps

6 pages

Syllabus

Syllabus

14 pages

Planning

Planning

14 pages

Load more
Download Assignment -0.01
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Assignment -0.01 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Assignment -0.01 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?