CS 1 with Robots Behavior Based Control Institute for Personal Robots in Education (IPRE)‏

Slides:



Advertisements
Similar presentations
While Loops and If-Else Structures
Advertisements

Q and A for Chapter 6 CS 104 Victor Norman. Return values Q: A function definition that returns a value (i.e., a non-void function) must have at least.
CS&E 1111 ExIFs IFs and Nested IFs in Excel Objectives: Using the If function in spreadsheets Nesting If functions.
Control Structures Control structures are used to manage the order in which statements in computer programs will be executed Three different approaches.
Towards More Efficient Navigation for Robots and Humans David V. Lu and Bill Smart.
Intro to Robots Lab 6: Robot Behaviours. Intro to Robots Further Braitenberg Vehicles: Timid: –Moves forward in a straight line –One threshold light sensor.
Behavior-Based Robots Bert G. Wachsmuth Seton Hall University.
Defining functions in lisp In lisp, all programming is in terms of functions A function is something which –takes some arguments as input –does some computing.
CS 1 with Robots Robot Sensors & Actuators Institute for Personal Robots in Education (IPRE)‏
ECE122 L11: For loops and Arrays March 8, 2007 ECE 122 Engineering Problem Solving with Java Lecture 11 For Loops and Arrays.
An Intro to Robots and Computer Programming
Quantum Robot for Teenagers Arushi Raghuvanshi Yale Fan Michal Woyke Marek Perkowski Presentation at ISMVL 2007 May
CS 201 Functions Debzani Deb.
Intro to Robots Control Paradigms. Intro to Robots How We Control the Robot computer IDLE program robot program myro library.
CS201 – C Functions Procedural Abstraction Code Reuse C Library.
Programming – Touch Sensors Intro to Robotics. The Limit Switch When designing robotic arms there is always the chance the arm will move too far up or.
Simple Python Loops Sec 9-7 Web Design.
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.
Programming Concepts (Part B) ENGR 10 Introduction to Engineering 1 Hsu/Youssefi.
Robot Contest Guidelines for 601A Sound Controlled Robot Team Event 1: Each team will be timed in navigating their robot on a horizontal surface (the floor).
CATHERINE AND ANNIE Python: Part 4. Strings  Strings are interesting creatures. Although words are strings, anything contained within a set of quotes.
Rules of Fractions Investigation. What do you understand from this statement? What can we say about this? What do we need to know first? What should we.
7.2 V battery pack and charger Put the battery in the charger station at the end of the lab. period. Red light indicates charging. Ken Youssefi Introduction.
Making Redding Bully-Free Lessons in teamwork and unity.
Behavior Programming. Structured Programming A series of if-thens Easy to get started in and hardly requires any thought or design beforehand But the.
Chapter 5 Loops. Overview u Loop Statement Syntax  Loop Statement Structure: while, for, do-while u Count-Controlled Loops u Nested Loops u Loop Testing.
Barclays Robot Challenge Learn how to Program Robots.
1 karel_part2_Inheritance Extending Robots Tired of writing turnRight every time you start a new karel project. How do we avoid re-writing code all the.
Conditions in Java. First…Boolean Operators A boolean data type is always true or false. Boolean operators always return true or false For example: (x.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
AP Computer Science A – Healdsburg High School 1 Unit 9 - Why Use Classes - Anatomy of a Class.
ITEC 109 Lecture 11 While loops. while loops Review Choices –1 st –2 nd to ?th –Last What happens if you only use ifs? Can you have just an else by itself?
Vex Robotics Program four: reversing and turning.
SATMathVideos.Net A set S consists of all multiples of 4. Which of the following sets are contained within set S? A) S2 only B) S4 only C) S2 and S4 D)
5.04 Apply Decision Making Structures
While and If-Else Loops ROBOTC Software. While Loops While loop is a structure within ROBOTC Allows a section of code to be repeated as long as a certain.
Programming: Putting Together the Pieces Built-in Functions and Expressions Alice.
31/01/ Selection If selection construct.
Programming with LabVIEW Intro to programming and.
# 1# 1 Nested If Statements in VBA What is a compound condition that we evaluate? What is a Nested If statement? How do we use ElseIf? CS 105 Spring 2010.
Control structures in C by Dr P.Padmanabham Professor (CSE)&Director Bharat Institute of Engineering &Technology Hyderabad Mobile
1 Review for Midterm 2 Aaron Bloomfield CS 101-E.
1 Flow of Control Chapter 5. 2 Objectives You will be able to: Use the Java "if" statement to control flow of control within your program.  Use the Java.
Deriving Consistency from LEGOs What we have learned in 6 years of FLL by Austin and Travis Schuh © 2005 Austin and Travis Schuh, all rights reserved.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004.
CS 270 Lecture 1 In Class Problems. Q1: Logic Puzzle You arrive at the end of a long hallway. There are two knights guarding two doors. One knight always.
Introduction to Robots and the Mind - Programming with Sensors - Bert Wachsmuth & Michael Vigorito Seton Hall University.
C++ Programming: CS102 LOOP. Not everything that can be counted counts, and not every thing that counts can be counted. −Albert Einstein Who can control.
Sensor Information: while loops and Boolean Logic.
Deriving Consistency from LEGOs
CS170 – Week 1 Lecture 3: Foundation Ismail abumuhfouz.
University of Central Florida COP 3330 Object Oriented Programming
University of Central Florida COP 3330 Object Oriented Programming
Microsoft Visual Basic 2005 BASICS
Introduction To Robot Decision Making
Factors, multiple, primes: Factors from prime factors
Control Structures (Structured Programming) for controlling the procedural aspects of programming CS1110 – Kaminski.
Complex Conditionals Human languages are ambiguous
Dealing with Feelings Health- Chapter 10
Types, Truth, and Expressions (Part 2)
Robotics and EV3 - Behavior-Based Robots -
IF Statements.
CS139 October 11, 2004.
Ordering fractions We can order numbers fairly easily. E.g
Control Structures (Structured Programming) for controlling the procedural aspects of programming CS1110 – Kaminski.
Chapter 3: Selection Structures: Making Decisions
Ordering fractions We can order numbers fairly easily. E.g
Lego MINDSTORMS EV3.
Factors, multiple, primes: Multiples
True or False True or False
Presentation transcript:

CS 1 with Robots Behavior Based Control Institute for Personal Robots in Education (IPRE)‏

Aug Behavior Based Control Behavior 1 Behavior 2 Behavior 3 Arbitrator Robot Actions

Aug Behavior Based Control Behavior based control allows you (the programmer) to specify robot behaviors. Multiple behaviors “fight it out” for control of the robot.

Aug Each Behavior May use sensor values to determine what to ask the robot to do, or may not. Makes a recommendation to the arbitrator about what action the robot should take. or....tells the arbitrator that it doesn't have an opinion.

Aug The Arbitrator Asks each behavior what the robot should do. Decides which behavior(s) to use. Advanced Arbitrators may even allow the robot to do a mixture of different behaviors at the same time!

Aug Implementing a Behavior based control system You need to specify each behavior...and... An arbitrator that decides which behavior to follow at any particular point in time and makes the robot's actuators follow that behavior's recommendation.

Aug Problem Statement: Your robot should move continuously looking for a bright light. When it finds a bright light, it should go towards it. The robot should turn to avoid hitting obstacles.

Aug Finding Behaviors (look for verbs!)‏ Your robot should move continuously looking for a bright light. When it finds a bright light, it should go towards it. The robot should turn to avoid hitting obstacles.

Aug Summarized: Move Look (for light)‏ Go to the light Avoid obstacles

Aug Combined/Simplified: Move Go towards light Avoid obstacles

Aug Prioritized: 1st: Avoid obstacles 2nd: Go towards light 3rd: Move

Aug Questions about behaviors How does the behavior communicate with the arbitrator? How does it indicate what action it wants the robot to take? How does it indicate that it doesn't have a recommendation? All of these questions can be answered by building the Arbitrator.

Aug The Arbitrator Calls each behavior. Sees what each behavior wants to do. Selects the recommendation from the highest priority behavior. Tells the robot to do that behavior's recommended action.

Aug The Arbitrator/Behavior interface Each behavior needs to return the same data (in the same order) to the Arbitrator. You can pick any data and any order you want, but you must be consistent in all of your code. For this example, we choose to return: Boolean – Tells if a behavior has a recommendation (True) or not (False)‏ Translate Value – Float from -1.0 to 1.0 telling the recommended translate amount. (0.0 is stopped)‏ Rotate Value – Float from -1.0 to 1.0 telling the recommended rotate amount. (0.0 is no rotation)‏ [ True, 0.0, 0.0 ] - Represents a recommendation to stop completely.

Aug Behavior 1: Cruse #Move behavior: Always recommends that the robot move. def move(): return( [ True, -1.0, 0.0 ] )‏

Aug Behavior 2: Avoid Obstacles #Avoid behavior, makes the robot turn away from obstacles. def avoid(): sensorVals = getIR()‏ leftV = sensorVals[0] rightV = sensorVals[1] if (leftV == 0) or (rightV == 0): return( [ True, 0.0, 1.0 ] )‏ else: return( [ False, 0.0, 0.0 ] )‏

Aug The Arbitrator: Putting Avoid & Move together! #Calls each behavior in the order listed. If a behavior gives a recommendation, # arbitrate passes the recommended action on to the robot and then skips the # rest of the behaviors. (So avoid has a higher priority than move.)‏ def arbitrate(): behaviors = [avoid, move] for behavior in behaviors: values = behavior()‏ hasRec = values[0] transVal = values[1] rotVal = values[2] if (hasRec == True): translate(transVal)‏ rotate(rotVal)‏ return()‏

Aug Behavior 3: Seek Light #seekLight behavior: turns towards (bright) light def seekLight(): values = getLight()‏ leftV = values[0] rightV = values[2] if ( leftV > 200) and (rightV > 200): return( [False, 0.0, 0.0] )‏ else: if (leftV < rightV): return( [True, -0.5, 0.33] )‏ else: return( [True, -0.5, -0.33] )‏

Aug Updating the Arbitrator for a new behavior #Calls each behavior in the order listed. If a behavior gives a recommendation, # arbitrate passes the recommended action on to the robot and then skips the # rest of the behaviors. (So avoid has a higher priority than move.)‏ def arbitrate(): behaviors = [avoid, seekLight, move] for behavior in behaviors: values = behavior()‏ hasRec = values[0] transVal = values[1] rotVal = values[2] if (hasRec == True): translate(transVal)‏ rotate(rotVal)‏ return()‏