Nawwaf Kharma.  Programming as Problem Solving with Applied Algorithms  Algorithm Design as Instruction selection, configuration and sequencing  The.

Slides:



Advertisements
Similar presentations
Robofest 2005 Introduction to Programming RIS 2.0 RCX Code.
Advertisements

Lecture 2: Systems Engineering
How Do You Make a Program Wait?. 1. What is an algorithm? 2. Can you think of a reason why it might be inconvenient to program your robot to always go.
EIGHTH GRADE ROBOTICS KITTATINNY REGIONAL HIGH SCHOOL MR. SHEA Introduction to Programming
The Turtle Laboratory Sequence Myles McNally LMICSE Workshop November , 2004 University of Mississippi.
The Turtle Laboratory Sequence LMICSE Workshop August , 2006 Villanova University.
The Turtle Laboratory Sequence LMICSE Workshop June , 2005 Alma College.
CHAPTER 10 Recursion. 2 Recursive Thinking Recursion is a programming technique in which a method can call itself to solve a problem A recursive definition.
10-1 Programming Remember: –programming language –how to program (conceptually) –intro to programming the “ROBOT” computer In this lecture: –programming.
LEGO Mindstorms NXT Programming We will be using the Common Palette for our Robots This is how you download your program onto the brick Drag and drop a.
Loops and Switches. 1. What kind of blocks are these? 2. Name two kinds of controls that can be specified to determine how long a loop repeats. 3. Give.
Programming Concepts Part B Ping Hsu. Functions A function is a way to organize the program so that: – frequently used sets of instructions or – a set.
GIRLS Robotic Camp. Let’s Begin Meet and Greet – Camp leaders introduce themselves – Students introduce themselves.
Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem.
Wait Program! WAIT please!. 1. Why is it often better to use conditional commands rather than program a robot to move exact distances? 2. What is the.
Reactive robots UPNA The Public University of Navarra Material for pupils & students.
10/10/ Controlling YOUR ROBOT. 10/10/2015 Basic Stamp  Basic Stamp Input - output pins Interpreter Chip Power supply: 5 Volts voltage Memory: EEPROM.
Today’s Agenda 1.Scribbler Program Assignment 1.Project idea due next class 2.Program demonstration due Wednesday, June 3 2.Attendance & lab pair groupings.
Final Presentation.  Software / hardware combination  Implement Microsoft Robotics Studio  Lego NXT Platform  Flexible Platform.
Additional Problems.
Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.
Barclays Robot Challenge Learn how to Program Robots.
Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks.
Castor Bot. Now, we will begin creating a robot Log onto your computer On your screen, click on the website labeled “castor bot” Your building instructions.
Find the Mindstorms Icon on the computer.. To start a new program click go.
Program Design. The design process How do you go about writing a program? –It’s like many other things in life Understand the problem to be solved Develop.
1. Introduction Intro Programming in C++ Computer Science Dept Va Tech August, 2002 © Barnette ND & McQuain WD 1 Algorithm:a finite set of instructions.
CSCI1600: Embedded and Real Time Software Lecture 28: Verification I Steven Reiss, Fall 2015.
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 4/Lab3.
The George Washington University Electrical & Computer Engineering Department ECE 002 Dr. S. Ahmadi Class3/Lab 2.
8.1 8 Algorithms Foundations of Computer Science  Cengage Learning.
Fundamentals of Informatics Lecture 12 The Halting Problem Bas Luttik.
Mindstorm NXT-G Introduction Towson University Robotics.
BEGINNER FLL PROGRAMMING WORKSHOP BY DROIDS ROBOTICS & EV3LESSONS.
Casne.ncl.ac.uk Taking care of the CrumbleBot Please do NOT stress the robot's motors 1.Do NOT push the robot 2.Do NOT hold the.
| MSC 8102:PROGRAMMING CONCEPTS By Vincent Omwenga, PhD. 1.
Forward Until Near Stop when near a wall.
Advanced issues in Robotics and Programming Dr. Katerina G. Hadjifotinou Experimental Junior High School of the University of Macedonia.
Python Programming Module 4 Sensors and Loops Python Programming, 2/e1.
Week 4 Lecture 1 Models as aids to problem solving.
How Do You Make a Program Wait?
Sequencing Learning Objective: to be able to design algorithms that use sequencing.
INTRODUCTION TO PROBLEM SOLVING
Understanding Communication with a Robot? Activity (60 minutes)
By Sanjay and Arvind Seshan
Learning Objective: to be able to design programs that use sequencing.
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Loops and Switches Pre-Quiz
Introduction to Robots and the Mind - Methods -
INTERMEDIATE PROGRAMMING LESSON
Music by Touch Music by Touch Presentation > TeachEngineering.org
Module F: Presentation Understanding Robot Fundamentals
BEGINNER EV3 PROGRAMMING Lesson
CSE 105 theory of computation
Week 2 – Basic Constructs 1
Sequencing Learning Objective: to be able to design algorithms that use sequencing.
Controlling YOUR ROBOT
BEGINNER PROGRAMMING LESSON
Forward Until Touch Robot goes forward until it hits a wall.
Controlling your quadcopter
An Introduction to VEX IQ Programming with Modkit
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 5.
BEGINNER PROGRAMMING LESSON
Haskell Tips You can turn any function that takes two inputs into an infix operator: mod 7 3 is the same as 7 `mod` 3 takeWhile returns all initial.
Loops and Switches How Do You Make Loops and Switches? lesson > TeachEngineering.org Center for Computational Neurobiology, University of Missouri.
Basic Concepts of Algorithm
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
CSE 105 theory of computation
Controlling your quadcopter
LEGO MINDSTORMS NXT PROGRAMMING
Presentation transcript:

Nawwaf Kharma

 Programming as Problem Solving with Applied Algorithms  Algorithm Design as Instruction selection, configuration and sequencing  The intimate relationship between robotic hardware and controlling software  Several robotic (and human) programming problems, with hints!  Lessons learned and guidance issued 2

 One definition of programming is it is applied problem solving - You have a problem (e.g. need a program to calculate the area of the circle). - What inputs and outputs are needed? - How does what is entered produce the right output?  What needs to be done? 3

 Problem: An ant is in a corner of a room at the ceiling. There is a bowl of sugar at the opposite diagonal corner of the room on the floor. The room is a cube with the width of the room 3m.  In groups of 2 or 3 Discuss different ways for solving the problem. Use speech, writing and drawing to explain your ideas. Can you use drawing to help you solve the problem? Come up with a preferred solution. Can you prove that your solution is correct? 4

stop(); Stops both motors, then moves onto the next instructio; if you want it stop and wait use halt(). forward(time1); This moves the robot forward for time1 milliseconds (ms). spinRight(time1); Moves robot in a tight circle to the right using both motors time1 ms. turnRight(time1); This moves the robot to the right in a looser circle than spinRight() using both motors time1 ms. spinLeft(time1); This moves the robot in a tight circle to the left using one motor for time1 ms. turnLeft(time1); Moves robot to the left in a looser circle than spinLeft() using 1 motor time1 ms. backward(time1); This moves robot backward time1 ms. bumpIt(int time1) Using both touch sensors on ports 1 and 3 : If either touch sensor is true then move the robot backwards. bumper(x) Using a touch sensor on port x: Returns true if contact is made. checkBumpers() Using both touch sensors on ports 1 and 3 : If either touch sensor makes contact then true is returned else false is. checkLight(x) Uses a light sensor on port x: Returns true if the sensor is above a black line halt() Stops the robot until the view button is pressed change_direction(A,B,C) A sets the duration, B power to left motor and C power to the right motor checkLight_x(X) which produces true value for light levels measured to be between 33 and 42 by the light sensor on port X. measureLight(X) Returns the light level as an integer for a particular sensor port X. [from Lego] 5

A. Get inputs from sensors B. Process inputs (and state variables) C. Make decisions D. Send outputs to effectors  Example: If (checkLight(1) && !checkLight(2)) { turnRight(1000); } 6

 Although: (a) instructions are given, such as the set of instructions for Lego Mindstorms robots or the Atmega8 chip; (b) and processing and decision making instructions are related to robot software design;  The actual number and especially meaning of the inputs and of the outputs are determined by robot hardware design: you map I/O from/to the real-world Distance ahead (x2) Movement of a leg (x6) 7

 Software are programs and programs are applied algorithms  Definition: algorithm is an effective method for solving a problem using a finite sequence of instructions [  So, given a set of instructions, and a hardware design, the next thing is figuring our how to ◦ Configure instructions: how many milliseconds? ◦ Sequence instructions: check first then move.  Example If (checkLight_x(1) AND ! checkLight_x(2)) turnRight(2000); 8

 The programmable controller of a robot determines your basic set of instructions  The hardware design of a robot determines the number and meaning of the inputs and outputs  These two (controller and hardware) define the limits of possible software solutions, where software = applied algorithm  So, algorithm design is really: instruction selection, mapping, configuration and sequencing. 9

Create an algorithm then program, using the instructions provided, to make a robot trace out a square. Each side of the square will be the same length as the distance covered by the robot when it moves forward a second. A. What algorithm came to your mind? Why? B. What does this algorithm demand in terms of inputs and outputs? C. Is this the only solution? Which one do you prefer and why? [problems 1-4 adapted from Problem Solving with Robots by Scott Turner] 10

Get two identical robots to do a little dance. The moves are up to you. A robot will initiate the dance (a) when it has been moving for 5 seconds (without incident) and (b) upon detection of the other robot- you may assume there are no other objects in the area. When a dance terminates, the robots should select an arbitrary direction to move in. A.What are the robots “states of existence”? B.For every state, what inputs and outputs does it need? C.What is the dance routine, and how does a robot select an arbitrary direction? D.How would the addition of 4 walls (of an empty room) change your approach? 11

 Write down a detailed list of instructions for opening a fizzy drinks bottle.  Your instructions must clear enough so that somebody could use to open the bottle based ONLY on your instructions. The person should not get wet whilstopening the bottle.  Constraints: It is a person opening the bottle. The bottle top is a screw top and is not glued down. The person has use of both hands and is strong enough to open the bottle under normal circumstances. The person understands simple words such as grip, turn, clockwise, anti-clockwise, left and right, on off and combinations ‘right hand on bottle top’. You do need to specify which hand is used. Your instruction should not be able to interpreted in an other way. 12

Produce a line following robot routine. The robot should follow a black line. You may configure the robot with any number of light sensors in any configuration. If a light sensor is above a black line it returns a ‘true’ otherwise ‘false’. You may assume that 2 sensors can over the width of a black line. A.What are all the robots “states of existence”? What defines every state? How do you decide a change of state? B.When in a state, what routine should be executed? C.Did you include start and end states? D.How would the addition of noise (e.g. variable-width line) affect your design? Should you design for a perfect world then add “noise” or are you better off designing For the real world? 13

 Robot Based Problem Solving is actually the co- design of hardware and software (i.e. algorithmic) solutions to real world problems  Generally speaking, one should design a combined solution, which is implemented through hardware and software  In many cases, hardware design restricts (and as such defines the scope of) algorithmic solutions  One may approach robot control algorithms as one does a state machine, with  Different states each with its own handling routine  It is important, however, not to assume that your simplified model of the world is the real world! 14