Struct GestureRecognizer

Source
#[repr(C)]
pub struct GestureRecognizer<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> { /* private fields */ }
Expand description

The gesture recognizer.

Is initially configured through parameters and gets fed measurements and time and predicts gestures.

Implementations§

Source§

impl<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

Source

pub fn new(params: RecognizerParams, sensor_params: SensorParams) -> Self

A new gesture recognizer with the given parameters.

The sensor parameters have preconfigured defaults for common TOF-Sensors such as the ST VL53L5CX.

Source

pub fn reset( &mut self, params: RecognizerParams, sensor_params: SensorParams, now: u32, ) -> RecognizerStatus

Resets the gesture recognizer with the given parameters.

Clears the history, ongoing predictions and resets the internal state.

Source

pub fn update( &mut self, measurement: SensorMeasurement<RES_X, RES_Y>, recognizer_result: &mut RecognizerResult, ) -> RecognizerStatus

Updates the gesture recognizer with a new measurement and time.

The time in the measurement must be monotonically increasing (usually coming from a systick timer).

Source

pub fn get_sensor_params(&self) -> SensorParams

Gets the current configured sensor parameters

Source

pub fn get_params(&self) -> RecognizerParams

Gets the current configured gesture recognizer parameters

Trait Implementations§

Source§

impl<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> Clone for GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

Source§

fn clone(&self) -> GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> Debug for GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> Freeze for GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

§

impl<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> RefUnwindSafe for GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

§

impl<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> Send for GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

§

impl<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> Sync for GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

§

impl<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> Unpin for GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

§

impl<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> UnwindSafe for GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

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