BoseGestureRecognizer
public class BoseGestureRecognizer
Base Gesture recognizer class, common to specific recognizer implementations.
-
Enable/Disable GPU predictions
Declaration
Swift
public var cpuMode: Bool
-
Set of gestures that will be detected by the library. It defaults to all available gestures.
Declaration
Swift
public var enabledGestures: Set<BoseGestureType>
-
This will get called with a gesture —if any is detected—.
Declaration
Swift
public var gestureDataCallback: ((BoseGestureType, Int) -> Void)?
-
Starts recognizing gestures. Optionally it can automatically stop recognizing after a given time interval.
Declaration
Swift
public func startDetectingGestures(timeout: TimeInterval? = nil, gestureCallback: @escaping ((BoseGestureType, Int) -> Void))
Parameters
timeout
a time interval in seconds after which gesture recognition will stop.
gestureCallback
a function that will get called when a gesture has been detected.
-
It stops detecting gestures and invalidates the previously set timer and callback
Declaration
Swift
public func stopDetectingGestures()
-
Call this function to feed accelerometer data into the gesture recognizer. It shares the same signature as the Wearable SDK’s sensor data callbacks, so it’s just a matter of adding this on the accelerometer callback from the SDK.
Declaration
Swift
public func appendAccelerometer(data: Vector, accuracy: VectorAccuracy, timestamp: SensorTimestamp)
-
Call this function to feed gyroscope data into the gesture recognizer. It shares the same signature as the Wearable SDK’s sensor data callbacks, so it’s just a matter of adding this on the gyroscope callback from the SDK.
Declaration
Swift
public func appendGyroscope(data: Vector, accuracy: VectorAccuracy, timestamp: SensorTimestamp)
-
Clear any history of or pertaining to sensor data
Declaration
Swift
public func flush()