Roomba! Goal: whole-environment coverage Problem motivation

Slides:



Advertisements
Similar presentations
Mon: CS + programming Tue: Data Wed: Algorithms
Advertisements

EECS 110: Recitation #1: Ionut Trestian Northwestern University
Spelling Lists.
Spelling Lists. Unit 1 Spelling List write family there yet would draw become grow try really ago almost always course less than words study then learned.
A quadratic equation is a second degree polynomial, usually written in general form: The a, b, and c terms are called the coefficients of the equation,
EECS 110: Lec 2: What is Programming?
CS != programming What is computer science (CS)? Take CS 121.
Important Tips to writing a History Paper. Getting Started At first glance, writing about history can seem like an overwhelming task. History’s subject.
Moving Around in Scratch The Basics… -You do want to have Scratch open as you will be creating a program. -Follow the instructions and if you have questions.
Microsoft ® Office Outlook ® 2007 Training Calendar basics [Your company name] presents:
N-space Snakes are special maximal length loops through an N-space cube. They ’ re full of intriguing symmetries, puzzles and surprises. They ’ re simple.
EECS 110: Lec 2: What is Programming? Aleksandar Kuzmanovic Northwestern University
Picobot area already covered area not covered (yet!) inspiration? walls Goal: whole-environment coverage with only local sensing … Picobot as envisioned.
11 Making Decisions in a Program Session 2.3. Session Overview  Introduce the idea of an algorithm  Show how a program can make logical decisions based.
Code Simplicity: Software Design In Open Source Projects Max Kanat-Alexander
Section 2 Effective Groupwork Online. Contents Effective group work activity what is expected of you in this segment of the course: Read the articles.
Are You Right-Brained or Left-Brained?
ECE 1100: Introduction to Electrical and Computer Engineering
The problem you have samples for has been edited to reduce the amount of reading for the students. We gave the original late in the year. As we were working.
Following the signposts for greater understanding
AP CSP: The Need for Programming Languages and Algorithms
FLOWCHARTS Part 1.
Following the signposts for greater understanding
EECS 110: Lec 2: What is Programming?
Telling the Whole Story
What is computer science (CS)?
UNIT 3 – LESSON 5 Creating Functions.
English Proficiency Workshop
The Need for Algorithms 2 days
What Are They? Who Needs ‘em? An Example: Scoring in Tennis
Drawing a Realistic Still Life.
Introduction CSE 1310 – Introduction to Computers and Programming
Thinking About How You Read READING STRATEGIES
Using a Stack Chapter 6 introduces the stack data type.
Programming – Touch Sensors
LEQ: How do I organize a response to a LEQ?
Learning to program with Logo
SKILLS for LEARNING SKILLS for STUDY Part 3
LO Adding and subtracting with negative numbers RAG
Extraversion Introversion
Algorithms Today we will look at: what the word algorithm means
Using a Stack Chapter 6 introduces the stack data type.
Non-Fiction Questioning Stance & Signposts
UNIT 3 CHAPTER 1 LESSON 4 Using Simple Commands.
Organization Leadership Skill Area
On your whiteboard: What is innatism? Give two examples to support it
Thinking About How You Read READING STRATEGIES
What Are They? Who Needs ‘em? An Example: Scoring in Tennis
CSCE 489- Problem Solving Programming Strategies Spring 2018
Computer Science Testing.
Aha Moments Last week we talked about Aha moments. When you’re reading, authors often give you clues that the character has come to an important understanding.
Maze Challenge Maze Challenge activity > TeachEngineering.org
Mastering Interview Questions
Using a Stack Chapter 6 introduces the stack data type.
Using a Stack Chapter 6 introduces the stack data type.
-Read question -”Would we say that it is very likely? Unlikely? Impossible?”
Picobot Challenge! inspiration? walls Picobot area not covered (yet!)
Tonga Institute of Higher Education IT 141: Information Systems
A First Program.
Relations And Functions © 2002 by Shawna Haider.
Relations And Functions.
Tonga Institute of Higher Education IT 141: Information Systems
Relations And Functions.
CS334: Logisim program lab6
Arrays.
Roomba! Goal: whole-environment coverage Problem motivation
Ionut Trestian Northwestern University
Mistakes in writing a research paper
Presentation transcript:

Roomba! Goal: whole-environment coverage Problem motivation For starters, let me ask if anyone love vacuuming? I mean, really, really, love vacuuming? Most people would probably say that they don’t enjoy vacuuming because it’s a rather mundane, boring, and repetitive task. As you would agree, robots are great things to use for tasks that humans find boring or dangerous…and since vacuuming can be thought of as boring, why not use a robot to do it? The good folks at iRobot corporation developed and sold such a robot called Roomba. Roomba is a robotic vacuum cleaner that travels around your floor and navigates around obstacles such as chairs or other furniture, and covers the entire floor. Roomba knows when it touches a wall or something else that is blocking its path, and will change directions. Roomba pretty much uses this naïve approach: move forward in a straight line until either 1) you’ve gone too long in a straight line, meaning that you might be stuck, or 2) you’ve hit something which is blocking your path. Sometimes Roombas will “follow” a wall. http://www.youtube.com/watch?v=GoWyqQorqOY&feature=player_detailpage#t=2s Challenges Is this an easy problem? The sole fact that Roomba didn’t enter consumer market until mid 2000th , although people have been trying to create an autonomous vacuum since the 1960th, suggests that there might be some issues. Let’s think what makes a problem that is rather trivial for humans to be difficult for computers. The answer may lie in difference of human and Robot in that Robot does not see a global picture, it cannot rise and see the picture from above – in contrast to humans, who can more or less see the entire room. Robot needs to make decision based only on what they’re sensing at the moment Robot has no memory, and as a result, has no idea if it covered an area or not. It may need to re-cover the area Extensions This is an example “coverage” problem from the field of Robotics. You can think of other examples where this problem might arise-moving the lawn automatically, surveying the area for landmines, exploring distant planets 

Roomba Goal: whole-environment coverage with only local sensing… Challenges: Can only sense it’s immediate surroundings – doesn’t see global picture Can't tell "vacuumed" from "unvacuumed" area – no memory Problem motivation For starters, let me ask if anyone love vacuuming? I mean, really, really, love vacuuming? Most people would probably say that they don’t enjoy vacuuming because it’s a rather mundane, boring, and repetitive task. As you would agree, robots are great things to use for tasks that humans find boring or dangerous…and since vacuuming can be thought of as boring, why not use a robot to do it? The good folks at iRobot corporation developed and sold such a robot called Roomba. Roomba is a robotic vacuum cleaner that travels around your floor and navigates around obstacles such as chairs or other furniture, and covers the entire floor. Roomba knows when it touches a wall or something else that is blocking its path, and will change directions. Roomba pretty much uses this naïve approach: move forward in a straight line until either 1) you’ve gone too long in a straight line, meaning that you might be stuck, or 2) you’ve hit something which is blocking your path. Sometimes Roombas will “follow” a wall. http://www.youtube.com/watch?v=GoWyqQorqOY&feature=player_detailpage#t=2s Challenges Is this an easy problem? The sole fact that Roomba didn’t enter consumer market until mid 2000th , although people have been trying to create an autonomous vacuum since the 1960th, suggests that there might be some issues. Let’s think what makes a problem that is rather trivial for humans to be difficult for computers. The answer may lie in difference of human and Robot in that Robot does not see a global picture, it cannot rise and see the picture from above – in contrast to humans, who can more or less see the entire room. Robot needs to make decision based only on what they’re sensing at the moment Robot has no memory, and as a result, has no idea if it covered an area or not. It may need to re-cover the area Extensions This is an example “coverage” problem from the field of Robotics. You can think of other examples where this problem might arise-moving the lawn automatically, surveying the area for landmines, exploring distant planets 

Roomba is a computer! We will use a special programming language that can instruct a computer similar to Roomba. This programming language contains instructions with the aforementioned challenges in mind. We call this special computer “Picobot.”

Another language? Really? Picobot! Python General-purpose language you might see 50% by the end of the semester We are going to take another crash course in a system called Picobot, and it should hopefully be even more simple than writing your first game. Just to put it in perspective, we’ll have seen about half of Python’s functionality by the end of the semester, but we’ll learn all details of Picobot system in the first half of this class. You may wonder why we are taking this detour. Even though, as you can imagine, Picobot is a simple thing, it is a good example of computational system with many important features of a computer. So, by studying Picobot now, and a little more later in the course, we’ll get a better idea how computers perform their tasks. Secondly, Picobot system is background independent – will be equally challenging for complete beginners and people with some previous programming experience. Picobot Special-purpose language you'll see 100% by the end Of the lecture The Picobot simulator http://www.eg.bucknell.edu/~csci203/common-files/course-docs/picobot/picobot.html

Picobot! walls Picobot area not covered (yet!) area already covered Picobot aim – 100% coverage Challenge: Local sensing – can not see an entire room at a glance like we can, only immediate surroundings It’s not very fancy, but it should be pretty easy to understand. The green square represents Picobot, the blue grid represents walls, and the white area represents areas Picobot hasn’t visited yet. As Picobot moves along, it leaves a trail of gray behind, that indicates clean areas. Goal: whole-environment coverage with only local sensing…

Surroundings are always in NEWS order. Picobot can only sense things directly to the N, E, W, and S N W E S For example, here the surroundings are Recall that the Picobot has limited sensing. Picobot doesn’t know anything about the room it’s in. It knows only of what’s immediately around it to the North, East, South, and West (NEWS). Remember that acronym, since it will be useful in programming Picobot. NxWx N E W S Surroundings are always in NEWS order.

Surroundings are always in NEWS order. What are these surroundings? Surroundings are always in NEWS order. N E W S NxWx xEWx NExS Now, draw surroundings for NxxS – (north and south shaded, east and west unshaded) And for xxWS – (west and south shaded)

Surroundings How many distinct surroundings are there? N W E S Looking at the following diagram, how many distinct surrounding configurations are there for Picobot?

Surroundings How many distinct surroundings are there? N W E S 24 == 16 possible … There are 2^4=16 possible configurations. Which ones can appear in our current room (empty square) and which are the configurations that you can never be in? Now if the room has obstacles? Which configurations are possible? Which configurations you can never be in? xxxx Nxxx xExx xxWx xxxS NExx NxWx NxxS xEWx xExS xxWS NEWx NExS NxWS xEWS NEWS (won’t happen)

When I’m blocked like this, Rules When I’m blocked like this, I want to move N I should move N. Picobot moves according to a set of rules: surroundings direction xxWS N If I see xxWS, Then I move North Note: X in direction means don’t move.

Asterisks * are wild cards. They match walls or empty space: surroundings direction x*** N EWS may be wall or empty space N must be empty Wild stars? You should visit Alpha Centauri!

Rules I should move N. surroundings direction x*** N As long as north isn’t blocked, go north I should move N. Asterisks * are wild cards. They match walls or empty space: surroundings direction x*** N If I see North is free (no matter what other walls there are) Then I move North Note: X in direction means don’t move.

What will this set of rules do to Picobot? Picobot checks all of its rules. If it finds a matching rule, that rule runs. Model Only one rule is allowed per state and surroundings. What will this set of rules do to Picobot? surroundings direction x*** -> N N*** -> X "Move north until I can't" Nothing to the north? Then move north, and stay in state 0. Wall to the north? Then stop, stay in state 0 Note the wildcards How can we get back down the screen?

State in picobot State describes what it will do. Picobot can have many rules (you decide!). "Moving East until I can't" Essentially, Picobot’s memory is a state—the context of the current situation that Picobot is in (i.e. I have a wall to the North but open space all around). All computers have state that represents what computation is currently occurring. All computers have state: The internal context of its computation. It represents what the computer is doing.

State I am in state 0. My surroundings are xxWS. We use a number to represent the state of picobot. (i.e., picobot has memory to store a single number) Picobot always starts in state 0. So, how do we use states? Well, we need a starting state, which we’ll call the initialization state, or State 0. Picobot always starts in state 0. We can set it to whatever we want. Here’s the trick: it doesn’t mean anything and until we give it meaning. We can make the following claim about Picobot: State and surroundings represents everything our little robot knows about its world Picobot state is extremely simple – a single number (0-99) Refrigerator story. By the way… I tell stories because it helps you REMEMBER. State and surroundings represent everything Picobot knows about the world

Rules Aha! I should move N. I should enter state 0. I am in state 0. My surroundings are xxWS. Aha! I should move N. I should enter state 0. Picobot moves according to a set of rules: state surroundings direction new state xxWS N If I'm in state 0 seeing xxWS, Then I move North, and "change" to state 0. Note: X in direction means don’t move.

What will this set of rules do to Picobot? Picobot checks all of its rules. If it finds a matching rule, that rule runs. Model Only one rule is allowed per state and surroundings. What will this set of rules do to Picobot? state surroundings direction new state x*** -> N N*** -> X "Move north until I can't" Nothing to the north? Then move north, and stay in state 0. Wall to the north? Then stop, stay in state 0 Note the wildcards How can we get back down the screen?

Ping-Pong Picobot Rules Picobot checks all of its rules. If it finds a matching rule, that rule runs. Model Only one rule is allowed per state and surroundings. Ping-Pong Picobot Rules state surroundings direction new state x*** -> N N*** -> X 1 1 ***x -> S 1 1 ***S -> X

To do hw0, Problem #3 Write rules that will always cover this room. For p3, move to one wall, and then just modify previous example to go back and forth, but moving one square For p4, think!!! You need a state that represents moving in all four directions. How? Or, what if you wrote a left-hand rule type of robot? your rules should work regardless of Picobot's starting location

To do hw0, Problem #4 Write rules that will always cover this room. For p3, move to one wall, and then just modify previous example to go back and forth, but moving one square For p4, think!!! You need a state that represents moving in all four directions. How? Or, what if you wrote a left-hand rule type of robot? your rules should work regardless of Picobot's starting location

Tips for Picobot problems Thinking about the CS questions before diving into the programming will help! Imagine you’re blindfolded in the room. How would you solve it? Solve it FIRST in English, then try to figure out the algorithm (don’t worry about code!). For each sentence in English, that might be a different state. If you find that rules conflict with each other, you might need a different state. How does Picobot know when to stop? i.e. how does in know that the whole area was covered?

CS ~ complexity science Information is intrinsic to every system… How can we benefit from this information? “construct with” Representing it … Transforming it … Measuring it efficiently? effectively? possibly? How might we measure these rooms' complexity? CS as the study of complexity: the number of Picobot rules and the number of Picobot states are quantitative measures of complexity that students with no CS background at all intuitively grasp. CS as the study of computability: there are environments that Picobot provably cannot cover. We note this and point out how the computational model can be increased to handle such environments.

CS ~ complexity science Information is intrinsic to every system… How can we benefit from this information? “construct with” Representing it … Transforming it … Measuring it efficiently? effectively? possibly? How might we measure these rooms' complexity? Am I doing this efficiently, or am I going over the same space more than once? - Is my solution effective? Am I really covering all the spaces? - Is it even possible to solve this using a list of rules? How many states and rules are necessary ? How much information does each room contain ? our best: 3 states, 6 rules our best: 4 states, 8 rules

CS ~ complexity science Information is intrinsic to every system… How can we benefit from this information? “construct with” Representing it … Transforming it … Measuring it efficiently? effectively? possibly? How might we measure these rooms' complexity? How many states and rules are necessary ? How much information does each room contain ? As a file: ~5000 bytes As a file: ~20,000 bytes!