52
1 Cyrill Stachniss and Luciano Spinello Introduction to Monte Carlo Localization Practical Course WS12/13

Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

1

Cyrill Stachniss and Luciano Spinello

Introduction to Monte Carlo Localization

Practical Course WS12/13

Page 2: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

2

State Estimation

§  Estimate the state of a system given observations and controls

§  Goal:

Page 3: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

3

Bayes Filter

§  General framework for state estimation

§  Prediction step based on controls §  Correction step based on

measurements §  Recursive structure:

Page 4: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

4

Bayes Filter Derivation

Page 5: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

5

Prediction and Correction Step

§  Bayes filter is often formulated as a two step process

§  Prediction step

§  Correction step

Page 6: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

6

Motion and Observation Model

§  Prediction step

§  Correction step

motion model

sensor or observation model

Page 7: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

7

Different Realizations

§  The Bayes filter is a framework for recursive state estimation

§  There are different realizations §  Different properties

§  Linear vs. non-linear models for motion and observation models

§ Gaussian distributions only? §  Parametric vs. non-parametric filters § …

Page 8: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

8

Motion Model

Page 9: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

9

Robot Motion Models

§  Robot motion is inherently uncertain §  How can we model this uncertainty?

Page 10: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

10

Probabilistic Motion Models

§  Specifies a posterior probability that action u carries the robot from x to x’.

Page 11: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

11

Typical Motion Models

§  In practice, one often finds two types of motion models: § Odometry-based § Velocity-based

§  Odometry-based models for systems that are equipped with wheel encoders

§  Velocity-based when no wheel encoders are available

Page 12: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

12

Odometry Model §  Robot moves from to . §  Odometry information

Page 13: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

13

Probability Distribution

§  Noise in odometry §  Example: Gaussian noise

Page 14: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

14

Examples (Odometry-Based)

Page 15: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

15

Sensor Model

Page 16: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

16

Model for Laser Scanners

§  Scan z consists of K measurements.

§  Individual measurements are independent given the robot position

Page 17: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

17

Beam-Endpoint Model

Page 18: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

18

Beam-Endpoint Model

map likelihood field

Page 19: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

19

§  Ray-cast model considers the first obstacle long the line of sight

§  Mixture of four models

Ray-cast Model

Page 20: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

20

Particle Filter

§  Realization of the Bayes filter §  Non-parametric approach §  Models arbitrary distributions

Page 21: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

21

Motivation

§  Goal: approach for dealing with arbitrary distributions

Page 22: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

22

Key Idea: Samples

§  Use multiple samples to represent arbitrary distributions

samples

Page 23: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

23

Particle Set

§  Set of weighted samples

§  The samples represent the posterior

state hypothesis

importance weight

Page 24: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

24

Particles for Approximation

§  Particles for function approximation

§  The more particles fall into an interval, the higher its probability density

Page 25: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

25

Particle Filter

§  Recursive Bayes filter §  Non-parametric approach §  Models the distribution by samples §  Prediction: propagate the samples

given the motion model (proposal) §  Correction: weighting by considering

the observation

The more samples we use, the better is the estimate!

Page 26: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

26

Monte Carlo Localization

§  Each particle is a pose hypothesis §  Proposal is the motion model

§  Correction via the observation model

§  Resampling: “Replace unlikely samples by more likely ones”

Page 27: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

27

Particle Filter for Localization

Page 28: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

28

Application: Particle Filter for Localization (Known Map)

Page 29: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

29

Resampling

§  Survival of the fittest: “Replace unlikely samples by more likely ones”

§  “Trick” to avoid that many samples cover unlikely states

§  Needed as we have a limited number of samples

Page 30: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

30

w2

w3

w1 wn

Wn-1

Resampling

w2

w3

w1 wn

Wn-1

§  Roulette wheel §  Binary search

§  O(n log n)

§  Stochastic universal sampling §  Low variance

§  O(n)

Page 31: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

31

Low Variance Resampling

Page 32: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

32 initialization

Page 33: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

33 observation

Page 34: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

34 resampling

Page 35: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

35 motion update

Page 36: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

36 measurement

Page 37: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

37 weight update

Page 38: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

38 resampling

Page 39: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

39 motion update

Page 40: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

40 measurement

Page 41: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

41 weight update

Page 42: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

42 resampling

Page 43: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

43 motion update

Page 44: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

44 measurement

Page 45: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

45 weight update

Page 46: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

46 resampling

Page 47: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

47 motion update

Page 48: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

48 measurement

Page 49: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

49

Summary – Particle Filters

§  Particle filters are non-parametric, recursive Bayes filters

§  Posterior is represented by a set of weighted samples

§  Not limited to Gaussians §  Proposal to draw new samples §  Weight to account for the differences

between the proposal and the target §  Work well in low-dimensional spaces

Page 50: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

50

Summary – PF Localization

§  Particles are propagated according to the motion model

§  They are weighted according to the likelihood of the observation

§  Called: Monte-Carlo localization (MCL) §  MCL is the gold standard for mobile

robot localization today

Page 51: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

51

Literature On Monte Carlo Localization §  Thrun et al. “Probabilistic Robotics”,

Chapter 8.3

On the particle filter §  Thrun et al. “Probabilistic Robotics”,

Chapter 3

On motion and observation models §  Thrun et al. “Probabilistic Robotics”,

Chapters 5 & 6

Page 52: Practical Course WS12/13 Introduction to Monte Carlo ...ais.informatik.uni-freiburg.de/teaching/ws12/practicalB/02-mcl.pdf · Introduction to Monte Carlo Localization Practical Course

52

Key Questions

§  What does our map look like? §  What kind of sensor do we use? §  How to obtain a sensor model? §  How to describe the motion?