ParticleFilter

Struct ParticleFilter 

Source
pub struct ParticleFilter {
    pub particles: Vec<Particle>,
}
Expand description

Particle filter for strapdown inertial navigation

This filter uses a particle filter algorithm to estimate the state of a strapdown inertial navigation system. Similarly to the UKF, it uses thin wrappers around the StrapdownState’s forward function to propagate the state. The particle filter is a little more generic in implementation than the UKF, as all it fundamentally is is a set of particles and several related functions to propagate, update, and resample the particles.

Fields§

§particles: Vec<Particle>

The particles in the particle filter

Implementations§

Source§

impl ParticleFilter

Source

pub fn new(particles: Vec<Particle>) -> Self

Create a new particle filter with the given particles

§Arguments
  • particles - The particles to use for the particle filter.
Source

pub fn propagate(&mut self, imu_data: &IMUData, dt: f64)

Propagate all particles forward using the strapdown equations

§Arguments
  • imu_data - The IMU measurements to propagate the particles with.
Source

pub fn update( &mut self, measurement: &DVector<f64>, expected_measurements: &[DVector<f64>], )

Update the weights of the particles based on a measurement

Generic measurement update function for the particle filter. This function requires the user to provide a measurement vector and a list of expected measurements for each particle. This list of expected measurements is the result of a measurement model that is specific to the filter implementation. This model determines the shape and quantities of the measurement vector and the expected measurements sigma points. This module contains some standard GNSS-aided measurements models (position_measurement_model, velocity_measurement_model, and position_and_velocity_measurement_model) that can be used.

Note: Canonical INS implementations use a position measurement model. Typically, position is reported in degrees for latitude and longitude, and in meters for altitude. Internally, the particle filter stores the latitude and longitude in radians, and the measurement models make no assumptions about the units of the position measurements. However, the user should ensure that the provided measurement to this function is in the same units as the measurement model.

Source

pub fn set_weights(&mut self, weights: &[f64])

Set the weights of the particles (e.g., after a measurement update)

§Arguments
  • weights - The weights to set for the particles.
Source

pub fn normalize_weights(&mut self)

Normalize the weights of the particles. This is typically done after a measurement update to ensure that the weights sum to 1.0 and can be treated like a probability distribution.

Source

pub fn residual_resample(&mut self)

Residual resampling (systematic resampling)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V