• Non ci sono risultati.

Sistemi per il Governo dei Robot

N/A
N/A
Protected

Academic year: 2021

Condividi "Sistemi per il Governo dei Robot"

Copied!
51
0
0

Testo completo

(1)

Sistemi per il Governo dei Robot

Silvia Rossi - Lezione 14

mercoledì 28 novembre 12

(2)

ARCHITETTURE REATTIVE

FUZZY

mercoledì 28 novembre 12

(3)

Behavioral Coordination: Fuzzy

Lofti Zadeh

mercoledì 28 novembre 12

(4)

Maze Problem

Could use pfields Corridor following?

Wall following?

mercoledì 28 novembre 12

(5)

Or...

3 behaviors, one for each sensor Combine with rules

mercoledì 28 novembre 12

(6)

Maze Problem

If left sensor is too close and right sensor is too far then

turn right.

If left-sensor is just right and forward sensor is too far then drive straight.

If left-sensor is too far and

forward sensor is too far then turn left.

If forward sensor is close then turn right sharply.

mercoledì 28 novembre 12

(7)

Maze Problem

If left sensor is too close and right sensor is too far then

turn right.

If left-sensor is just right and forward sensor is too far then drive straight.

If left-sensor is too far and

forward sensor is too far then turn left.

If forward sensor is close then turn right sharply.

mercoledì 28 novembre 12

(8)

Not Regular “Production” Rules

If left sensor is too close and right sensor is too far then

turn right.

If left-sensor is just right and forward sensor is too far then drive straight.

If left-sensor is too far and

forward sensor is too far then turn left.

If forward sensor is close then turn right sharply.

Imprecise inputs and outputs (fuzzy)

ALL rules execute, not just the first one that is “true”

The “truth” of the output is an area under a curve

The “area” is like a proportional vote for an outcome

mercoledì 28 novembre 12

(9)

Not Regular “Production” Rules

Imprecise inputs and outputs (fuzzy)

ALL rules execute, not just the first one that is “true”

The “truth” of the output is an area under a curve

The “area” is like a proportional vote for an outcome

mercoledì 28 novembre 12

(10)

So How To Do This?

If left sensor is too close and right sensor is too far then

turn right.

If left-sensor is just right and forward sensor is too far then drive straight.

If left-sensor is too far and

forward sensor is too far then turn left.

If forward sensor is close then turn right sharply.

mercoledì 28 novembre 12

(11)

General Procedure

1. Fuzzification: Perceptual Schema generates fuzzy inputs for the rules

Have a set of INPUT SETS that convert sensor reading to a fuzzi value or strength

mercoledì 28 novembre 12

(12)

Fuzzification

Have pre-defined fuzzy sets which are like look up tables:

x-axis is the sensed reading

y-axis is the membership or strength in EACH set

mercoledì 28 novembre 12

(13)

Fuzzification (up, left)

Reading: 320

mercoledì 28 novembre 12

(14)

Fuzzification (up, left)

Reading: 320

mercoledì 28 novembre 12

(15)

Fuzzification (up, left)

Reading: 320

mercoledì 28 novembre 12

(16)

Fuzzification (up, left)

Reading: 320

mercoledì 28 novembre 12

(17)

Membership Function

PROXIMITY Membership function for Sensor Left 320 is:

(Mc=0.66, Mr=0.33, Mf=0.00)

mercoledì 28 novembre 12

(18)

Left-Sensor

Reading is 320, Fuzzification is (Mc=0.66, Mr=0.33, Mf=0.00)

If left sensor is too close (0.66) and right sensor is too far then turn right.

If left-sensor is just right (0.33) and forward sensor is too far then drive straight.

If left-sensor is too far (0.00) and forward sensor is too far then turn left.

If forward sensor is close then turn right sharply.

mercoledì 28 novembre 12

(19)

Other Sensors (iterate)

Forward Sensor Membership function for 640 is:

(Mc=0.00, Mr=1.00, Mf=0.00)

Sensor-Rigt Membership function for 1024 is:

(Mc=0.00, Mr=0.00, Mf=1.00)

mercoledì 28 novembre 12

(20)

Fuzzification is Complete

Left-sensor: (Mc=0.66, Mr=0.33, Mf=0.00)

Forward-sensor: (Mc=0.00, Mr=1.00, Mf=0.00) Right-sensor: (Mc=0.00, Mr=0.00, Mf=1.00)

If left sensor is too close (0.66) and right sensor is too far (1.00) then turn right.

If left-sensor is just right (0.33) and forward sensor is too far (0.33 for the ex.) then drive straight.

If left-sensor is too far (0.00) and forward sensor is too (0.00) far then turn left.

If forward sensor is close (0.00) then turn right sharply.

mercoledì 28 novembre 12

(21)

Next Step

2. Apply fuzzy rules (Fuzzy Rules, by motor schema)

Get the strength of each rule which is called the fuzzy output The strength of the IF is the strength of the output

If left sensor is too close (0.66) and right sensor is too far (1.00) then turn right.

If left-sensor is just right (0.33) and forward sensor is too far (0.33 for the ex.) then drive straight.

If left-sensor is too far (0.00) and forward sensor is too (0.00) far then turn left.

If forward sensor is close (0.00) then turn right sharply.

mercoledì 28 novembre 12

(22)

Evaluating Rules

If left sensor is too close (0.66) and right sensor is too far (1.00) then turn right.

If left-sensor is just right (0.33) and forward sensor is too far (0.33 for the ex.) then

drive straight.

If left-sensor is too far (0.00) and forward sensor is too (0.00) far then turn left.

If forward sensor is close (0.00) then turn right sharply.

mercoledì 28 novembre 12

(23)

Boolean Operators

A AND B is minimum(A, B) A OR B is maximum(A, B) NOT A is 1-A

mercoledì 28 novembre 12

(24)

Evaluating Rules

If left sensor is too close (0.66) and right sensor is too far (1.00) then turn right.

If left-sensor is just right (0.33) and forward sensor is too far (0.33 for the ex.) then

drive straight.

If left-sensor is too far (0.00) and forward sensor is too (0.00) far then turn left.

If forward sensor is close (0.00) then turn right sharply.

mercoledì 28 novembre 12

(25)

Final Step

If left sensor is too close (0.66) and right sensor is too far (1.00) then turn right.

If left-sensor is just right (0.33) and forward sensor is too far (0.33 for the ex.) then

drive straight.

If left-sensor is too far (0.00) and forward sensor is too (0.00) far then turn left.

If forward sensor is close (0.00) then turn right sharply.

Combine fuzzy outputs (Defuzzification)

Each motor schema or behavior produces fuzzy output, but this has to be converted to a single number

mercoledì 28 novembre 12

(26)

Defuzzification

As with fuzzification, defuzzification relies on a fuzzy set that was prevously determined

mercoledì 28 novembre 12

(27)

Defuzzification (right, down)

“Opposite” of fuzzification

mercoledì 28 novembre 12

(28)

Defuzzification (right, down)

“Opposite” of fuzzification

mercoledì 28 novembre 12

(29)

Defuzzification (right, down)

“Opposite” of fuzzification

mercoledì 28 novembre 12

(30)

Defuzzification (right, down)

“Opposite” of fuzzification

mercoledì 28 novembre 12

(31)

Hedges

If left sensor is too close (0.66) and right sensor is too far (1.00) then turn right.

If left-sensor is just right (0.33) and forward sensor is too far (0.33 for the ex.) then

drive straight.

If left-sensor is too far (0.00) and forward sensor is too (0.00) far then turn left.

If forward sensor is close (0.00) then turn right sharply.

mercoledì 28 novembre 12

(32)

Hedges

Hedges move the set over

If left sensor is too close (0.66) and right sensor is too far (1.00) then turn right.

If left-sensor is just right (0.33) and forward sensor is too far (0.33 for the ex.) then drive straight.

If left-sensor is too far (0.00)

and forward sensor is too (0.00) far then turn left.

If forward sensor is close (0.00) then turn right sharply.

mercoledì 28 novembre 12

(33)

Defuzzification (right, down)

Result is an area of the fuzziness of the output Find the centroid

mercoledì 28 novembre 12

(34)

Defuzzification: Take the Centroid of Blended Area

mercoledì 28 novembre 12

(35)

Alternative: Centroid of Largest Area

mercoledì 28 novembre 12

(36)

Weighted Means

mercoledì 28 novembre 12

(37)

Recap

Perceptual schema == fuzzification

Input sets can be schema knowledge

Membership function for the fuzzy variable TURN

mercoledì 28 novembre 12

(38)

Recap

Motor schema == fuzzy rules and defuzzification Output set can be schema knowledge

mercoledì 28 novembre 12

(39)

Fuzzy Logic

Input sets and output sets may look similar

because we tend to use trapezoids and between 3 to 5 sets, but they are different!

Sets can have many shapes, can be learned, do not have to be symmetric

The membership function is usually 0 to 1 (normalized) for convenience

There’s a huge body of work - this is most simple level

mercoledì 28 novembre 12

(40)

Be aware of Problems

Consider the output of an avoid ...

And where would the centroid be?

mercoledì 28 novembre 12

(41)

Be aware of Problems

Consider the output of an avoid ...

And where would the centroid be?

Consider the Centroid of Largest Area (CLA)

mercoledì 28 novembre 12

(42)

Example

The Robot1 is in a race agaist another robot2.

During the race, Robot1 wants to stay ahead of

robot2, but must not run into the wall that is at the end of the track.

mercoledì 28 novembre 12

(43)

Example

The Robot1 is in a race agaist another robot2.

During the race, Robot1 wants to stay ahead of

robot2, but must not run into the wall that is at the end of the track.

The wall is 4 feet away.

The robot2 is 5 feet away

Robot1 is currently moving at 8 ft/s

Une Robot1 Fuzzy rules to determine how fast Robbie Shold go

The sets and rules are given a priori

mercoledì 28 novembre 12

(44)

Robot1’s Rules

if the WALL is CLOSE and SPEED is FAST,

then SPEED is SLOW

If robot2 is NOT FAR,

then SPEED is FAST

mercoledì 28 novembre 12

(45)

Mfast = 0.8

mercoledì 28 novembre 12

(46)

Mclose = 0.5

mercoledì 28 novembre 12

(47)

Robot1’s Rules

if WALL is CLOSE (Mclose = 0.5) and SPEED is FAST (Mfast = 0.8),

then SPEED is SLOW

If robot2 is NOT FAR (Mfar = 0.375),

then SPEED is FAST

mercoledì 28 novembre 12

(48)

Robot1’s Rules

min(0.5, 0.8) Mslow = 0.5

NOT(1 - 0.375) Mfast = 0.625

mercoledì 28 novembre 12

(49)

Defuzzification

mercoledì 28 novembre 12

(50)

Defuzzification

5.62

mercoledì 28 novembre 12

(51)

Design a Reactive Behavioral System

mercoledì 28 novembre 12

Riferimenti

Documenti correlati

w Natural logarithm of total household net wealth (real assets plus financial assets minus liabilities). (a) Comment briefly on the order of magnitude of the mean of the

[r]

[r]

[r]

Since we are comparing two polynomials, it follows that the identity holds for all x

Solution proposed by Roberto Tauraso, Dipartimento di Matematica, Universit`a di Roma “Tor Vergata”, via della Ricerca Scientifica, 00133 Roma, Italy.. We will show a more

Let f and g be continuous real valued functions on

[r]