presentazione di powerpointchrome.ws.dei.polimi.it/images/a/a1/robotics_04_2019_localization.… ·...

97
Robotics Matteo Matteucci [email protected] Artificial Intelligence and Robotics Lab - Politecnico di Milano Robot Localization Sensor Models and Bayesian Filtering

Upload: others

Post on 07-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

Robotics

Matteo [email protected]

Artificial Intelligence and Robotics Lab - Politecnico di Milano

Robot Localization – Sensor Models and Bayesian Filtering

Page 2: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

2

Sensors

Where am I?

A Simplified Sense-Plan-Act Architecture

Trajectory Planning

Lower Frequency

Trajectory

Trajectory Following

(and Obstacle Avoidance)

Motion CommandsCurrent

Position

Goal PositionMap

High Frequency

Localization

Page 3: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

3

Localization with Knowm Map

Motion Model

(Kinematics)

Sensor Model

Page 4: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

4

Disclaimer …

Slides from now on have been heavily “inspired” by the teaching material kindly

provided with: S. Thrun, D. Fox, W. Burgard. “Probabilistic Robotics”. MIT Press, 2005

http://robots.stanford.edu/probabilistic-robotics/

You can refer to the original source for deeper analysis and references on the topic …

Page 5: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

5

Range Sensors Models

The sensor model describes P(z|x), i.e., the probability of a measurement z given that

the robot is at position x.

Page 6: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

6

Proximity Sensors

The sensor model describes P(z|x), i.e., the probability of a measurement z given that

the robot is at position x.

In particular a scan z consists of K measurements.

Individual measurements are independent given robot

position and surrounding map.

},...,,{ 21 Kzzzz

K

k

k mxzPmxzP1

),|(),|(

Page 7: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

7

Typical Measurement Errors of an Range Measurements

The sensor model describes P(z|x), i.e., the probability of a measurement z given that

the robot is at position x.

Masurements can come from:

1.Beams reflected by obstacles

2.Beams reflected by persons orcaused by crosstalk

3.Random measurements

4.Max range measurements

Page 8: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

8

Distance perception: Laser Range Finder

Lasers are definitely more accurate sensors

• 180 ranges over 180° (up to 360 °)

• 1 to 64 planes scanned, 10-75 scans/s

• <1cm range resolution

• Max range up to 50-80 m

• Issues with mirrors, glass, and matte black.

> 80.000 €~ 40.000 €~ 6000 €

< 1000 €~ 10.000 €

Page 9: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

9

Beam Sensor Model (I)

The laser range finder model describe each single measurement using

Measurement noise

zexp zmax0

b

zz

hit eb

mxzP

2exp)(

2

1

2

1),|(

otherwise

zzmxzP

z

0

e),|( exp

unexp

Unexpected obstacles

zexp zmax0

Page 10: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

10

Beam Sensor Model (II)

The laser range finder model describe each single measurement using

Random measurement Max range

max

1),|(

zmxzPrand

smallzmxzP

1),|(max

zexp zmax0zexp zmax0

Page 11: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

11

Beam Sensor Model (III)

The laser range finder model describe each single measurement using

),|(

),|(

),|(

),|(

),|(

rand

max

unexp

hit

rand

max

unexp

hit

mxzP

mxzP

mxzP

mxzP

mxzP

T

Sonar

Laser

Page 12: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

12

Acquire some data from the sensor, e.g., when the target is at 300 cm and 400 cm

Then estimate the model parameters via maximum likelihood:

Sensor Model Calibration (Sonar)

Sonar

)|( expzzP

300 cm 400 cm

Page 13: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

13

Laser

Acquire some data from the sensor, e.g., when the target is at 300 cm and 400 cm

Then estimate the model parameters via maximum likelihood:

Sensor Model Calibration (Laser)

)|( expzzP

300 cm 400 cm

Page 14: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

14

Discete Model for Range Sensor

Instead of densities, consider discrete steps along the sensor beam

Sonar

Laser

Page 15: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

15

Sensor Model Likelihood

z

P(z|x,m)

Page 16: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

16

Scan Sensor Model

The beam sensor model assumes independence between beams and between

physical causes of measurements and has some issues:

• Overconfident because of independency assumptions

• Need to learn parameters from data

• A different model should be learned for different angles w.r.t. obstacles

• Inefficient because it uses ray tracing

The Scan sensor model simplifies with:

• Gaussian distribution with mean at distance to closest obstacle,

• Uniform distribution for random measurements, and

• Small uniform distribution for max range measurements

Page 17: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

17

Scan Sensor Model Example

P(z|x,m)Map m Likelihood field

Page 18: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

18

San Jose Tech Museum

Occupancy grid map Likelihood field

Page 19: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

19

Scan Sensor Matching

Extract likelihood field from scan and use it to match different scan:

Page 20: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

20

Scan Sensor Matching

Extract likelihood field from scan and use it to match different scan:

• Highly efficient, uses 2D tables only.

• Smooth with respect to small changes

in robot position

• Allows gradient descent (scan matching)

• Ignores physical properties of beams.

However it does not

work with sonars

Page 21: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

21

Landmarks

Landmark sensors provides

• Distance (or)

• Bearing (or)

• Distance and bearing

Can be obtained via

• Active beacons (e.g., radio, GPS)

• Passive (e.g., visual, retro-reflective)

Standard approach is triangulation

Page 22: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

22

Landmark Models with Uncertainty

Explicitly modeling uncertainty in sensing is key to robustness:

• Determine parametric model of noise free measurement

• Analyze sources of noise

• Add adequate noise to parameters (eventually mix in densities for noise)

• Learn (and verify) parameters by fitting model to data

The likelihood of measurement is given by “probabilistically comparing” the actual with

the expected measurement.

Page 23: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

23

Landmark Detection Model

For landmak 𝑖 in map 𝑚 the measurement 𝑧 = (𝑖, 𝑑, 𝛼) for a robot at (𝑥, 𝑦, 𝜃) is given by

Detection probability might depend on the distance/bearing

Then we have to take into account false positives too

22 ))(())((ˆ yimximd yx

),ˆprob(),ˆprob(det dddp

))(,)(atan2(ˆ ximyima xy

),|(uniformfpdetdet mxzPzpz

Page 24: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

24

RoboCup Example

𝑃(𝑧1, 𝑧2, 𝑧3|𝑥,𝑚)

𝑃(𝑧1|𝑥,𝑚) 𝑃(𝑧2|𝑥,𝑚) 𝑃(𝑧3|𝑥,𝑚)

Page 25: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

25

Localization with Knowm Map

Motion Model

(Kinematics)

Sensor Model

Bayesian Filtering

Page 26: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

26

Dynamic Bayesian Networks and Localization

1:1

1:1:1:11:1:1 ),,,,|(),,,,|(:Filteringt

NtttNttt llUZpllUZp

1 2

u2

mapL1

z1 z2

L2 L3

z3 z4

L4

3

u2

L5

z6 z7

L6

z5

pose

Motion Model

Sensor Model

Page 27: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

27

Bayesian Filtering Framework

We want to compute an estimate of the posterios probabibility of robot state 𝑥𝑡

from the stream of information about movement and sensors

In particular we assume known:

• The prior probability of the system state 𝑃(𝑥0)

• The motion model 𝑃(𝑥′|𝑥, 𝑢)

• The sensor model 𝑃(𝑧|𝑥,𝑚)

),,,|()( 11 tttt zuzuxPxBel

},,,{ 11 ttt zuzud

Page 28: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

28

Markov Assumptions

Underlining assumption behind Bayes filtering:

• Perfect model, no approximation errors

• Static and stationary world

• Independent noise

),|(),,|( 1:1:11:1 ttttttt uxxpuzxxp

)|(),,|( :1:1:0 tttttt xzpuzxzp

Page 29: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

29

111 )(),|(),|( ttttttt dxxBelxuxPmxzP

Bayes Filters

),,,,|(),,,,,|( 1111 muzuxPmuzuxzP ttttt Bayes

z = observationu = actionx = statem = map

Markov ),,,,|(),|( 11 muzuxPmxzP tttt

Markov11111 ),,,,|(),|(),|( tttttttt dxmuzuxPxuxPmxzP

1111

111

),,,,|(

),,,,,|(),|(

ttt

ttttt

dxmuzuxP

mxuzuxPmxzP

Total prob.

Markov111111 ),,,,|(),|(),|( tttttttt dxmzzuxPxuxPmxzP

),,,,|()( 11 mzuzuxPxBel tttt

Page 30: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

30

Bayes Filter Algorithm

111 )(),|()|()( tttttttt dxxBelxuxPxzPxBel

Algorithm Bayes_filter( Bel(x), d ):

0

if d is a perceptual data item z then

For all x do

For all x do

else if d is an action data item u then

For all x do

return Bel’(x)

)()|()(' xBelxzPxBel

)(' xBel

)(')(' 1 xBelxBel

')'()',|()(' dxxBelxuxPxBel

How to represent

such belief?

Based on such representation:

• Discrete filters

• Kalman filters

• Sigma-point filters

• Particle filters

• ...

Page 31: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

31

Piecewise Constant Approximation

)(xBel

)|( xzP

)()|()(' xBelxzPxBel

Page 32: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

32

Piecewise Constant Approximation

)( 0xBel

)|( xzP

)()|()(' 00 xBelxzPxBel

),|()( 1011 uxxPxBel

)()|()(' 111 xBelxzPxBel

Page 33: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

33

Discrete Bayesian Filter Algorithm

Algorithm Discrete_Bayes_filter( Bel(x),d ):

h=0

If d is a perceptual data item z then

For all x do

For all x do

Else if d is an action data item u then

For all x do

Return Bel’(x)

)()|()(' xBelxzPxBel )(' xBel

)(')(' 1 xBelxBel

'

)'()',|()('x

xBelxuxPxBel

Page 34: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

34

Tis and Tricks

Belief update upon sensory input and normalization iterates over all cells

• When the belief is peaked (e.g., during position tracking), avoid

updating irrelevant parts.

• Do not update entire sub-spaces of the state space and monitor

whether the robot is de-localized or not by considering likelihood

of observations given the active components

To update the belief upon robot motions, assumes a bounded Gaussian model to

reduce the update from O(n2) to O(n)

• Update by shifting the data in the grid according to measured motion

• Then convolve the grid using a Gaussian Kernel.

Page 35: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

35

Grid Based Localization

Page 36: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

36

Bayes Filter Algorithm

111 )(),|()|()( tttttttt dxxBelxuxPxzPxBel

Algorithm Bayes_filter( Bel(x), d ):

0

If d is a perceptual data item z then

For all x do

For all x do

Else if d is an action data item u then

For all x do

Return Bel’(x)

)()|()(' xBelxzPxBel

)(' xBel

)(')(' 1 xBelxBel

')'()',|()(' dxxBelxuxPxBel

How to represent

such belief?

Based on such representation:

• Discrete filters

• Kalman filters

• Sigma-point filters

• Particle filters

• ...

Page 37: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

37

Bayes Filter Reminder

Prediction:

Correction/Update:

111 )(),|()( tttttt dxxBelxuxpxBel

)()|()( tttt xBelxzpxBel

111 )(),|()|()( tttttttt dxxBelxuxPxzPxBel

Page 38: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

38

Localization with Knowm Map

Update

Prediction

Update

Prediction

Page 39: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

39

Bayes Filter Reminder

Prediction:

Correction/Update:

Can we compute the integrals (η is an integral too) in closed form

for continuos distributions?

Is there any continuous distribution for which this is possible?

111 )(),|()( tttttt dxxBelxuxpxBel

)()|()( tttt xBelxzpxBel

NO!

YES!

111 )(),|()|()( tttttttt dxxBelxuxPxzPxBel

Page 40: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

40

Gaussian Distribution

2

2)(

2

1

2

2

1)(

),(~)(

x

exp

Nxp

-

Univariate

)()(2

1

2/12/

1

)2(

1)(

)(~)(

μxΣμx

Σx

Σμx

t

ep

,Νp

d

Multivariate

Page 41: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

41

Properties of Gaussian Distribution

2

2)(

2

1

2

2

1)(

),(~)(

x

exp

Nxp

-

Univariate

),(~),(~ 22

2

abaNYbaXY

NX

2

2

2

1

22

2

2

1

2

112

2

2

1

2

2212

222

2

111 1,~)()(

),(~

),(~

NXpXp

NX

NX

Page 42: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

42

)()(2

1

2/12/

1

)2(

1)(

)(~)(

μxΣμx

Σx

Σμx

t

ep

,Νp

d

Multivariate

Properties of Gaussian Distribution

),(~),(~

TAABANYBAXY

NX

1

2

1

1

2

21

11

21

221

222

111 1,~)()(

),(~

),(~

NXpXp

NX

NX

Page 43: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

43

Discrete Time Kalman Filter

• (n x n) describes how state evolves from t to t-1 w/o controls or noise

• (n x l) describes how control ut changes the state from t to t-1

• (k x n) describes how to map the state xt to an observation zt

• random variables representing process and measurement noise assumed

independent and normally distributed with covariance Rt and Qt respectively.

tttttt uBxAx 1

tttt xCz

t

tA

tB

tC

t

Page 44: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

44

Linear Gaussian Systems

Initial belief is normally distributed:

Dynamics are linear function of state and control plus additive noise:

Observations are linear function of state plus additive noise:

0000 ,;)( xNxBel

tttttt uBxAx 1 ttttttttt RuBxAxNxuxp ,;),|( 11

tttt xCz tttttt QxCzNxzp ,;)|(

tttttt uBxAx 1

tttt xCz

Page 45: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

45

Linear Gaussian System: Prediction

Prediction:

t

T

tttt

ttttt

t

tttt

T

tt

tttttt

T

tttttt

ttttttttt

tttttt

RAA

uBAxBel

dxxx

uBxAxRuBxAxxBel

xNRuBxAxN

dxxBelxuxpxBel

1

1

111

1

111

1

1

1

1111

111

)(

)()(2

1exp

)()(2

1exp)(

,;~,;~

)(),|()(

Closed form prediction step

Page 46: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

46

Linear Gaussian System: Observation

Update:

1

11

)(with )(

)()(

)()(2

1exp)()(

2

1exp)(

,;~,;~

)()|()(

t

T

ttt

T

ttttttt

tttttt

t

ttt

T

tttttt

T

tttt

ttttttt

tttt

QCCCKCKI

CzKxBel

xxxCzQxCzxBel

xNQxCzN

xbelxzpxBel

Closed form update step

Page 47: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

47

Kalman Filter Algorithm

Algorithm Kalman_filter( µt-1, Σt-1, ut, zt):

Prediction:

Correction:

Return µt, Σt

ttttt uBA 1

t

T

tttt RAA 1

1)( t

T

ttt

T

ttt QCCCK

)( tttttt CzK

tttt CKI )(

Page 48: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

48

Kalman Filter Algorithm

Algorithm Kalman_filter( µt-1, Σt-1, ut, zt):

Prediction:

Correction:

Return µt, Σt

ttttt uBA 1

t

T

tttt RAA 1

1)( t

T

ttt

T

ttt QCCCK

)( tttttt CzK

tttt CKI )(

• Polynomial in measurement

dimensionality k and state

dimensionality n: O(k2.376 + n2)

• Optimal for linear Gaussian systems

• Most robotics systems are nonlinear

• It represents unimodal disributions

Page 49: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

49

How to Deal with Non Linear Dynamic Systems?

Gaussian noise in linear systems

tttt xCz tttttt uBxAx 1

Page 50: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

50

How to Deal with Non Linear Dynamic Systems?

Gaussian noise in non-linear systems

),( 1 ttt xugx

)( tt xhz

Page 51: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

51

Extended Kalman Filter (First order Taylor approximation)

Gaussian noise in non-linear systems

Prediction:

Correction

),( 1 ttt xugx

)( tt xhz

)(),(),(

)(),(

),(),(

1111

11

1

111

ttttttt

tt

t

tttttt

xGugxug

xx

ugugxug

)()()(

)()(

)()(

ttttt

tt

t

ttt

xHhxh

xx

hhxh

Page 52: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

52

Extended Kalman Filter (First order Taylor approximation)

Gaussian noise in non-linear systems

Prediction:

Correction

),( 1 ttt xugx

)( tt xhz

)(),(),(

)(),(

),(),(

1111

11

1

111

ttttttt

tt

t

tttttt

xGugxug

xx

ugugxug

)()()(

)()(

)()(

ttttt

tt

t

ttt

xHhxh

xx

hhxh

Page 53: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

53

Extended Kalman Filter (First order Taylor approximation)

Gaussian noise in non-linear systems

Prediction:

Correction

),( 1 ttt xugx

)( tt xhz

)(),(),(

)(),(

),(),(

1111

11

1

111

ttttttt

tt

t

tttttt

xGugxug

xx

ugugxug

)()()(

)()(

)()(

ttttt

tt

t

ttt

xHhxh

xx

hhxh

Page 54: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

54

Extended Kalman Filter (First order Taylor approximation)

Gaussian noise in non-linear systems

Prediction:

Correction

),( 1 ttt xugx

)( tt xhz

)(),(),(

)(),(

),(),(

1111

11

1

111

ttttttt

tt

t

tttttt

xGugxug

xx

ugugxug

)()()(

)()(

)()(

ttttt

tt

t

ttt

xHhxh

xx

hhxh

Page 55: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

55

Extended Kalman Filter (First order Taylor approximation)

Gaussian noise in non-linear systems

Prediction:

Correction

),( 1 ttt xugx

)( tt xhz

)(),(),(

)(),(

),(),(

1111

11

1

111

ttttttt

tt

t

tttttt

xGugxug

xx

ugugxug

)()()(

)()(

)()(

ttttt

tt

t

ttt

xHhxh

xx

hhxh

Page 56: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

56

EKF Algorithm

Extended_Kalman_filter(µt-1, Σt-1, ut, zt):

Prediction:

Correction:

Return µt, Σt

),( 1 ttt ug

t

T

tttt RGG 1

1)( t

T

ttt

T

ttt QHHHK

))(( ttttt hzK

tttt HKI )(

1

1),(

t

ttt

x

ugG

t

tt

x

hH

)(

ttttt uBA 1

t

T

tttt RAA 1

1)( t

T

ttt

T

ttt QCCCK

)( tttttt CzK

tttt CKI )(

Page 57: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

57

EKF and Friends

Extended Kalman Filter:

• Polynomial in measurement k and state n dimensionality: O(k2.376 + n2)

• Not optimal and can diverge if nonlinearities are large!

• Works surprisingly well even when all assumptions are violated!

• There are possible alternative like the Unscented Kalman Transform ...

EKF UKF

Page 58: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

58

Bayes Filter Algorithm

111 )(),|()|()( tttttttt dxxBelxuxPxzPxBel

Algorithm Bayes_filter( Bel(x), d ):

0

If d is a perceptual data item z then

For all x do

For all x do

Else if d is an action data item u then

For all x do

Return Bel’(x)

)()|()(' xBelxzPxBel

)(' xBel

)(')(' 1 xBelxBel

')'()',|()(' dxxBelxuxPxBel

How to represent

such belief?

Based on such representation:

• Discrete filters

• Kalman filters

• Sigma-point filters

• Particle filters

• ...

Page 59: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

60

Importance Resampling

Page 60: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

61

Importance Resampling

w = f/g

Page 61: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

62

Importance Resampling (with smoothing)

Page 62: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

63

draw xit1 from Bel(xt1)

draw xit from p(xt | x

it1,ut1)

Importance factor for xit:

)|(

)(),|(

)(),|()|(

ondistributi proposal

ondistributitarget

111

111

tt

tttt

tttttt

i

t

xzp

xBeluxxp

xBeluxxpxzp

w

1111 )(),|()|()( tttttttt dxxBeluxxpxzpxBel

Particle Filter Algorithm

g

f

Page 63: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

64

Algorithm particle_filter(St-1, ut-1, zt):

For Generate new samples

Sample index j(i) from the discrete distribution given by wt-1

Sample from using and

Compute importance weight

Update normalization factor

Insert

For

Normalize weights

0, tS

ni 1

},{ i

t

i

ttt wxSS

i

tw

i

tx ),|( 11 ttt uxxp )(

1

ij

tx 1tu

)|( i

tt

i

t xzpw

ni 1

/i

t

i

t ww

Particle Filter Algorithm

Page 64: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

65

Sensor Information: Importance Sampling

)|()(

)()|(xzp

xBel

xBelxzpw

)()|()( xBelxzpxBel

Page 65: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

66

Sensor Information: Importance Sampling

'd)'()'|()( , xxBelxuxpxBel

Page 66: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

67

Sensor Information: Importance Sampling

)|()(

)()|(xzp

xBel

xBelxzpw

)()|()( xBelxzpxBel

Page 67: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

68

Sensor Information: Importance Sampling

'd)'()'|()( , xxBelxuxpxBel

Page 68: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

69

Start

Monte Carlo Localization with Laser

Stochastic motion model

Proximity sensor model

Laser sensor Sonar sensor

Page 69: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

70

Sample-based Localization (sonar)

Page 70: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

71

Page 71: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

72

Page 72: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

73

Page 73: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

74

Page 74: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

75

Page 75: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

76

Page 76: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

77

Page 77: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

78

Page 78: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

79

Page 79: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

80

Page 80: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

81

Page 81: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

82

Page 82: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

83

Page 83: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

84

Page 84: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

85

Page 85: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

86

Page 86: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

87

Page 87: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

88

Page 88: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

89

RoboCup Example

𝑃(𝑧1|𝑥,𝑚) 𝑃(𝑧2|𝑥,𝑚) 𝑃(𝑧3|𝑥,𝑚)

Weighted samplesAfter resampling

Page 89: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

90

Localization for AIBO robots

Page 90: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

91

Project Minerva

Page 91: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

92

Using Ceiling Maps for Localization

Page 92: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

93

Vision-based Localization

P(z|x)

h(x)

z

Page 93: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

94

Under a Light

Measurement z: P(z|x):

Page 94: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

95

Next to a Light

Measurement z: P(z|x):

Page 95: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

96

Next to a Light

Measurement z: P(z|x):

Page 96: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

97

Elsewhere

Measurement z: P(z|x):

Page 97: Presentazione di PowerPointchrome.ws.dei.polimi.it/images/a/a1/Robotics_04_2019_Localization.… · Typical Measurement Errors of an Range Measurements The sensor model describes

98

Global Localization Using Vision