5 design a reactive implementation
DESCRIPTION
5 Design a reactive Implementation . Media Communications laboratory Mohammed Ahmed ID: 201250570. Designing a Reactive Implementation. List the steps involved in designing a reactive behavioral system. Use schema theory to program behaviors using object-oriented programming principles. - PowerPoint PPT PresentationTRANSCRIPT
Chapter 5: Designing a Reactive Implementation
1
5 Design a reactive Implementation
Media Communications laboratoryMohammed Ahmed
ID: 201250570
Introduction to AI Robotics (MIT Press)
5
Chapter 5: Designing a Reactive Implementation
2
Designing a Reactive Implementation
Introduction to AI Robotics (MIT Press)
List the steps involved in designing a reactive behavioral system.
Use schema theory to program behaviors using object-oriented programming principles.
Design a complete behavioral system, including coordinating and controlling multiple concurrent behaviors.
Describe the two methods for assembling primitive behaviors into abstract behaviors: finite state machines and scripts.
Design-Beh. Table-StepsCase StudyCoordination-FSA-ScriptsSummary
5
Chapter 5: Designing a Reactive Implementation
3
Overview:
Introduction to AI Robotics (MIT Press)
Challenges: Designing behaviors tends to be an art not a
science, How to start? Well designed and tested behaviors, How
behaviors are integrated into system?Objective Constructing a reactive robot system
Object oriented programming approach to design behaviors.(Based on schema theory)
Finite state automata and scripts(Similar to innate releasing mechanism)
5
Chapter 5: Designing a Reactive Implementation
4
Behaviors as Objects in OOP
Introduction to AI Robotics (MIT Press)
Percept: data Structure, Perceptual schema Abstract behavior: assembled from other
behaviors i.e derived primitive behavior.
5
Chapter 5: Designing a Reactive Implementation
5
Example: a primitive move to goal behavior
Introduction to AI Robotics (MIT Press)
Pick up trash challenge, find coca Can[Red] , then find trash[blue] bin, then repeat
Move to goal behavior
Follow Corridor(PF), Schema Implementation 1.
5
Chapter 5: Designing a Reactive Implementation
6
Steps in Designing a Reactive Behavioral System
Introduction to AI Robotics (MIT Press)
Describe the task
Describe the robot
Describe the environment
Specification& Analysis:ecologicalniche
Implement & refine each behavior
Test each behavior independently
Implementation& unit testing
Test behaviors together SystemTesting
Describe how the robot should act in response to its environment
Design
Design-Beh. Table-StepsCase StudyCoordination-FSA-ScriptsSummary
5
Chapter 5: Designing a Reactive Implementation
7
CSM 1994 UGV Competition
Fully autonomous vehicle, all on-board, navigate a course 10ft wide, about 800ft long
Obstacles Carry a 20 pound payload
Introduction to AI Robotics (MIT Press)
(this is from1996, but it’sa way betterpicture)
Design-Beh. Table-StepsCase StudyCoordination-FSA-ScriptsSummary
5
Chapter 5: Designing a Reactive Implementation
8
1-3. Describe the Task, Robot, Environment
Introduction to AI Robotics (MIT Press)
Have to use computer vision… black &white, slow processor speeds (didn’t get to design the robot) White (bright) should be in the center of the image Reflections on grass are white, but random so average out
If stay in middle, never encounter an obstacle! 150ms update rate needed for steering to stay in control at
~1.5mph
Camcorder on aPanning mast, going toA framegrabber
Sonar on a panningmast
33MHz 486 PC runningLynx (commercial unix)Design
-Beh. Table-StepsCase StudyCoordination-FSA-ScriptsSummary
All coding was doneIn c++
5
Chapter 5: Designing a Reactive Implementation
9
4. Describe how robot should act
Introduction to AI Robotics (MIT Press)
Follow the line and stay in the middle Follow-line[only one behavior was
proposed] Only need the Camcorder!
Design-Beh. Table-StepsCase StudyCoordination-FSA-ScriptsSummary
5
Chapter 5: Designing a Reactive Implementation
10
5-6 Refine and test each behavior
Introduction to AI Robotics (MIT Press)
Follow-line Worked with toilet paper (indoors), Worked with athletic line tape (outdoor)Design
-Beh. Table-StepsCase StudyCoordination-FSA-ScriptsSummary
5
Chapter 5: Designing a Reactive Implementation
11
7 Test with other behaviors
Introduction to AI Robotics (MIT Press)
“Full dress rehearsal” Oops, bales of hay are bright compared to grass,
change the centroid to cause collision Go back to step 4:
Follow line until “see” an obstacle, then just go straight until things return to normal Hard to do visually in real time Sonar! Look to the side and when something is close,
it’s a bale, so go straight
Design-Beh. Table-StepsCase StudyCoordination-FSA-ScriptsSummary
5
Chapter 5: Designing a Reactive Implementation
12
Final System Round 1
OOPS: sonar connection off so it hit the bale
Round 2 White shoes and
dandelions, plus Killer Bale
Demo round Hill vs. implicit flat
earth assumption Round 3
Trapped by sand, but $5K richer!
Introduction to AI Robotics (MIT Press)
Design-Beh. Table-StepsCase StudyCoordination-FSA-ScriptsSummary
5
Chapter 5: Designing a Reactive Implementation
13
Main Points
Introduction to AI Robotics (MIT Press)
Let the WORLD BE ITS OWN BEST REPRESENTATION and CONTROL STRUCTURE “line” wasn’t a “line” just centroid of brightest
pixels in the image Pick up trash: if can is in gripper, then go to the
recycle bin Design process was iterative; rarely get a
workable emergent behavior on the first try There is no single right answer Could have been done with subsumption,
pfields, rules, whatever
Design-Beh. Table-StepsCase StudyCoordination-FSA-ScriptsSummary
5
Chapter 5: Designing a Reactive Implementation
14
Current UGV
Introduction to AI Robotics (MIT Press)
This video was presented by Dr. Fish, the Army Chief Scientist at the beginning of his keynote speech at the AUVSI Programs Meeting Ground Day on February 7, 2012 in Washington D.C.
Design-Beh. Table-StepsCase StudyCoordination-FSA-ScriptsSummary
5
Chapter 5: Designing a Reactive Implementation
15
Recap: Categories of Algorithm
Introduction to AI Robotics (MIT Press)
Behavioral coordination
Concurrent Behaviors
Cooperating Methods(Blendi
ng)
Potential fields Fuzzy Logic
Competing Methods(Arbitr
ation)
Subsumption Voting
Sequences
FSM Scripts
5
Chapter 5: Designing a Reactive Implementation
16
Assemblages of Behaviors
Introduction to AI Robotics (MIT Press)
The prev. Case study was trivial, How to represent the releasers and their interactions into some sort of sequencing logic.
Abstract Behavior: behaviors assembled from several other primitive behaviors
What to do if you have a SEQUENCE of behaviors as well as CONCURRENCY?
5
Chapter 5: Designing a Reactive Implementation
17
Assemblages of Behaviors
Introduction to AI Robotics (MIT Press)
Two equivalent methods Finite state automata (FSA) Scripts Skills: Collect behavior-like primitives called reaction –
Action Packages(RAP) into “sketchy plan” which can be filled as the robot excutes
( and other ways too) Two approaches:
Stuff the coordination mechanism into a separate controlling program (like a main()) Hurts portability, adding new behaviors “on top”
Stuff the coordination mechanism into a meta-behavior or abstract behavior using recursive-ness of schemas Coordination mechanism is the coordinated control program
part of the behavioral schema
Design-Beh. Table-StepsCase StudyCoordination-FSA-ScriptsSummary
5
Chapter 5: Designing a Reactive Implementation
18
Finite state automata (FSA)
Introduction to AI Robotics (MIT Press)
Are set of popular mechanism for specifying what a program should be doing at a given time or circumstance.
Represented as state diagram the designer has to be able to specify a finite number of
discrete states(K) that the robot should be in By convention, START STATE(s, drawn with a double
circle.) there is always a Start state, and the robot would always start there.
Inputs are the behavioral releasers, and appear under the column heading σ
third part of the FSM is the transition function, called , which specifies what state the robot is in after it encounters an input stimulus, .
Final State: Terminal task
5
Chapter 5: Designing a Reactive Implementation
19
FSA: M={K,S,d,s,F}
Introduction to AI Robotics (MIT Press)
K: all the states, each is “q”- behaviors d: transition function, d(q,s)= new behavior S: inputs that agent can “see”, each is s–
stimulus/affordances/Represented by arrows Each arrow represents the releaser for a behavior. q0: Start state(s)- part of K F: Terminating state(s)- part of K
Design-Beh. Table-StepsCase StudyCoordination-FSA-ScriptsSummary
CSM 1994 UGV Competition
5
Chapter 5: Designing a Reactive Implementation
20
FSA representation of the coordination and control of behaviorsin the UGV competition
Introduction to AI Robotics (MIT Press)
5
Chapter 5: Designing a Reactive Implementation
21
A pick up the trash FSA
Introduction to AI Robotics (MIT Press)
The Behavior table
Problem with Behavior table, Doesn’t show the sequence and how did the designer come wit h behaviors
5
Chapter 5: Designing a Reactive Implementation
22
A pick up the trash FSA
Introduction to AI Robotics (MIT Press)
5
Chapter 5: Designing a Reactive Implementation
23
Implementation
Introduction to AI Robotics (MIT Press)
One advantage of FSA is that they are abstract, and can be implemented in a number of ways
5
Chapter 5: Designing a Reactive Implementation
24
FSA Summary
Introduction to AI Robotics (MIT Press)
If the robot had many tasks,, the ability to recycle trash would be an abstract behavior, called by the main program whenever the robot needed to recycle trash. In that case, the FSA logic would be placed in the coordinated control Program
Advantages Formal mechanism Have to fill in the table, so a way of spotting unforseen effects
Disadvantages Hard to keep up with implicit behaviors
Ex. Avoid obstacle is often running throughout ALL states, gets tedious to express it formally
Tend to add explicit variable for transitions, rather than rely on emergent behavior from environment
Difficult to show behavioral concurrency
Design-Beh. Table-StepsCase StudyCoordination-FSA-ScriptsSummary
5
Chapter 5: Designing a Reactive Implementation
25
Scripts
Introduction to AI Robotics (MIT Press)
Abstract Behaviors often use scripts Needs a more Naturalistic Representation and abstraction Scripts idea from AI(Natural language processing) There is a primary Causal Chain default causal chain has 4 components
initialization e.g. Orient to the correct direction in the corridor
Nominal Use potential field
Termination Stopping case
Exceptions Behaviors are actors cues can index into sequence Scripts are equivalent to FSA but may be more natural or
readable for sequences
Design-Beh. Table-StepsCase StudyCoordination-FSA-ScriptsSummary
5
Chapter 5: Designing a Reactive Implementation
26
Scripts
Introduction to AI Robotics (MIT Press)
Script Behavior Analog Examples
Goal Task Find victims in rubble
Places Environment, applicability or“taskability” for new tasks
Collapsed buildings
Actors Behaviors explore(), dance(), avoid(), crawl, move2void, move2victim
Props, cues Percepts Voids: Dark, concaveVictims: heat, motion, color
Causal Chain
Sequence of behavior Explore, dance, move2void, crawl, move2victim, dropRadio
Subscripts Exception handling If lose communications, return home
Design-Beh. Table-StepsCase StudyCoordination-FSA-ScriptsSummary
Scripts Summary• for each update... \\ look for props and cues first:
cans, trash cans, gripper rStatus=extract_color(red, rcx, rSize);
• if (rStatus==TRUE) SEE_RED=TRUE; else SEE_RED=FALSE; • bStatus=extract_color(blue, bcx, bSize); if
(bStatus==TRUE){ SEE_BLUE=TRUE; NO_BLUE=FALSE;} else {SEE_BLUE=FALSE; NO_BLUE=TRUE;} AT_BLUE=looming(size, bSize); gStatus=gripper_status();
• if (gStatus==TRUE) { FULL=TRUE; EMPTY=FALSE; } else { FULL=FALSE; EMPTY=TRUE;}
• if (EMPTY){ if (SEE_RED){ move_to_goal(red);
else wander();} else{grab_trash(); if (NO_BLUE) wander(); else if (AT_BLUE) drop_trash(); else if (SEE_BLUE) move_to_goal(blue); }
5
Chapter 5: Designing a Reactive Implementation
28
Scripts Summary
Introduction to AI Robotics (MIT Press)
Advantages A more storyboard like way of thinking about the
behaviors If-then, switch style of programming like FSA Since a Script is “in” a behavior, other behaviors
such as avoid can be running concurrently without having to appear “in” the script
Exception handling is a big plus in Real Life Disadvantages
Can be a bit of overkill for simple sequences, especially with C++
Design-Beh. Table-StepsCase StudyCoordination-FSA-ScriptsSummary
5
Chapter 5: Designing a Reactive Implementation
29
Summary
Introduction to AI Robotics (MIT Press)
Design of reactive systems is similar to design of object-oriented software systems Highly modular, can test behaviors independently
Follows the basic steps in the Waterfall Lifecycle Describe task, robot, environment, how robot should
act, refine behaviors, test independently, test together. Except lots more iteration, making it more like Spiral
Behavior tables can help keep track of what’s a behavior and its releasers and percepts
Sequences of behaviors, rather than combinations, can be controlled by a separate routine or by adding a routine to the coordinated control program in the behavioral schema FSA and Scripts are two main methods
Design-Beh. Table-StepsCase StudyCoordination-FSA-ScriptsSummary