I was following the below documentation for getting the Raw Gyroscope events. Somehow I am unable to make the below code working.
if motion.isGyroAvailable {
self.motion.gyroUpdateInterval = 1.0 / 60.0
self.motion.startGyroUpdates()
// Configure a timer to fetch the accelerometer data.
self.acceTimer = Timer(fire: Date(), interval: (1.0/60.0),
repeats: true, block: { (timer) in
// Get the gyro data.
if let data = self.motion.gyroData {
let x = data.rotationRate.x
let y = data.rotationRate.y
let z = data.rotationRate.z
// Use the gyroscope data in your app.
print("rotationX: \(x) , rotationY: \(y) , rotationZ: \(z)")
}
})
// Add the timer to the current run loop.
RunLoop.current.add(self.acceTimer!, forMode: .default)
}
https://developer.apple.com/documentation/coremotion/getting_raw_gyroscope_events
The isGyroAvailable
always returns false
Dev environment - Xcode 14.1, Apple Watch 8, WatchOS 9.1