September 10, 2002 Class Meeting 6

49
Robot Behavior September 10, 2002 Class Meeting 6

Transcript of September 10, 2002 Class Meeting 6

Page 1: September 10, 2002 Class Meeting 6

Robot Behavior

September 10, 2002

Class Meeting 6

Page 2: September 10, 2002 Class Meeting 6

Reminders

• Assignment #2: – Due at beginning of class on Thursday– Be sure to read the clarification announced last week and posted to the class

web site

• Exam #1: – Next Thursday, September 19th

– Will cover all class lectures, reading material, assignments

Page 3: September 10, 2002 Class Meeting 6

Current robot position, orientation

Next subgoal position

X

Robot should move along a path like this

Robot should take path that minimizes turning angle

Robot should NOT move along a path like this

Page 4: September 10, 2002 Class Meeting 6

Geometry to calculate for Assignment #2

(xc,yc,θc) = current robot position, orientation(xG,yG) = goal positionθd = angular error between current robot

direction and desired robot direction

θc(xG,yG)

θd

You need to convert θd to a velocity and turning command vm(translate,rotate,rotate) so that the robot follows a path similar to that shown on the previous page.

(xc,yc)

Page 5: September 10, 2002 Class Meeting 6

Today’s Objectives

• To learn what robotic behaviors are

• To obtain a basic understanding of the design approaches related to behavior-based robotic systems

• To understand the methods that can be used to express and encodethese behaviors

Page 6: September 10, 2002 Class Meeting 6

Reactive Systems

• Behavior = Mapping of sensory inputs to a pattern of motor actions that are used to achieve a task

or (equivalently) = Reaction to a stimulus

• A reactive robotic system tightly couples perception to action without the use of intervening abstract representations or time history

• Recall: reactive paradigm:

Sense Act Plan

Page 7: September 10, 2002 Class Meeting 6

Characteristics of Reactive Robotic Systems

• Behaviors serve as basic building blocks for robotic actions – Typically, behaviors are simple sensorimotor pairs

• Use of explicit abstract representational knowledge is avoided in the generation of a response

• Animal models of behavior often serve as a basis for these systems

• These systems are inherently modular from a software design perspective

Page 8: September 10, 2002 Class Meeting 6

What is meant by “No abstract / symbolic representation”?

• Example of symbolic / abstract representation:GRASPED(Herbert,SodaCan)

• Same situation without symbolic / abstract representation:triggered(gripper_IR-break-beam)

• We’ll talk more about symbolic, sub-symbolic representations in a later class

Page 9: September 10, 2002 Class Meeting 6

Reactive Behaviors: At one extreme of spectrum of robot control

• Recall:Deliberative Reactive

Purely symbolic Reflexive

Speed of response

Predictive capabilities

Dependence on accurate, complete world models

Representation-dependentSlower responseHigh-level intelligence (cognitive)Variable latency

Representation-freeReal-time responseLow-level intelligenceSimple computation

Page 10: September 10, 2002 Class Meeting 6

Navigational Example

• Consider student going from one room to another. What is involved?– Getting to your destination from your current location– Not bumping into anything along the way– Skillfully negotiating your way around other students who may have the same

or different intentions– Observing cultural idiosyncrasies (e.g., deferring to someone of higher priority

– age, rank, etc.; or passing on the right (in the U.S.), …)– Coping with change and doing whatever else is necessary

Page 11: September 10, 2002 Class Meeting 6

Reactive/ Behavior-Based Robotic Systems

• Provide a means for a robot to navigate in an uncertain environment and unpredictable world without planning

• Operate by endowing the robot with behaviors that deal with specific goals independently and coordinating them in a purposeful way

Page 12: September 10, 2002 Class Meeting 6

Basis for Robotic Behavior

• Key questions:– What are the right behavioral building blocks for robotic systems?– What really is a primitive behavior?– How are these behaviors effectively coordinated?– How are these behaviors grounded to sensors and actuators?

• No universally agreed-upon answers

• Ultimate judge: appropriateness of the robotic response to a given task and environment

Page 13: September 10, 2002 Class Meeting 6

Three common methodsfor specifying and designing robotic behaviors

1. Ethologically guided/constrained design

2. Situated activity-based design

3. Experimentally driven design

Page 14: September 10, 2002 Class Meeting 6

1. Ethologically Guided/Constrained Design

Consult Ethological Literature

Extract Model

ImportModel

To Robot

RunRobotic

Experiments

EvaluateResults

Guide NewBiological

Experiments

EnhanceModel

Done

• Use studies of animal behavior (recall last class discussions) for inspiration/guidance

Page 15: September 10, 2002 Class Meeting 6

Example: Toad/robot navigation

• Motion divergence field from toad/robot studies• Analogous implementation in robots of potential fields

Worms

These fields define most likely direction of motion for animal/robot at each point in space

Obstacle Fence

Toad

Page 16: September 10, 2002 Class Meeting 6

2. Situated Activity-Based Design

• Situated activity: robot’s actions are predicated upon the situations in which the robot finds itself

• Therefore, the perception problem is reduced to recognizing whatsituation(s) the robot is in and then choosing one action (out of perhaps many) to undertake.

• When robot finds itself in new situation, it selects more appropriate action

• Using this design methodology: requires solid understanding of relationship between robotic agent and its environment

Page 17: September 10, 2002 Class Meeting 6

Design Methodology for Situated Activity

Assess Agent-Environment Dynamics

Partition Into Situations

Create Situational Responses

Import Behaviors to Robot

EvaluateResults

Run Robotic Experiments

Enhance, Expand,Correct Behavioral Responses

Done

Page 18: September 10, 2002 Class Meeting 6

Here, Situations Don’t Need Biological Basis

• Arbitrarily complex situations can be created and specified

• Approach by Agre and Chapman (1987) with Pengi system:– Situations characterized by their indexical-functional aspects– Indexical what makes the circumstances unique– Functional robotic agent’s intended outcome or purpose in a given

situation

• Examples of indexical-functional characterization of situations:– Situation 1: the-block-I-need-to-kick-at-the-enemy-is-behind-me– Situation 2: I’ve-run-into-the-edge-of-the-wall

Page 19: September 10, 2002 Class Meeting 6

Pros/Cons of “Situations”

• Situations can be highly artificial

• Situations can be arbitrarily large in number

• Multiple candidate actions may be in conflict – no planning to project consequences of actions

• More expansive version of theory of situated activity: Universal plans– Cover entire domain of interaction– But, enumeration of every possible situation is impractical and mathematically

intractaable

Page 20: September 10, 2002 Class Meeting 6

3. Experimentally Driven Design

• Created in a bottom-up manner• Iterative design

Build Minimal System

ExerciseRobot

Add NewBehavioral

CompetenceEvaluateResults

Done

Page 21: September 10, 2002 Class Meeting 6

Example of Experimentally Designed Robot

• Genghis: Designed at MIT AI Lab in late 1980s by Rodney Brooks• Built in a bottom-up fashion using experimentally driven design• “A robot that walks; emergent behaviors from a carefully evolved

network”, by Brooks, MIT AI Lab memo, 1989.

Genghis

Page 22: September 10, 2002 Class Meeting 6

Incremental Design of Genghis

1. Stand up2. Simple walk3. Force balancing4. Leg lifting5. Whiskers6. Pitch stabilization7. Prowling8. Steered prowling

Page 23: September 10, 2002 Class Meeting 6

Genghis’ First Steps

• (Genghis movies)

Page 24: September 10, 2002 Class Meeting 6

More on Genghis next time…

Page 25: September 10, 2002 Class Meeting 6

Generic Classification of Robot Behaviors

• Whatever the design basis, general categories of ways that robotic agent can interact with the world are:

– Exploration/directional behaviors (move in a general direction)• Heading-based• Wandering

– Goal-oriented appetitive behaviors (taxes – move towards an attractor)• Discrete object attractor• Area attractor

– Aversive/protective behaviors (prevent collision)• Avoid stationary objects• Elude moving objects • Aggression

Page 26: September 10, 2002 Class Meeting 6

Generic Classification of Robot Behaviors (con’t.)

– Path following behaviors (move on a designated path)• Road following• Hallway navigation• Stripe following

– Postural behaviors• Balance• Stability

– Social/cooperative behaviors• Sharing• Foraging• Flocking/herding

– Teleautonomous behaviors (coodinate with a human operator)• Influence• Behavioral modification

Page 27: September 10, 2002 Class Meeting 6

Generic Classification of Robot Behaviors (con’t.)

– Perceptual behaviors• Saccades• Visual search• Ocular reflexes

– Walking behaviors (for legged robots)• Gait control

– Manipulator-specific behaviors (for arm control)• Reaching

– Gripper/dextrous hand behaviors (for object acquisition)• Grasping• Enveloping

Page 28: September 10, 2002 Class Meeting 6

Expression of Behaviors

• Three methods for expressing behaviors:– Stimulus-Response Diagrams

• Useful for graphic representations of specific behavioral configurations

– Functional Notation• Useful for clarity in design of systems

– Finite State Acceptor Diagrams• Useful when temporal sequencing of behaviors is required

Page 29: September 10, 2002 Class Meeting 6

Stimulus-Response Diagrams

• Most intuitive, least formal

Stimulus Behavior Response

Page 30: September 10, 2002 Class Meeting 6

Stimulus-Response Diagramfor our Classroom Navigation Example

Move-to-classClass location

COORDINATOR

Avoid-objectDetected object

Dodge-studentDetected student Action

Stay-rightDetected path

Defer-to-elderDetected elder

Page 31: September 10, 2002 Class Meeting 6

Functional Notation

• Mathematical methods used to describe relationships using a functional notation,

b(s) = r

where:

b = behaviors = stimulusr = response

• In purely reactive system, time is not an argument of b, since behavioral response is instantaneous and independent of system’s history

Page 32: September 10, 2002 Class Meeting 6

Functional Notation of Classroom Navigation Example

coordinate-behaviors[move-to-classroom(detect-classroom-location),avoid-objects(detect-objects),dodge-students(detect-students),stay-to-right-on-path(detect-path),defer-to-elders(detect-elders)

] = motor-response

Page 33: September 10, 2002 Class Meeting 6

Functional Notation Can be Recursive

coordinate-behaviors[coordinate-behaviors(behavioral-set-1),coordinate-behaviors(behavioral-set-2),coordinate-behaviors(behavioral-set-3)] = motor-response

• Nice side effect of functional notation: – Fairly straight-forward to convert into computer program

Page 34: September 10, 2002 Class Meeting 6

Finite State Acceptor Diagrams

• Have useful properties for describing aggregations and sequences of behaviors

• Less useful for encoding a single behavior, which results in a trivial FSA

• Finite State Acceptor:M = (Q, δ, qo, F)

Where:Q = set of allowable behavioral statesd = transition function mapping input and current state to next stateqo = starting behavioral stateF = set of accepting (final) states, F ε Q

Page 35: September 10, 2002 Class Meeting 6

Finite State Acceptor Diagramfor Classroom Navigation Example

M = {{start, journey, lost, at-class}, δ, start, {lost, at-class}}

lost alllostat-classallat-classat-classreached-classjourneyjourneynot-at-classjourneylosterrorjourneystartotherstartjourneymovestartδ(q,input)inputqδ

Start Journey

At-Class

Lostmove

other not-at-class

reached-class

all

error

all

NOTE: “Journey” consist of an assemblage of the five other low-level-behaviors mentioned earlier (move-to-classroom, avoid-objects, dodge-students, stay-to-right-on-path, defer-to-elders)

Page 36: September 10, 2002 Class Meeting 6

Formal Methods for Behavior DesignCan Provide Useful Properties

• Formal methods can:– Be used to verify designer intentions– Facilitate the automatic generation of robotic control systems– Provide a complete common language for expression of robot behavior– Provide a framework for conducting formal analysis of specific program’s properties,

adequacy, and/or completeness– Provide support for high-level programming language design

• Two representative examples:– RS (robot schema): method for expressing distributed sensor-driven robot control– Situated automata: uses logical formalisms for design of circuitry that corresponds to

robot’s goals and intentions

• Won’t be discussed further here (no time!); just be aware that they exist

Page 37: September 10, 2002 Class Meeting 6

Behavioral Encoding

• Behavioral encoding: creates functional mapping from the stimulus plane to the motor plane

• Behavior expressed as a triple: (S, R, β )

where:

S denotes domain of all interpretable stimuliR denotes range of possible responsesβ denotes mapping β: S R

Page 38: September 10, 2002 Class Meeting 6

R: Range of Responses

• R denotes range of possible responses

• Motor response: consists of two orthogonal components:

– Strength:• Denotes magnitude of response• E.g., speed, force

– Orientation:• Denotes direction of action for the response• E.g., moving away from aversive stimulus, or towards an attractor

Page 39: September 10, 2002 Class Meeting 6

R: Range of Responses

• Degree of freedom (DOF): refers to one of the set of independent position variables, with respect to a frame of reference, necessary to specify an object’s position within the world

• General mobile robot: 6 DOF, r = (x, y, z, θ, φ, ψ)• For r ε R, where r = instantaneous response of a behavior-based reactive

system, response can be expressed as 6-dimensional vector consisting of 6 subcomponent vectors

• Each subcomponent vector: encodes magnitude of translational and orientational responses for each of the 6 degrees of freedom

• For our Nomad200 robot, 3 DOF r = (x, y, θ)• Can also have a scalar gain value g (strength multiplier) further modifying

the magnitude of the overall response: r’ = gr

Page 40: September 10, 2002 Class Meeting 6

S: Stimulus Domain

• S denotes domain of all perceivable stimuli

• Each individual stimulus, or percept s (s ε S) represented as tuple (p, λ)where:

p = perceptual class (or type)λ = property of strength

• Percept: loosely related to affordances (which we discussed last time)

• Strength: – Can be defined discretely (e.g., binary – absent or present; categorical –

absent, weak, medium, strong)– Or, real-valued and continuous

Page 41: September 10, 2002 Class Meeting 6

Stimulus Domain (con’t.)

• Presence of stimulus is necessary but not sufficient to evoke a motor response in a reactive/behavior-based robot

• τ = threshold value, for a given perceptual class p, above which a response is generated

Page 42: September 10, 2002 Class Meeting 6

β: Behavioral Mapping

• For each individual active behavior, formally establish mapping between the stimulus domain (S) and response range (R) that defines a behavioral function β, where:β(s) r

• β can be defined arbitrarily, but must be defined over all relevant p in S.

• When a stimulus threshold is in effect, we have:β: (p,λ) {for all λ < τ then r = [0, 0, 0, 0, 0, 0] \* no response *\

else r = arbitrary function} \* response *\

Page 43: September 10, 2002 Class Meeting 6

Example Stimulus/Response Strengths

Distance from stimulus

Stre

ngth

of Re

spon

se (%

)0 2 4 6 8 10

0

20

4

0

60

8

0

100

Distance from stimulus

Stre

ngth

of Re

spon

se (%

)

0 2 4 6 8 10

0

20

4

0

60

8

0

100

Step function Linear increase

Page 44: September 10, 2002 Class Meeting 6

Three Categories of Behavioral Mappings

1. Null: stimulus produces no motor response

2. Discrete: stimulus produces a response from an enumerable set of prescribed choices • E.g.: turn-right, go-straight, stop, travel-at-speed-5

3. Continuous: stimulus produces a motor response that is continuous over R’s range

Page 45: September 10, 2002 Class Meeting 6

Discrete Encoding

• Example: Situated action, where β = finite set of (situation, response) pairs

• Another strategy: Use of rule-based systems using IF-THEN rules

– This was used in sobounce.c (paraphrased here):

IF (shortest-front == 0)vm(vmax, 0, 0)

ELSE { IF (shortest-front < 5)recompute shortest-front

ELSE IF (shortest-front > 12)recompute shortest-front

computed-angle = compute angle from shortest-frontvm(0, computed-angle, computed-angle)}

Page 46: September 10, 2002 Class Meeting 6

Continuous Functional Encoding

• No longer use enumerated set of responses

• Instead, mathematical function transforms sensory input into behavioral reaction

• Common approach: inverse square law:

Force is proportional to: , maximizing at some maximum force

Example:

1distance2

distanceve

locity

vmax

Page 47: September 10, 2002 Class Meeting 6

Summary of Robot Behavior

• Robotic behaviors generate a motor response from a given perceptual stimulus

• Purely reactive systems avoid the use of explicit representational knowledge

• Three design paradigms:– Ethologically guided/constrained– Situated activity– Experimentally driven

• Expression of behaviors can be accomplished in several ways:– SR diagrams– Functional notation– FSA diagrams

• Behaviors can be represented as triples (S, R, β)

Page 48: September 10, 2002 Class Meeting 6

Summary of Robot Behavior (con’t.)

• Presence of stimulus is necessary, but not sufficient, to evoke a motor response. Only when stimulus exceeds a threshold does it produce a response.

• A strength multiplier, or gain g, can be used to turn off behaviors or alter the response’s relative strength.

• Responses are encoded in two forms:– Discrete encoding: Rule-based methods often used– Continuous functional encoding: inverse square law often used

Page 49: September 10, 2002 Class Meeting 6

Preview of Next Class

• Combining multiple behaviors

• Behavior architectures– E.g. Subsumption (reactive/behavior-based) architecture– Potential field methodologies– Motor schema-based methodologies