Struct fast_slam::FastSLAM

source ·
pub struct FastSLAM<N: RealField, DL: Dim, const DF: usize>
where DefaultAllocator: Allocator<N, DL, DL> + Allocator<N, DL> + Allocator<N, Const<DF>, Const<DF>> + Allocator<N, Const<DF>>,
{ pub loc: SampleState<N, DL>, pub map: HashMap<u32, FeatureCondMap<N, Const<DF>>>, }
Expand description

Fast SLAM state.

A sample state of the location with augmented Kalman states of map features.

Fields§

§loc: SampleState<N, DL>

Location as a sample state.

§map: HashMap<u32, FeatureCondMap<N, Const<DF>>>

Hashmap of augmented map feature states.

Implementations§

source§

impl<N: RealField + Copy + FromPrimitive + ToPrimitive, DL: Dim, const DF: usize> FastSLAM<N, DL, DF>
where DefaultAllocator: Allocator<N, DL, DL> + Allocator<N, DL> + Allocator<N, Const<DF>, Const<DF>> + Allocator<N, U1, Const<DF>> + Allocator<N, Const<DF>>,

source

pub fn new(loc: SampleState<N, DL>) -> Self

Creates a FastSLAM with empty feature map.

source

pub fn observe_new( &mut self, feature: u32, obs_model: impl Fn(&OVector<N, DL>) -> Feature<N, Const<DF>> )

SLAM new feature observation (overwrite).

Assumes there is no prior information about the feature (strictly a uniform un-informative prior) This implies: a) There has no information about location so no resampling is requires b) Feature state estimates comes directly from the location and observation

source

pub fn observe<DZ: Dim>( &mut self, feature: u32, innovation_model: impl Fn(&OVector<N, DL>, &OVector<N, Const<DF>>) -> (OVector<N, DZ>, CorrelatedNoise<N, DZ>), hx: &OMatrix<N, DZ, Const<DF>> )
where DefaultAllocator: Allocator<N, U1, Const<DF>> + Allocator<N, DZ, DZ> + Allocator<N, DZ, Const<DF>> + Allocator<N, Const<DF>, DZ> + Allocator<N, DZ>,

SLAM Feature observation. Uses Extended Fast_SLAM observation equations Note: Mathematically only weight ratios are important. Numerically however the range should be restricted. The weights are computed here using the simplest form with common factor Ht removed.

source

pub fn forget(&mut self, feature: u32) -> Option<FeatureCondMap<N, Const<DF>>>

Forget all feature information, feature no can be reused for a new feature

source

pub fn update_resample( &mut self, resampler: &mut Resampler, roughener: &mut Roughener<N, DL>, rng: &mut dyn RngCore ) -> Result<(u32, f32), &str>

Resampling Update.

Resample using weights. Propagate resampling to All features. Only resamples if weights have been updated.

source

pub fn statistics_compressed(&self, kstat: &mut KalmanState<N, Dyn>)
where DefaultAllocator: Allocator<N, U1, DL>,

Compute sample mean and covariance statistics of filter.

kstat elements are filled first with Location statistics and then the Map feature statistics. Feature statistics are are computed in feature number order and only for those for which there is space in kstat.

Precond: kstat must have space for location statistics

source

pub fn statistics_sparse(&self, kstat: &mut KalmanState<N, Dyn>)
where DefaultAllocator: Allocator<N, U1, DL>,

Compute sample mean and covariance statistics of filter.

kstat elements are filled first with Location statistics and then the Map feature statistics. Feature statistics are are computed in feature number as index (after location) and only for those for which there is space in kstat.

Precond: kstat must have space for Location statistics

Auto Trait Implementations§

§

impl<N, DL, const DF: usize> !RefUnwindSafe for FastSLAM<N, DL, DF>

§

impl<N, DL, const DF: usize> !Send for FastSLAM<N, DL, DF>

§

impl<N, DL, const DF: usize> !Sync for FastSLAM<N, DL, DF>

§

impl<N, DL, const DF: usize> !Unpin for FastSLAM<N, DL, DF>

§

impl<N, DL, const DF: usize> !UnwindSafe for FastSLAM<N, DL, DF>

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

§

type Output = T

Should always be Self
§

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

§

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

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

fn is_in_subset(&self) -> bool

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

fn to_subset_unchecked(&self) -> SS

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

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>,

§

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>,

§

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.
§

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

§

fn vzip(self) -> V