Unformatted text preview:

6.081, Spring Semester, 2007—Work for Week 12 1MASSACHVSETTS INSTITVTE OF TECHNOLOGYDepartment of Electrical Engineering and Computer Science6.081—Introduction to EECS ISpring Semester, 2007Work for Week 12• Software lab for Tuesday, May 1• Pre-lab tutor problems due Thursday, May 3• Robot lab for Thursday, May 3• Post-lab written problems due Tuesday, May 8State estimationIn the next two labs, we’ll use basic probabilistic modeling to build a system that estimates therobot’s pose, based on noisy sonar and odometry readings. We’ll start by building up your intuitionfor these ideas in a simple simulated world, then next week we’ll move on to using the real robots.There will be two major parts of the work for this week: working with the grid-world simulatorand writing your own state-estimation code. The plan is this:Tuesday: Work with your partner to start the grid-world simulation labThursday: Work with your partner to finish the grid-world simulation lab; when that’s done,Thursday: Work on the state-estimation code on your own.Grid World SimulatorDownload the code for this lab, in ps12.zip from the calendar page. In it, you will findStateEstimationNoisyNN.py and StateEstLab.py. Don’t use the Idle Python Shell for thislab. You can use the Idle editor, but you cannot run the code from inside Idle. If you are aSoaR afficionado, you can do this all from within SoaR. Start SoaR, open an editor window ontoStateEstLab.py, choose Run in Interpreter from the SoaR menu, and give commands by typ-ing in the buffer at the bottom of the command window. If not, you can go to a terminal windowand type python. You can type commands to Python here.> pythonPython 2.4.4 (#1, Oct 18 2006 , 10:34 :39)Type " help " , " co pyright " , " credit s " or " license " for more inf orm ation .>>>Open StateEstLab.py in Idle or your favorite other editor. You’ll see a command at the end ofthat file, that says:w51pp = World (5 , 1 , () , () , ((2 ,0) ,) , () , (0 ,0) , per fectSensorModel , \per fectMot ionM odel )Go to your terminal window, and type>>> from S tat eEs tLab import *6.081, Spring Semester, 2007—Work for Week 12 2As the lab goes along, if you edit StateEstLab.py, then you’ll need to go back to this window andtype>>> reload ( S tat eEstLab )>>> from S tat eEs tLab import *When you evaluate it, you should see a window that looks like this:This is a world with 5 possible “states”, each of which is represented as a square with a coloredborder. The possible colors of the borders are white, black, red, green, and blue. In this example,four squares are white and one is green. There is a small orange rectangle representing the squarethat our simulated robot is actually occupying. The inner part of each square is gray; as we’lldiscuss in detail later, how light the square is represents how likely the robot thinks it is that it’sin that square.The arguments to the World initialization function are:• The dimension of the world in x• The dimension of the world in y• Four tuples of coordinates, each specifying the location of colored squares. The first list givesthe locations of black squares, the second red, the third green, the last blue. Squares unspecifiedin any of those lists are white.1• 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 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, if w is a world,w. north ()w. south ()w. east ()w. west ()w. stay ()Question 1. Just to get the idea of how this works, move the robot east and west a few times,and just take a look at (but don’t be worried if you don’t understand) what is written onthe screen. It shows the actual numeric values associated with the robot’s belief that it isin each of the squares.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.1The expression ((2,0),) makes a tuple that contains a single element, which is itself a tuple that contains 2 and0. The reason for the extra comma character is so that the outer parentheses are treated as a tuple constructor, notjust as grouping parentheses.6.081, Spring Semester, 2007—Work for Week 12 3The 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, this set of distributions is specified as a tuple of tuples, where each row correspondsto a different actual color. So, for example m[actual][observed] would give the probability ofobserving observed in a square that was really colored actual.Here’s the model for perfect observations, with no probability of error:per fectSen sorM odel = ((1.0 , 0.0 , 0.0 , 0.0 , 0.0) ,(0.0 , 1.0 , 0.0 , 0.0 , 0.0) ,(0.0 , 0.0 , 1.0 , 0.0 , 0.0) ,(0.0 , 0.0 , 0.0 , 1.0 , 0.0) ,(0.0 , 0.0 , 0.0 , 0.0 , 1.0))Question 2. Give a sensor model in which red and blue are indistinguishable (that is, the robotis just as likely to see red as to see blue when it is in a red square or a blue square).Question 3. Give a sensor model in which red always looks blue, and blue always looks red.Question 4. Which one of these models is more informative?Question 5. Do the rows always have to sum to 1? The columns? Why?Question 6. Given an example situation in which our assumption (that all squares of a givencolor have the same error model) is unwarranted.In a real-world system we probably wouldn’t ever want to have zeros anywhere in the sensor model:it is important to concede the possibility


View Full Document

MIT 6 01 - State estimation

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 State estimation
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 State estimation 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 State estimation 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?