gpt4 book ai didi

ios - 核心位置 : CPAS data response was invaild

转载 作者:搜寻专家 更新时间:2023-10-31 08:06:15 25 4
gpt4 key购买 nike

在装有 iOS 10.0.2 的 iPhone 6 上,我收到以下代码的错误:

class ViewController: UIViewController {

@IBOutlet weak var startStop: UIButton!

var isRunning = false

let manager: CMMotionManager = {
let manager = CMMotionManager()
manager.deviceMotionUpdateInterval = 1/100
return manager
}()

@IBAction func handleStartStop(_ sender: AnyObject) {
if isRunning {
stopMotionUpdates()
startStop.setTitle("Start", for: .normal)
} else {
startMotionUpdates()
startStop.setTitle("Stop", for: .normal)
}
isRunning = !isRunning
}

func startMotionUpdates() {
manager.startDeviceMotionUpdates(using: .xTrueNorthZVertical, to: .main) { (data, error) in
print("Roll: \(data!.attitude.roll), Pitch: \(data!.attitude.pitch), Yaw: \(data!.attitude.yaw)")
}
}

func stopMotionUpdates() {
manager.stopDeviceMotionUpdates()
}

}

输出:

2016-10-19 07:45:13.865847 CoreMotionTest[562:350766] CoreLocation: CPAS data response was invaild.
Roll: -0.0135864792263794, Pitch: 0.00864587532420694, Yaw: 6.47493275587377e-05
Roll: -0.0135915108585011, Pitch: 0.00865699352311076, Yaw: 7.09129926643357e-05
Roll: -0.0135963930210582, Pitch: 0.00867386848019366, Yaw: 8.84424471509634e-05
Roll: -0.0136066048134502, Pitch: 0.00868011794373523, Yaw: 0.000105925819254466
Roll: -0.0136114190872102, Pitch: 0.00867577431915433, Yaw: 0.000117932969705823
Roll: -0.0135948730328641, Pitch: 0.00867657982050841, Yaw: 0.00012968687069689
Roll: -0.0135732480451522, Pitch: 0.00867729811777266, Yaw: 0.000152007924023406
Roll: -0.0135619969691634, Pitch: 0.00868342424259059, Yaw: 0.000163872505991956
Roll: -0.013304139897602, Pitch: 0.00874500976978164, Yaw: 0.000179014630004322
Roll: -0.0133409772363028, Pitch: 0.00887204866716325, Yaw: 0.00018600114405152
Roll: -0.0130968013066843, Pitch: 0.00890815168076916, Yaw: 0.000201127439543817
Roll: -0.0129980717242318, Pitch: 0.00898203106432451, Yaw: 0.00022290167061286
Roll: -0.013058759809209, Pitch: 0.008972000868579, Yaw: 0.000240753238817741
Roll: -0.0130954579972119, Pitch: 0.0089717830946822, Yaw: 0.000258417382421598

知道这是什么意思吗?

最佳答案

与使用指南针的要求有关。 xMagneticNorthZVertical 会导致它,而 xArbitraryZVertical 不会。

关于ios - 核心位置 : CPAS data response was invaild,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40117938/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com