#[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>
impl<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>
Sourcepub fn new(params: RecognizerParams, sensor_params: SensorParams) -> Self
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.
Sourcepub fn reset(
&mut self,
params: RecognizerParams,
sensor_params: SensorParams,
now: u32,
) -> RecognizerStatus
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.
Sourcepub fn update(
&mut self,
measurement: SensorMeasurement<RES_X, RES_Y>,
recognizer_result: &mut RecognizerResult,
) -> RecognizerStatus
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).
Sourcepub fn get_sensor_params(&self) -> SensorParams
pub fn get_sensor_params(&self) -> SensorParams
Gets the current configured sensor parameters
Sourcepub fn get_params(&self) -> RecognizerParams
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>
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>
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)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto 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> 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