Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CoreLocation: CPAS data response was invaild

On an iPhone 6 with iOS 10.0.2, I'm getting an error with the following code:

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()
    }

}

Output:

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

Any idea what this means?

like image 558
doovers Avatar asked Nov 08 '22 07:11

doovers


1 Answers

It has something to do with the request to use the compass. xMagneticNorthZVertical causes it while xArbitraryZVertical does not.

like image 107
Peter B. Kramer Avatar answered Nov 15 '22 11:11

Peter B. Kramer