Introduction to Mobile Robotics Bayes Filter – Particle Filter and Monte Carlo Localization Wolfram Burgard, Cyrill Stachniss, Maren Bennewitz, Kai Arras 1
Motivation § Recall: Discrete filter § Discretize the continuous state space § High memory complexity § Fixed resolution (does not adapt to the belief) § Particle filters are a way to efficiently represent non-Gaussian distribution § Basic principle § Set of state hypotheses ( “ particles ” ) § Survival-of-the-fittest 2
Sample-based Localization (sonar)
Mathematical Description § Set of weighted samples State hypothesis Importance weight § The samples represent the posterior 4
Function Approximation § Particle sets can be used to approximate functions § The more particles fall into an interval, the higher the probability of that interval § How to draw samples form a function/distribution? 5
Rejection Sampling § Let us assume that f(x)< 1 for all x § Sample x from a uniform distribution § Sample c from [0,1] § if f(x) > c keep the sample otherwise reject the sample f(x ’ ) c c OK f(x) x x ’ 6
Importance Sampling Principle § We can even use a different distribution g to generate samples from f § By introducing an importance weight w , we can account for the “ differences between g and f ” § w = f / g § f is often called target § g is often called proposal § Pre-condition: f(x)>0 à g(x)>0 7
Importance Sampling with Resampling: Landmark Detection Example
Distributions
Distributions Wanted: samples distributed according to p(x| z 1 , z 2 , z 3 ) 10
This is Easy! We can draw samples from p(x|z l ) by adding noise to the detection parameters.
Importance Sampling p ( z | x ) p ( x ) ∏ k Target distributi on f : p ( x | z , z ,..., z ) k = 1 2 n p ( z , z ,..., z ) 1 2 n p ( z | x ) p ( x ) Sampling distributi on g : p ( x | z ) l = l p ( z ) l p ( z ) p ( z | x ) ∏ l k f p ( x | z , z ,..., z ) Importance weights w : 1 2 n k l ≠ = = g p ( x | z ) p ( z , z ,..., z ) l 1 2 n
Importance Sampling with Resampling Weighted samples After resampling
Particle Filters
Sensor Information: Importance Sampling Bel ( x ) p ( z | x ) Bel − ( x ) ← α p ( z | x ) Bel ( x ) − α w p ( z | x ) ← = α Bel ( x ) −
Robot Motion Bel − ( x ) p ( x | u x ' ) Bel ( x ' ) d x ' ← ∫ ,
Sensor Information: Importance Sampling Bel ( x ) p ( z | x ) Bel − ( x ) ← α p ( z | x ) Bel ( x ) − α w p ( z | x ) ← = α Bel ( x ) −
Robot Motion Bel − ( x ) p ( x | u x ' ) Bel ( x ' ) d x ' ← ∫ ,
Particle Filter Algorithm § Sample the next generation for particles using the proposal distribution § Compute the importance weights : weight = target distribution / proposal distribution § Resampling: “ Replace unlikely samples by more likely ones ” 19
Particle Filter Algorithm 1. Algorithm particle_filter ( S t-1 , u t , z t ): 2. S , 0 = ∅ η = t 3. For Generate new samples i = 1, … , n 4. Sample index j(i) from the discrete distribution given by w t-1 5. Sample from using and i j ( i ) x x − p ( x t | x t − 1 , u t ) u t t t 1 i i 6. Compute importance weight w = p ( z | x ) t t t i w 7. Update normalization factor η = η + t i i 8. Insert S S { x , w } = ∪ < > t t t t i = 1, … , n 9. For i i 10. w = w / Normalize weights η t t 20
Particle Filter Algorithm ∫ Bel ( x t ) = η p ( z t | x t ) p ( x t | x t − 1 , u t ) Bel ( x t − 1 ) dx t − 1 draw x i t - 1 from Bel (x t - 1 ) draw x i t from p ( x t | x i t - 1 , u t ) Importance factor for x i t : target distribution i = w t proposal distribution = η p ( z t | x t ) p ( x t | x t − 1 , u t ) Bel ( x t − 1 ) p ( x t | x t − 1 , u t ) Bel ( x t − 1 ) ∝ p ( z t | x t )
Resampling § Given : Set S of weighted samples. § Wanted : Random sample, where the probability of drawing x i is given by w i . § Typically done n times with replacement to generate new sample set S ’ .
Resampling w 1 w 1 w n w n w 2 w 2 W n-1 W n-1 w 3 w 3 § Stochastic universal sampling § Roulette wheel § Systematic resampling § Binary search, n log n § Linear time complexity § Easy to implement, low variance
Resampling Algorithm 1. Algorithm systematic_resampling ( S,n ): 2. 1 S ' , c w = ∅ = 1 3. For Generate cdf i 2 … n = i c c w 4. = + i i − 1 1 u ~ U ] 0 , n ], i 1 5. − Initialize threshold = 1 j 1 … n 6. For Draw samples … = 7. While ( ) u > c Skip until next threshold reached j i i = i 1 8. + { } i − 1 S ' S ' x , n 9. Insert = ∪ < > 1 10. Increment threshold u u n − = + j 1 j + 11. Return S ’ Also called stochastic universal sampling
Mobile Robot Localization § Each particle is a potential pose of the robot § Proposal distribution is the motion model of the robot (prediction step) § The observation model is used to compute the importance weight (correction step) [For details, see PDF file on the lecture web page] 25
Motion Model Reminder Start
Proximity Sensor Model Reminder Sonar sensor Laser sensor
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Sample-based Localization (sonar) 46
Initial Distribution 47
After Incorporating Ten Ultrasound Scans 48
After Incorporating 65 Ultrasound Scans 49
Estimated Path 50
Localization for AIBO robots 51
Using Ceiling Maps for Localization [Dellaert et al. 99]
Vision-based Localization P(z|x) z h(x)
Under a Light Measurement z: P(z|x) :
Next to a Light Measurement z: P(z|x) :
Elsewhere Measurement z: P(z|x) :
Global Localization Using Vision
Limitations § The approach described so far is able to § track the pose of a mobile robot and to § globally localize the robot. § How can we deal with localization errors (i.e., the kidnapped robot problem)? 58
Approaches § Randomly insert samples (the robot can be teleported at any point in time). § Insert random samples proportional to the average likelihood of the particles (the robot has been teleported with higher probability when the likelihood of its observations drops). 59
Summary – Particle Filters § Particle filters are an implementation of recursive Bayesian filtering § They represent the posterior by a set of weighted samples § They can model non-Gaussian distributions § Proposal to draw new samples § Weight to account for the differences between the proposal and the target § Monte Carlo filter, Survival of the fittest, Condensation, Bootstrap filter 60
Summary – PF Localization § In the context of localization, the particles are propagated according to the motion model. § They are then weighted according to the likelihood of the observations. § In a re-sampling step, new particles are drawn with a probability proportional to the likelihood of the observation. 61
Recommend
More recommend