pub struct ParticleFilter { /* private fields */ }Expand description
Particle Filter for non-Gaussian/nonlinear state estimation
Uses Monte Carlo methods to estimate the posterior distribution of states in nonlinear/non-Gaussian systems.
Implementations§
Source§impl ParticleFilter
impl ParticleFilter
Sourcepub fn new(
num_particles: usize,
initial_state: Array1<f32>,
initial_std: f32,
process_noise_std: f32,
measurement_noise_std: f32,
) -> IoResult<Self>
pub fn new( num_particles: usize, initial_state: Array1<f32>, initial_std: f32, process_noise_std: f32, measurement_noise_std: f32, ) -> IoResult<Self>
Create a new particle filter
§Arguments
num_particles- Number of particlesinitial_state- Initial state estimateinitial_std- Initial state uncertainty (standard deviation)process_noise_std- Process noise standard deviationmeasurement_noise_std- Measurement noise standard deviation
Sourcepub fn predict<F>(&mut self, transition_fn: F)
pub fn predict<F>(&mut self, transition_fn: F)
Predict step with custom state transition function
§Arguments
transition_fn- Function that takes a state and returns predicted state
Sourcepub fn update<F>(&mut self, measurement: &Array1<f32>, measurement_fn: F)
pub fn update<F>(&mut self, measurement: &Array1<f32>, measurement_fn: F)
Update step with custom measurement function
§Arguments
measurement- Observed measurementmeasurement_fn- Function that converts state to measurement
Sourcepub fn mean_state(&self) -> Array1<f32>
pub fn mean_state(&self) -> Array1<f32>
Get mean state estimate
Sourcepub fn covariance(&self) -> Array2<f32>
pub fn covariance(&self) -> Array2<f32>
Get weighted covariance of state estimate
Trait Implementations§
Source§impl Clone for ParticleFilter
impl Clone for ParticleFilter
Source§fn clone(&self) -> ParticleFilter
fn clone(&self) -> ParticleFilter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ParticleFilter
impl RefUnwindSafe for ParticleFilter
impl Send for ParticleFilter
impl Sync for ParticleFilter
impl Unpin for ParticleFilter
impl UnwindSafe for ParticleFilter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more