Intro to Robots Insect Behaviours. Intro to Robots Designing Robot Behaviours Designing robot behaviours requires more imagination than knowledge. You.

Slides:



Advertisements
Similar presentations
First of all – lets look at the windows you are going to use. At the top you have a toolbar, with all your various tools you can use when customising your.
Advertisements

Sensing the World Intro to Robots.
Using the NXT Light Sensor. 2 Connect One Light Sensor – 1 From My Files use Left / Right NXT buttons and get to View menu and push Orange button. From.
Theoretical Probability Distributions We have talked about the idea of frequency distributions as a way to see what is happening with our data. We have.
Cosc 2150: Computer Organization Chapter 3: Boolean Algebra and Digital Logic.
Autonomy using Encoders Intro to Robotics. Goal Our new task is to navigate a labyrinth. But this time we will NOT use motor commands in conjunction with.
Intro to Robots Lab 6: Robot Behaviours. Intro to Robots Further Braitenberg Vehicles: Timid: –Moves forward in a straight line –One threshold light sensor.
CS 1 with Robots Robot Sensors & Actuators Institute for Personal Robots in Education (IPRE)‏
IAT 800 Braitenberg Vehicles. Oct 31, Fall 2006IAT 8002 Outline  Braitenberg vehicles –Concept behind vehicles –Introduce several vehicles –Look through.
Intro to Robots Robots are Everywhere. Intro to Robots Various robots in use today lawnmower pet baby seal for convalescents gutter cleaner home security.
Intro to Robots Lab 3. Intro to Robots Basic Robot Brain Programs consist of import lines, function definitions and and a starting point. Line 1: from.
Jochen Triesch, UC San Diego, 1 Real Artificial Life: Robots.
1 An introduction to programming concepts with Scratch.
Chapter 3 Planning Your Solution
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.
The Real Zeros of a Polynomial Function
Sensor-Actuator Networks (Braitenburg Vehicles) “Experiments in Synthetic Psychology” OR Steps toward “[really] artifical life” Norm Badler Steve Lane.
Fundamentals of Python: From First Programs Through Data Structures
What is RobotC?!?! Team 2425 Hydra. Overview What is RobotC What is RobotC used for What you need to program a robot How a robot program works Framework.
CHAPTER 2 LIMITS AND DERIVATIVES. 2.2 The Limit of a Function LIMITS AND DERIVATIVES In this section, we will learn: About limits in general and about.
GIRLS Robotic Camp. Let’s Begin Meet and Greet – Camp leaders introduce themselves – Students introduce themselves.
Application of Math and Science Principles Creating a robot that moves a specified distance straight ahead and Creating a robot that turns a specified.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 6 Value- Returning Functions and Modules.
Fall Week 3 CSCI-141 Scott C. Johnson.  Say we want to draw the following figure ◦ How would we go about doing this?
Measured Turns Introductory Presentation. Opening Activity In the Right Face Activity, we made our robot turn right using the program below.
Week 5 - Wednesday.  What did we talk about last time?  Exam 1!  And before that?  Review!  And before that?  if and switch statements.
Recursion, Complexity, and Sorting By Andrew Zeng.
Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.
EV3 Workshop Oct 3, 2015 Instructor: Chris Cartwright
Slide 9- 1 Copyright © 2006 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
How to link the robot and the computer (Bluetooth) How to turn on and off How to connect the adaptor Fluke card connection Sec Getting Started How.
Sep CS O'Hara1 CS 1301 Review Keith O’Hara
Sentry System Multiple Sensors
Braitenberg Vehicles. A little history… Valentino Braitenberg (born 1926) is a cyberneticist and former director at the Max Planck Institute for Biological.
Braitenberg Vehicles. A little history… Valentino Braitenberg (born 1926) is a cyberneticist and former director at the Max Planck Institute for Biological.
 In this packet we will look at:  The meaning of acceleration  How acceleration is related to velocity and time  2 distinct types acceleration  A.
24 Background Building 25 Computing Terminology, and Speed/Velocity Module 4 Notes: Sensing, Or Operator, Conditional Logic 28 Module 4 Algorithms,
Testing CSE 160 University of Washington 1. Testing Programming to analyze data is powerful It’s useless (or worse!) if the results are not correct Correctness.
RobotC Remote Control. Learning Objectives: Focusing on Virtual World with Physical Examples Understand Real-Time Joystick Mapping Understand how to use.
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
Repetition Intro to Computer Science CS1510 Dr. Sarah Diesburg.
Programming - Motion Intro to Robotics. Motors and Sensors Setup The first thing we need to do is tell ROBOTC that we have motors on our robot. Choose.
Repetition everywhere – comparing while in a method and as an event Susan Rodger Duke University July 2010.
ENGR 101: Robotics Lecture 6 – Follow That Light! Outline  The Scribbler's Light Sensors  Using EEPROM Memory References 
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Introduction to Computer Science – Chapter 6 CSc 2010 Spring 2011 Marco Valero.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
LCC 6310 Computation as an Expressive Medium Lecture 11.
 What does it mean to change our position over time?  It simply means that we move from one point to another in a certain amount of time.  Remember,
Automation and Robotics.  First you select the platform type so that you can use Natural Language PLTW.
Today… Python Keywords. Iteration (or “Loops”!) Winter 2016CISC101 - Prof. McLeod1.
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.
Intro to Computer Org. Assessing Performance. What Is Performance? What do we mean when we talk about the “performance” of a CPU?
Python Programming Module 3 Functions Python Programming, 2/e1.
Algorithms and Flowcharts
Python Programming Module 4 Sensors and Loops Python Programming, 2/e1.
Mathematical Practice Standards
Excel Lesson 5 Using Functions
Python Programming Module 3 Functions Python Programming, 2/e.
What you asked me to teach…
Braitenberg’s Vehicles
Braitenberg’s Vehicles
Basics for Robotics Programming
Learning to program with Logo
Dynamic Programming.
An Introduction to VEX IQ Programming with Modkit
Line Following Behavior
Line Following Behavior
Presentation transcript:

Intro to Robots Insect Behaviours

Intro to Robots Designing Robot Behaviours Designing robot behaviours requires more imagination than knowledge. You have to “think like a cockroach”. Where have we heard a comparison of imagination and knowledge before? In this chapter you will need to “think like a cockraoch” and a lot of other interesting beasts.

Intro to Robots Braitenburg Vehicles 1984, Valentino Braitenburg published “Vehicles: Experiments in Synthetic Psychology” Imaginary vehicles with simple motor skills and simple control mechanisms but complex behaviour. Trying to understand human and other animal brains. Braitenburg connected simple sensors to simple motors to produce complex behaviours that humans would recognize as fear, aggression, love, logic and free will. Is it “fear” when a robot avoids all obstacles? What are you teaching your children when you tell them, “never talk to strangers”?

Intro to Robots Braitenburg’s Law Uphill Analysis and Downhill Invention. It is harder to guess internal structure from external behaviour than to build something that will exhibit such behaviour It is harder to describe correctly the program that gives a robot a certain behaviour than it is to produce a program that will produce a specified behaviour.

Intro to Robots Vehicle 1: One sensor connected directly to one motor (in the Scribbler case, one light sensor connected to both wheels equally). Behaviour: More light, faster turn the wheels.

Intro to Robots Vehicle 1: Problem: Light Sensors range from 0 (very bright) to 5000 (very dark) while motor speeds run from -1 (fast backward to 1 (fast forward). We simplify the motor speeds by just considering forward motion (motor speeds in the range [0,1]). We need a function that converts light intensity into motor speed as follows: We call this process, normalizing the sensor readings. motor speed = f(light intensity) where f(0) = 1 and f(5000) = 0

Intro to Robots Normalizing Sensor Readings The formula for a line that passes through two points, (a,b) and (c,d), is: y – d = (x – c) d – b c - a s = 1 - i/5000 (s) (i) Exercise: Calculate this function for variables i and s.

Intro to Robots normalize(): Problem with this formula: Instead of having the robot come to a complete stop when it is pitch dark, we would like it to stop in ambient light and move forward when the light is brighter than ambient. Since ambient light might be in the 200 to 500 range we may still have the robot moving at 90% top speed in ambient light – too fast. def normalize(i): return 1 – i/ Exercise: show this to yourself.

Intro to Robots Final normalize(): We first need to calculate the average ambient light (Ambient) and then use it to formulate a new normalize() function. Exercise: Prove the robot stops in ambient light. Problem: How to calculate the value of Ambient? –Take the average of left, right and center sensors –Have the robot make a 360 degree circle and measure ambient light in all directions; then take the average. def normalize(i): if i > Ambient: i = Ambient return 1 – i/Ambient

Intro to Robots Vehicle1.py Let’s analyze the while-loop –It loops forever –To stop, execute stop() from the command line –Every time you execute forward() the speed changes. # Braitenberg Vehicle#1: Alive from myro import * initialize("com"+ask("What port?")) Ambient = getLight("center") def normalize(v): if v > Ambient: v = Ambient return v/Ambient def main(): # Braitenberg vehicle#1: Alive while True: l = getLight("center") forward(normalize(l)) Exercise: Modify this program to use other values for Ambient.

Intro to Robots Vehicle 2a: Two sensors, each one driving a different motor. Behaviour: More light, faster turn the wheels.

Intro to Robots Vehicle2a.py: # Vraitenberg Vehicle#2a from myro import * initialize("com"+ask("What port?")) Ambient = sum(getLight())/3.0 def normalize(v): if v > Ambient: v = Ambient return v/Ambient def main(): # Braitenberg vehicle#2a: Coward while True: l = getLight("left") r = getLight("right") motors(normalize(l), normalize(r)) The method getLight() returns a list of readings (left,center,right). The function sum() can take a list as an argument and add its contents. motors() drives both motors, the left and the right. Therefore it takes two arguments.

Intro to Robots Exercises: Implement the above program and observe the behaviour of the robot when shining a light on the various sensors – left, center and right. How would you describe the vehicle2a behaviour?

Intro to Robots Vehicle 2b: Two sensors, each driving a different (opposite) motor. Behaviour: More light, faster turn the wheels.

Intro to Robots Vehicle2b.py: Exercise: Modify the program vehicle2a.py to implement the behaviour of vehicle2b. Describe the behaviour of this new robot.

Intro to Robots Robot Setup: Sometimes the robot needs to be set up before actually doing what it is supposed to do. For example, calculate the value if Ambient light intensity before executing any of the Vehicle programs. If multiple things need to be done, it is often necessary for you to prevent the robot from jumping into the main program. Exercise: modify the Vehicle programs to use this approach def main(): # Description of the behavior... # Give user the opportunity to set up the robot askQuestion("Press OK to begin...", ["OK"]) # Write your robot's behavior commands here

Intro to Robots Different normalizations: The normalization we used in the previous examples is called excitatory. This is because the more intense the light (sensor activity), the faster we drive the motor. We could do the inverse. We could slow down the motors under intense light. This is called inhibitory. y – d = (x – c) d – b c - a (s) (i) s = i/5000.0

Intro to Robots Inhibitory normalize(): Remembering to take into account ambient light, the function for inhibitory normalization is: Vehicles 2a and 2b with inhibitory normalization (we call them 3a and 3b) are referred to by Braitenburg as love and explore. Why? Implement 3a and 3b, observe their behaviour and answer the above question. def normalize(i): if i > Ambient: i = Ambient return i/Ambient

Intro to Robots Other normalizations: Any function that has a domain and range inside the box in the diagram below can be the basis of a normalization function.

Intro to Robots Various normalizations: bell curve step function V function circle arc ? Braitenburg calls these normalization functions, instincts.

Intro to Robots Exercise: Compare instinct to intuition. How do they differ as reasoning tools? How do they differ from logic as a reasoning tool? We can make the robot simulate instinct and we can have it emulate logical reasoning. Can we make the robot display intuition?

Intro to Robots A Robot’s “self”: Clearly we can change a robot’s behaviour by changing its program. It’s behaviour is not inherently what the robot is all about. The part of the robot that observes/controls the robot’s sensing/reaction behaviours is its CPU. So the CPU is the closest thing we can identify in the robot to a “self”. Indeed, we often say that the architecture of a computer is the set of basic instructions its CPU understands. How does this compare to person’s “self”?

Intro to Robots Sine Function Amplitude = 1 Period = 4 * Ambient = 2π/b b = π/2*Ambient So if Ambient = 250 then the equation is y = asin(bx) where a = amplitude period = 2 π/b Ambient y = sin((π/500)x) def normalize(v): if v > Ambient: v = Ambient return sin((pi/500)*v) sin() is a built-in Python function found in the math module. pi is a built-in value. from math import *

Intro to Robots Creating Python normalization functions: Bell Curve: Other Functions: Final Analysis: We can create a behaviour/instinct from any mapping of sensor range values to [0,1]. def normalize(v): mean = Ambient/2.0 stddev = Ambient/6.0 # rough guess if v >= Ambent: v = Ambient return exp(-(v – mean)**2 / 2 * (stddev**2)) π = mean σ = standard dev Exercise: Create a normalize() function for the - step function - circle arc - V function exp() is a built-in Python function found in the math module. from math import *

Intro to Robots Alternative sensors: All the vehicles we have seen implemented until now could be re-implemented using the IR sensors instead of light sensors. Our lab exercises will do this and we can then describe the behaviour of these other vehicles.