Skip to main content

LidarMcl

Struct LidarMcl 

Source
pub struct LidarMcl { /* private fields */ }
Expand description

Particle-filter localization against an OccupancyGrid.

Implementations§

Source§

impl LidarMcl

Source

pub fn new(grid: OccupancyGrid, config: LidarMclConfig) -> Self

Creates a filter on grid with particles spread uniformly over the free cells (global localization).

Source

pub fn grid(&self) -> &OccupancyGrid

The map being localized in.

Source

pub fn particles(&self) -> &[Particle]

Current particles.

Source

pub fn initialize_global(&mut self)

Spreads the particles uniformly over the free space.

Source

pub fn initialize_at(&mut self, pose: Pose2D, xy: f64, yaw: f64)

Spreads the particles around pose (position σ xy, heading σ yaw).

Source

pub fn predict(&mut self, odom_delta: Pose2D)

Motion update with a body-frame odometry step.

Source

pub fn scan_match_candidates( &self, scan_body: &[Vector2<f64>], count: usize, ) -> Vec<(Pose2D, f64)>

Correlative scan matching (Olson, 2009) over the whole map: scores a coarse lattice of free positions × headings against a wide likelihood field, refines the best by local search on the fine field, and returns up to count distinct poses with their per-beam likelihood, best first. Look-alike places come back as separate candidates.

Source

pub fn candidates(&self) -> &[(Pose2D, f64)]

The current scan-matching candidates (refreshed during updates).

Source

pub fn update(&mut self, scan_body: &[Vector2<f64>])

Measurement update and resampling with a beam-ordered body-frame scan.

Source

pub fn fit(&self) -> f64

Posterior-weighted per-beam likelihood of the last scan, in (0, 1]: how well the particles explain what the LiDAR sees.

Source

pub fn estimate(&self) -> (Pose2D, f64)

Pose of the heaviest particle mode and the RMS distance of all particles from it [m].

Trait Implementations§

Source§

impl Clone for LidarMcl

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LidarMcl

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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
§

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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

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

§

fn vzip(self) -> V