A sequential importance resampling filter for the planar pose.
robot_particle_filter() draws n particles from a Gaussian around
mean. pf_predict() moves each particle with the exact unicycle model
under control noise Q. pf_update() weights particles by the Gaussian
likelihood of range-bearing measurements (with wrapped bearing
residuals) and resamples with low-variance resampling when the
effective sample size falls below resample_threshold * n. The
estimate uses the circular mean for the heading. Seeds make each step
reproducible without changing the global random state.
Usage
robot_particle_filter(n, mean, cov, landmarks, Q, R, seed = NULL)
pf_predict(filter, control, dt, seed = NULL)
pf_update(filter, measurements, resample_threshold = 0.5, seed = NULL)
pf_estimate(filter)Arguments
- n
Number of particles.
- mean, cov
Initial Gaussian.
- landmarks
Landmark matrix with row names as ids.
- Q, R
Control and measurement noise covariances (
Rpositive definite).- seed
Optional seed.
- filter
A
robot_particle_filter.- control
c(v, omega).- dt
Duration.
- measurements
Data frame from
landmark_measurements().- resample_threshold
Fraction of
nbelow which to resample.