What does Core Motion error 102 mean?

后端 未结 5 1648
时光说笑
时光说笑 2021-01-19 02:18

I use Core Motion\'s sensor fusing to get north oriented motion updates:

[motionManager startDeviceMotionUpdatesUsingReferenceFrame:CMAttitudeReferenceFrameX         


        
相关标签:
5条回答
  • 2021-01-19 02:44

    Also, make sure this is enabled. After I enabled this option, I did not encounter the 102 issue anymore while using xTrueNorthZVertical.

    Settings > Privacy > Location Services > System Services > Compass Calibration

    0 讨论(0)
  • 2021-01-19 02:48

    102 is CMErrorTrueNorthNotAvailable. I guess that your device has problems with determining north direction or something.

    0 讨论(0)
  • 2021-01-19 02:57

    From documentation

    typedef enum {
       CMErrorNULL = 100,
       CMErrorDeviceRequiresMovement,
       CMErrorTrueNorthNotAvailable
    } CMError;
    

    It seems error 102 is CMErrorTrueNorthNotAvailable, and its description is

    CMErrorTrueNorthNotAvailable

    It seems not much information is available regarding what causes this error. It can be any hardware issue with the device.

    0 讨论(0)
  • 2021-01-19 02:59

    As Krishnabhadra correctly pointed out, this error code means CMErrorTrueNorthNotAvailable. The description ("True north is not available on this device. This usually indicates that the device’s location is not yet available.") unfortunately doesn't give any hint how to solve the issue so I'd like to describe my findings when this error occurs.

    It occurs on a tiny (a handful out of many thousands) fraction of iOS 6.0+ devices when using CMAttitudeReferenceFrameXTrueNorthZVertical (CMAttitudeReferenceFrameXMagneticNorthZVertical is OK). Despite the error description, Core Location works correctly. On affected devices the bug is triggered in 100% of the cases and blocks Core Motion updates completely. -[CMMotionManager deviceMotion] always returns nil.

    Resetting the iOS system settings fixes the problem.

    I’ve logged rdar://12952327 with some more details.

    Update: This error occurs if compass calibration is disabled in the privacy / location services / system services section.

    0 讨论(0)
  • 2021-01-19 03:04

    I got this error and when i tried to find solution, apparently my location services in my device are switched off, once i switched on, it worked.

    0 讨论(0)
提交回复
热议问题