Particle Filter - non-Gaussian Distribution
Author: Teng-Hu Cheng
email: tenghu@nycu.edu.tw
Date: Nov. 2024
Website: https://ncrl.lab.nycu.edu.tw/member/
目錄
Preliminary
https://tomohiroliu22.medium.com/機率與貝葉氏機器學習-學習筆記系列-01-貝氏推斷-bayesian-inference-d81b01dc5c89
Assumptions
The following assumtion are made in this article:
- The state transition matrix follows Markov property (in Section 2).
- Posterior under Gaussian distribution (in Section 3).
Scenario
Here’s an example for robot localization:
- A robot is navigating a 2D environment.
- It has a laser rangefinder that measures the distance to walls.
- The environment is known (map available).
- The robot is uncertain about its position and orientation.
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Architecture
Below depicts the architecture of the algorithm
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
1. Initial Setup
- Particles: Each particle represents a possible robot pose, , , .
- Map: The map provides the positions of walls.
- Sensor Model: The laser sensor provides distance measurements to the nearest obstacle.
2. Prediction (State Transition Probability)
Below is a commonly used state transition models.
For a 2D motion system with position :
The updated state becomes:
where the state transition matrix is defined as
Note that the elements in can be transition matrix following Markov property.
3. Update
Now assume that the robot's laser rangefinder reports a distance of 3 meters** to the nearest wall.
3.1 Compute Weights
3.1.1 non-Gaussian Observation Model
Use a Gaussian likelihood function to compare the predicted sensor reading with the actual reading (=3 from Step 3.) and the state (i.e., from the state transition in Step 2.):
where:
- is some positive constant to make positive.
- : Actual sensor reading (3.0 meters).
- : Predicted sensor reading for the particle.
- : The covariance of the observation noise.
Note: You can check out "normpdf" function in Matlab for details.
3.1.2 Weights
By using the observed output , and the weight computed at the previous time step , calculate the intermediate weight update, denoted by , by using the density function of the measurement probability.
where denotes the particles, and computing the Gaussian likelihood can be found in Section 3.1.1.
After all the intermediate weights are computed, compute the normalized weights as follows:
where
Multiple sensor fusion for State Estimation
3.1.3 Find Pairs
After finding weights in Section 3.1.2, we computed the set of particles for the time step :
4. Resample
4.1 Check the Conditions for Resample
This is a resampling step that is performed only if the condition given below is satisfied. Calculate the constant :
- If , then generate a new set of particles from the computed set of particles:
- If , the result is accepted.
Resample particles based on their weights:
- High-weight particles are likely to be duplicated.
- Low-weight particles are likely to be discarded.
4.2 Resample
- Resampling is done based on the normalized weights .
- Particles with higher weights are more likely to be selected multiple times, while particles with very low weights are likely to be discarded.
- Example of resampling
4.3 Generate the New Particle Set
- Replace the old set of particles with the new set drawn during resampling.
- Assign equal weights to all particles in the new set (e.g., ).
5. Results
After the sensor update, the particle filter is more confident about the robot’s pose, as particles now concentrate around states consistent with the sensor measurement.
References
- Particle Filter
- Joint Probability
- J. V. Candy, "Bootstrap Particle Filtering," in IEEE Signal Processing Magazine, vol. 24, no. 4, pp. 73-85, July 2007, doi: 10.1109/MSP.2007.4286566.
- Resampling Methods for Particle Filtering
Example 1
1. Initial Setup
Given a set of particles , where the position of each particle represents a possible robot pose =(, ,, ), where the state is defined as
and the weight are equal, .
2. Prediction
By using the dynamics model, the predicted (a priori) state estimation becomes:
where the state transition matrix and control input matrix are defined as
where is the control input (i.e., acceleration) at the previous time step , and ), where is the process noise covariance matrix.
3. Update
3.1 Measurement Model
- linear model
Defined the measurement model (linear model), where
By using the following relation between the predicted measurement in 3.1 Measurement Model and the observed output , and the weight computed at the previous time step , the intermediate weight update is calculated.
the likelihood can be computed, so that the intermediate weight can be calculated as follows:
3.3 Normalization
After all the intermediate weights are computed, compute the normalized weights as follows:
where
Then use 3.2.3 Find Pairs to find the new pairs
4. Resample
4.1 Check conditions for resample
Follows are the conditions to determine resample or accept.
- If , then generate a new set of particles from the computed set of particles:
- If , the result is accepted.
4.2 Resample
- Resampling is done based on the normalized weights .
- Particles with higher weights are more likely to be selected multiple times, while particles with very low weights are likely to be discarded.
4.3 Generate the New Particle Set
- Replace the old set of particles with the new set drawn during resampling.
- Assign equal weights to all particles in the new set (e.g., ).