[ad_1]
I’m recording IMU knowledge from watch sensors utilizing Core Movement Framework gadget movement updates at 60hz utilizing watch exercise classes more often than not it really works superb however typically 3/10 there’s a giant hole in knowledge captured from the sensor e.g. for 10 minutes it didn’t document something additionally knowledge recorded doesn’t at all times document at 60hz frequency, Following is code for similar any recommendations?
let movement = CMMotionManager()
movement.deviceMotionUpdateInterval = 1/60
movement.startDeviceMotionUpdates(to: queue) { (deviceMotion: CMDeviceMotion?, error: Error?) in
if error != nil {
print("Encountered error: (error!)")
}
if let deviceMotion = deviceMotion {
self.saveIMUReading(deviceMotion: deviceMotion)
}
}
FYI as readings are generated at close to 60hz I save a piece of each 1000 entries within the JSON file, Your information or help on this topic can be of nice assist Thanks.
[ad_2]
