有CMDeviceMotion在iOS的11 我试图使用它,但发现它总是-1.0新heading property。它应该保持度数为0.0至360.0。 运行iOS 11. let mmgr = CMMotionManager()
mmgr.showsDeviceMovementDisplay = true // for calibrating magnetometer, maybe not n
这里是我的CM代码: func checkMotion(_ myMotionManager:CMMotionManager) -> Bool {
//check to see if core motion is available
var isCoreMotionAvailable = myMotionManager.isAccelerometerAvailable
我正在使用CoreMotion在应用程序中获取设备运动测量。我可以得到加速度xyz,滚动,俯仰,偏航,陀螺仪数据等。 但我想测量的是摇动即设备移动了多少,并为设备移动一个大金额在任何方向。我发现我回来的测量值超级敏感,我不知道如何正确使用它。 注:我知道如何检测摇动手势,这不是我要求的 - 我要求正确的方法来测量抖动量并显示它。代码 样我从DeviceMotion使用: if let devic