robot programming lecture 16: a sensitive soul filesensor model the probability of sensing returning...
TRANSCRIPT
Nick Hawes
Robot Programming
Lecture 16: A Sensitive Soul
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
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
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
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
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(
)
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
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?
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
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?
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
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
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
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
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(
)
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(
)
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?
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?
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?
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
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
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
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
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
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(
)
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
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(
)
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(
)
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(
)
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