48
Particle Filter & Search Unit 3 & 4 Udacity

Particle Filter & Search

  • Upload
    vaughan

  • View
    99

  • Download
    0

Embed Size (px)

DESCRIPTION

Particle Filter & Search. Unit 3 & 4 Udacity. Particle Filter. Show relation to Kalman . Implementation & examples. MATLAB Demo. Particle Filter. Estimates the state of a system. Same as Histogram filters and Kalman filters Used in localization and tracking. . - PowerPoint PPT Presentation

Citation preview

Page 1: Particle Filter & Search

Particle Filter & Search

Unit 3 & 4 Udacity

Page 2: Particle Filter & Search

Particle Filter

• Show relation to Kalman.• Implementation & examples.• MATLAB Demo

Page 3: Particle Filter & Search

Particle Filter

• Estimates the state of a system.– Same as Histogram filters and Kalman filters

• Used in localization and tracking.

Page 4: Particle Filter & Search

Advantages of particle filters compared to KF and HF

• Easiest to program• Most flexible• Can easily handle non-linear and non-

gaussian systems.• Multimodal

Page 5: Particle Filter & Search

Remember kalman?

0 10 20 30 40 50 60 70 80 90 1000

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

Motion/Prediction Measurement update

0 10 20 30 40 50 60 70 80 90 1000

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16 Estimate of position x(t2)

Prediction x’(t3) Prediction x’(t3)

Corrected Optimal est x(t3)

Measurement z

Page 6: Particle Filter & Search

Approach (1) – Initialization

• Determine robot position• Initialization of multiple guesses

Page 7: Particle Filter & Search

Approach(2) – Measurement/Weight

- Weights of each particle are determined by the chance of being correct.

Measurement noise Laser sensor

Page 8: Particle Filter & Search

)|( itt

it xzpw

1

1N

ii

1

N

ii

W w

ii W

1 1( | ) 0.0001w p z x

2 2( | ) 0.01w p z x

3 3( | ) 0.7w p z x

Calculate weights

Normalized weight

2

2

1 1( | ) exp22

i i

ii

zp z x

msp s

æ öæ ö÷-ç ÷ç ÷ç ÷= - × ÷çç ÷÷çç ÷ç ÷è ø÷ç× × è ø

Normalize factor

Approach(3) – Likelihood

Mini Quiz 2:

Mini Quiz 1:

Page 9: Particle Filter & Search

Approach(4) – Resampling

ResamplingN N• Survival of the fittest• Resampling wheel

Page 10: Particle Filter & Search

Approach(5) – Resampling

0 10 20 30 40 50 60 70 80 90 1000

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

Measurement update (Kalman)

Prediction x’(t3)

Corrected Optimal est x(t3)

Measurement z

Page 11: Particle Filter & Search

Approach (5) – Motion

Page 12: Particle Filter & Search

Approach (6) - Prediction/Motion-In the context of localization, the particles are propagated according to the motion model.

0 10 20 30 40 50 60 70 80 90 1000

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16Posteriori/Estimate of position x(t2)

Prediction x’(t3)

Motion update D1 (Kalman) Motion Update D2

Each particle is added noise -> gaussian distribution

Page 13: Particle Filter & Search

Approach (7)

Page 14: Particle Filter & Search

15

Page 15: Particle Filter & Search

16

Page 16: Particle Filter & Search

17

Page 17: Particle Filter & Search

18

Page 18: Particle Filter & Search

19

Page 19: Particle Filter & Search

20

Page 20: Particle Filter & Search

21

Page 21: Particle Filter & Search

22

Page 22: Particle Filter & Search

23

Page 23: Particle Filter & Search

24

Page 24: Particle Filter & Search

25

Page 25: Particle Filter & Search

26

Page 26: Particle Filter & Search

27

Page 27: Particle Filter & Search

28

Page 28: Particle Filter & Search

29

Page 29: Particle Filter & Search

30

Page 30: Particle Filter & Search

31

Page 31: Particle Filter & Search

32

Page 32: Particle Filter & Search

Demo – Finding wally

0 20 40 60 80 1000

10

20

30

40

50

60

70

80

90

100Initial state

RobotLandmarksMeanWally

Matlab code is provide in ParticleFilterUdacity.zip

Page 33: Particle Filter & Search

Motion Planning

• Find the ”shortest” path to a given goal.– Discrete planning (This lecture)

• World divided in grid cells– Continuous planning

Page 34: Particle Filter & Search

Motion Planning (Search)

• Planning Problem– Given

• Map• Starting location• Goal location• Cost

– Goal• Find the minimum cost path

Page 35: Particle Filter & Search

The Search Problem – Path Planning

• Find the shortest path from Start to Goal.• Done with an expand approach.

– Openlist: Possible expansions. – G-value: Number of expansions need to reach a

given grid cell.– Algorithm continues until goal is reached or

openlist is empty.

Page 36: Particle Filter & Search

Demo – Search Algorithm

• MATLAB: MotionPlanning2DSearchStar

Page 37: Particle Filter & Search

Search - A-star

• Minimizes the number of expansions• Prioritized search by adding heuristic function.

Page 38: Particle Filter & Search

Demo: Search - A start

• MATLAB: MotionPlanning2DSearchStar

Page 39: Particle Filter & Search

Demo: Search A-Star Quadrocopter

01

23

45

6

01

23

45

-0.5

0

0.5

1

1.5

2

2.5

3

3.5

Page 40: Particle Filter & Search

Dynamic programming

• Given– Map – Goal

• Outputs: Best Path from ANYWHERE.• Creates a Policy.

– Gives the optimal action for every grid cell.

Page 41: Particle Filter & Search

Dynamic Programming Approach

• Create a value grid

Page 42: Particle Filter & Search

Cons and pros

• Pro: Gives the optimal path for any location. • Con: Is more computional.

Page 43: Particle Filter & Search

Demo: Dynamic Programming

• MATLAB: MotionPlanningDynamicProgramming.m

Page 44: Particle Filter & Search

Stochastic motion

• Avoid robots from getting to close to an obstacle.

Page 45: Particle Filter & Search

Stochastic motion

• Avoidance from the deterministic model.

Page 46: Particle Filter & Search

Example: Forward(1)

Page 47: Particle Filter & Search

Example: Falling of the grid (2)

Page 48: Particle Filter & Search

Stochastic motion

• By updating the value function with a stochastic model. The robot will move away from obstacles.