robot programming lecture 16: a sensitive soul filesensor model the probability of sensing returning...

30
Nick Hawes Robot Programming Lecture 16: A Sensitive Soul

Upload: hanhu

Post on 18-Aug-2019

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

Nick Hawes

Robot Programming

Lecture 16: A Sensitive Soul

Page 2: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

sensor modelthe probability of sensing

returning a particular value given what the sensor is pointed at

action modelthe probability of ending up in a

given cell given the robot’s previous position and action

Markov Localisation

Page 3: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

sensor modelthe probability of sensing a

colour given what the sensor is pointed at

P(pink | “actually pink”) = 1 P(pink | “actually yellow”) = 0

P(yellow | “actually pink”) = 0 P(yellow | “actually yellow”) = 1

a perfect sensor

Page 4: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

a perfect sensorthe distance the sensor reports is always the correct distance between the robot and the wall

6

5

4

3

2

1

0

c1 c2 c3 c4

Page 5: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

a perfect sensorthe distance the sensor reports is always the correct distance between the robot and the wall

6

5

4

3

2

1

00.25 0.25 0.25 0.25

c1 c2 c3 c4

Page 6: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...

0 1 2 3 4 5 6

sensor

reading

0sensor

reading

1

sensor

reading

2

sensor

reading

3

sensor

reading

4

sensor

reading

5

sensor

reading 6

1 0 0 0 0 0 0

0 1 0 0 0 0 0

0 0 1 0 0 0 0

0 0 0 1 0 0 0

0 0 0 0 1 0 0

0 0 0 0 0 1 0

0 0 0 0 0 0 1

sens

or.g

etRa

nge(

)

Page 7: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

6

5

4

3

2

1

00.25 0.25 0.25 0.25

c1 c2 c3 c4

sensor.getRange() == 3

P(c1 | 3) = α P(3 | c1) P(c1)

what’s the probability of getting a reading of 3 from cell c1

Page 8: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

6

5

4

3

2

1

00.25 0.25 0.25 0.25

c1 c2 c3 c4

sensor.getRange() == 3

P(c1 | 3) = α P(3 | c1) P(c1)

what’s the probability of getting a reading of 3 from cell c1

our map says that the robot should

measure 1 from c1

1

what’s the probability of the distance really

being 1 when the sensor returns 3?

Page 9: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

our map says that the robot should

measure 1 from c1

6

5

4

3

2

1

00.25 0.25 0.25 0.25

c1 c2 c3 c4

sensor.getRange() == 3

P(c1 | 3) = α P(3 | c1) P(c1)

1

what’s the probability of the distance really

being 1 when the sensor returns 3?

3

0 1 2 3 4 5 6

0 0 0 1 0 0 0

Page 10: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

P(c1 | 3) = α 0 * 0.25

6

5

4

3

2

1

00.25 0.25 0.25 0.25

c1 c2 c3 c4

sensor.getRange() == 3

our map says that the robot should

measure 1 from c1

1

3

0 1 2 3 4 5 6

0 0 0 1 0 0 0

what’s the probability of the distance really

being 1 when the sensor returns 3?

Page 11: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

6

5

4

3

2

1

00.25 0.25 0.25 0.25

c1 c2 c3 c4

sensor.getRange() == 3

our map says that the robot should

measure 1 from c1

1

P(c1 | 3) = α 0 * 0.25 P(c2 | 3) = α 1 * 0.25 P(c3 | 3) = α 0 * 0.25 P(c4 | 3) = α 1 * 0.25

Page 12: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

6

5

4

3

2

1

00.25 0.25 0.25 0.25

c1 c2 c3 c4

sensor.getRange() == 3

our map says that the robot should

measure 1 from c1

1

P(c1 | 3) = α 0 * 0.25 = α 0 P(c2 | 3) = α 1 * 0.25 = α 0.25 P(c3 | 3) = α 0 * 0.25 = α 0 P(c4 | 3) = α 1 * 0.25 = α 0.25

Page 13: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

6

5

4

3

2

1

00.25 0.25 0.25 0.25

c1 c2 c3 c4

sensor.getRange() == 3

our map says that the robot should

measure 1 from c1

1

P(c1 | 3) = α 0 * 0.25 = α 0 = 0 P(c2 | 3) = α 1 * 0.25 = α 0.25 = 0.5 P(c3 | 3) = α 0 * 0.25 = α 0 = 0 P(c4 | 3) = α 1 * 0.25 = α 0.25 = 0.5

Page 14: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

6

5

4

3

2

1

00 0.5 0 0.5c1 c2 c3 c4

P(c1 | 3) = α 0 * 0.25 = α 0 = 0 P(c2 | 3) = α 1 * 0.25 = α 0.25 = 0.5 P(c3 | 3) = α 0 * 0.25 = α 0 = 0 P(c4 | 3) = α 1 * 0.25 = α 0.25 = 0.5

Page 15: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...

0 1 2 3 4 5 6

sensor

reading

0sensor

reading

1

sensor

reading

2

sensor

reading

3

sensor

reading

4

sensor

reading

5

sensor

reading 6

1 0 0 0 0 0 0

0 1 0 0 0 0 0

0 0 1 0 0 0 0

0 0 0 1 0 0 0

0 0 0 0 1 0 0

0 0 0 0 0 1 0

0 0 0 0 0 0 1

sens

or.g

etRa

nge(

)

Page 16: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...

0 1 2 3 4 5 6

sensor

reading

0sensor

reading

1

sensor

reading

2

sensor

reading

3

sensor

reading

4

sensor

reading

5

sensor

reading 6

0.7 0.2 0.1 0 0 0 0

0.1 0.7 0.1 0.1 0 0 0

0.05 0.1 0.7 0.1 0.05 0 0

0 0.05 0.1 0.7 0.1 0.05 0

0 0 0.05 0.1 0.7 0.1 0.05

0 0 0 0.1 0.1 0.7 0.1

0 0 0 0 0.1 0.2 0.7

sens

or.g

etRa

nge(

)

Page 17: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

6

5

4

3

2

1

00.25 0.25 0.25 0.25

c1 c2 c3 c4

sensor.getRange() == 3

P(c1 | 3) = α P(3 | c1) P(c1)

what’s the probability of getting a reading of 3 from cell c1

our map says that the robot should

measure 1 from c1

1

what’s the probability of the distance really

being 1 when the sensor returns 3?

Page 18: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

6

5

4

3

2

1

00.25 0.25 0.25 0.25

c1 c2 c3 c4

sensor.getRange() == 3

P(c1 | 3) = α P(3 | c1) P(c1)

our map says that the robot should

measure 1 from c1

1

3

0 1 2 3 4 5 6

0 0.05 0.1 0.7 0.1 0.05 0

what’s the probability of the distance really

being 1 when the sensor returns 3?

Page 19: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

6

5

4

3

2

1

00.25 0.25 0.25 0.25

c1 c2 c3 c4

sensor.getRange() == 3

our map says that the robot should

measure 1 from c1

1

3

0 1 2 3 4 5 6

0 0.05 0.1 0.7 0.1 0.05 0

P(c1 | 3) = α 0.05 * 0.25 what’s the probability of the distance really

being 1 when the sensor returns 3?

Page 20: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

6

5

4

3

2

1

00.25 0.25 0.25 0.25

c1 c2 c3 c4

sensor.getRange() == 3

our map says that the robot should

measure 1 from c1

1

P(c1 | 3) = α 0.05 * 0.25P(c2 | 3) = α 0.70 * 0.25P(c3 | 3) = α 0.05 * 0.25P(c4 | 3) = α 0.70 * 0.25

Page 21: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

6

5

4

3

2

1

00.25 0.25 0.25 0.25

c1 c2 c3 c4

sensor.getRange() == 3

our map says that the robot should

measure 1 from c1

1

P(c1 | 3) = α 0.05 * 0.25 = α 0.0125P(c2 | 3) = α 0.70 * 0.25 = α 0.175P(c3 | 3) = α 0.05 * 0.25 = α 0.0125P(c4 | 3) = α 0.70 * 0.25 = α 0.175

Page 22: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

6

5

4

3

2

1

00.25 0.25 0.25 0.25

c1 c2 c3 c4

sensor.getRange() == 3

our map says that the robot should

measure 1 from c1

1

P(c1 | 3) = α 0.05 * 0.25 = α 0.0125 = 0.033P(c2 | 3) = α 0.70 * 0.25 = α 0.1750 = 0.467P(c3 | 3) = α 0.05 * 0.25 = α 0.0125 = 0.033P(c4 | 3) = α 0.70 * 0.25 = α 0.1750 = 0.467

Page 23: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

6

5

4

3

2

1

00.033 0.467 0.033 0.467

c1 c2 c3 c4

sensor.getRange() == 3

P(c1 | 3) = α 0.05 * 0.25 = α 0.0125 = 0.033P(c2 | 3) = α 0.70 * 0.25 = α 0.1750 = 0.467P(c3 | 3) = α 0.05 * 0.25 = α 0.0125 = 0.033P(c4 | 3) = α 0.70 * 0.25 = α 0.1750 = 0.467

Page 24: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

sensor modelthe probability of sensing

returning a particular value given what the sensor is pointed at

action modelthe probability of ending up in a

given cell given the robot’s previous position and action

Markov Localisation

Page 25: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...

0 1 2 3 4 5 6

sensor

reading

0sensor

reading

1

sensor

reading

2

sensor

reading

3

sensor

reading

4

sensor

reading

5

sensor

reading 6

0.7 0.2 0.1 0 0 0 0

0.1 0.7 0.1 0.1 0 0 0

0.05 0.1 0.7 0.1 0.05 0 0

0 0.05 0.1 0.7 0.1 0.05 0

0 0 0.05 0.1 0.7 0.1 0.05

0 0 0 0.1 0.1 0.7 0.1

0 0 0 0 0.1 0.2 0.7

sens

or.g

etRa

nge(

)

Page 26: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

Ultrasonic Sensor

Measures distance in cm using reflected ultrasound

http://www.cs.bham.ac.uk/internal/courses/robot-prog/nxt/lejos/nxt/UltrasonicSensor.html

Noisy! Range 0cm to 255cm, +/- 3cm

Page 27: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...

0 1 2 3 4 5 6

sensor

reading

0sensor

reading

1

sensor

reading

2

sensor

reading

3

sensor

reading

4

sensor

reading

5

sensor

reading 6

0.7 0.2 0.1 0 0 0 0

0.1 0.7 0.1 0.1 0 0 0

0.05 0.1 0.7 0.1 0.05 0 0

0 0.05 0.1 0.7 0.1 0.05 0

0 0 0.05 0.1 0.7 0.1 0.05

0 0 0 0.1 0.1 0.7 0.1

0 0 0 0 0.1 0.2 0.7

sens

or.g

etRa

nge(

)

Page 28: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...probability of the distance to the obstacle really being...

0 1 2 3 4 5 6

sensor

reading

0sensor

reading

1

sensor

reading

2

sensor

reading

3

sensor

reading

4

sensor

reading

5

sensor

reading 6

0.7 0.2 0.1 0 0 0 0

0.1 0.7 0.1 0.1 0 0 0

0.05 0.1 0.7 0.1 0.05 0 0

0 0.05 0.1 0.7 0.1 0.05 0

0 0 0.05 0.1 0.7 0.1 0.05

0 0 0 0.1 0.1 0.7 0.1

0 0 0 0 0.1 0.2 0.7

sens

or.g

etRa

nge(

)

Page 29: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

probability of the distance to the obstacle really being...

probability of the distance to the obstacle really being...

probability of the distance to the obstacle really being...

0 - 2 3 - 4 5 - 6

sensor

reading

0sensor

reading

1

sensor

reading

2

sensor

reading

3

sensor

reading

4

sensor

reading

5

sensor

reading 6

1 0 0

0.9 0.1 0

0.85 0.15 0

0.15 0.8 0.05

0.05 0.8 0.15

0 0.2 0.8

0 0.1 0.9

sens

or.g

etRa

nge(

)

Page 30: Robot Programming Lecture 16: A Sensitive Soul filesensor model the probability of sensing returning a particular value given what the sensor is pointed at action model the probability

Build your sensor model in real conditions

The best approach would be to let the robot move to a junction then check the

actual and measured distances

You could also just move the robot gradually away from an obstacle