DOC PREVIEW
MIT 6 01 - Software Lab 13

This preview shows page 1-2 out of 5 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

6.01, Spring Semester, 2008—Software Lab 13, Issued Tuesday, May 6 1MASSACHVSETTS INSTITVTE OF TECHNOLOGYDepartment of Electrical Engineering and Computer Science6.01—Introduction to EECS ISpring Semester, 2008Software Lab 13, Issued Tuesday, May 6Overview of this week’s workIn software lab• Work through the software lab. Written solutions to problems 1– 21 will be due indesign lab. Your answers can be terse, but you must show all computations.Before the start of your design lab on May 8 or 9• Hand in written solutions to all software lab problems.• Do the survey in tutor problems 13.1.• Read the entire description of the design lab, so that you will be ready to work on it when youget to lab.In design lab• Work through the design lab. No written hand-in required for this lab, but you must becompletely checked off.6.01, Spring Semester, 2008—Software Lab 13, Issued Tuesday, May 6 2Software Lab: State estimation part 2Recap of how to use this softwareThis week we’ll continue working with the non-deterministic grid-world simulator. You should workwith a partner on this.Don’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 find se.py. Open this file in Idle, but do not try to evaluate thePython commands in the Idle Python Shell.Then, open a Terminal window (if you’re on Athena, remember to do add -f 6.01), and connectto the lab12 directorycd ~/ 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 " , " copyrigh t ", " cr ed it s " or " license " for more info rmati on .>>>If you are using your own laptop, download the lab12 files from the calendar page on the web. Ifdon’t know how to do the operations above on your own computer, then you can start Python, andtype>>> import os>>> os . chdir (’ wherever \you \ store \ your \ lab12 \ files ’)And continue as follows.In this Python, type>>> from se import *As the lab goes along, if you edit se.py, then you’ll need to go back to this window and type>>> reload ( se )And if you define a new name in se.py, you’ll have to do>>> from se import *again as well.You’ll see a set of procedures at the end of the se.py file, which will make example worlds ofdifferent kinds. We’ll start by working with the world defined by make51p (which stands for 5 by1, perfect). In your Python (not Idle) shell, type>>> w = m ak e5 1p ()As a result, you should see a window that looks like this:6.01, Spring Semester, 2008—Software Lab 13, Issued Tuesday, May 6 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:w. run ()and responding to the text prompts. Typing done returns control to Python, but the window willremain. Do not kill the window until you are completely done with it. You can type:w. reset ()w. run ()to start interacting with the window again after you’ve typed done.Belief state updateThe robot’s belief state is a probability distribution over possible states of the world. In this world,there is one underlying world state for each square; each of these states has a probability valueassigned to it, and these values sum to 1. In the simulator, the current belief state is shown by thesquares on the right, with redder values closer to zero and greener values closer to one. It is alsoprinted out whenever you move; in fact it is printed twice: once after the transition update andagain after the sensing update, as explained below. (If you get tired of seeing the printout, you canalways type w.verbose = False to shut it up.)Just as in the HMM, the belief state is updated in two steps, based on the state transition modeland the observation model. Study the state update rules in the notes, and convince yourself thatat the end of this, all of the entries in the belief state will sum to 1.6.01, Spring Semester, 2008—Software Lab 13, Issued Tuesday, May 6 4PracticeThis stuff is hard to build up an intuition for. We’ll ask you to work through the state estimationequations for some simple examples, so you can come to understand in detail how things work.Let’s start by practicing in a world without noise. In our set-up, w is just such a perfect world. Eithermake a new instance of it or do w.reset(), which will set the belief state to (0.2, 0.2, 0.2, 0.2, 0.2).This is often called a uniform distribution. The robot has no idea where it is, and considers allstates equally likely.Calculate an answer to these questions by hand before trying it in the simulator. If you get adifferent result than you expected, convince yourself either that there is a bug in the simulator orwhy it’s right. Show your computation in detail when you hand in answers.Question 1: First, what is the robot’s prior belief b(si) for each of the states?Question 2: When you do w.run(), it automatically does a stay action. What is the beliefstate after taking the state transition (but not the observation) into account? Start bycomputing P(si|sj, stay) for all i, j. Now, use this to


View Full Document

MIT 6 01 - Software Lab 13

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 Software Lab 13
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 Software Lab 13 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 Software Lab 13 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?