使用startDeviceMotionUpdatesToQueue启动运动管理器不会产生磁力计读数

时间:2014-03-28 04:05:08

标签: ios cocoa-touch

我启动了一个动作管理器来排队(而不是通常的轮询方法。)

[self.motionManager startDeviceMotionUpdatesToQueue:self.motionQueue
                                                withHandler:^(CMDeviceMotion *motion, NSError *error) {
                                                    [self.data addObject:motion]; // Record the data.
                                                }];

我的NSMutableArray,self.data的示例输出是:

"QuaternionX 0.276414 QuaternionY -0.011645 QuaternionZ -0.004033 QuaternionW 0.960960 
UserAccelX -0.006354 UserAccelY -0.021349 UserAccelZ 0.040370 
RotationRateX -0.277591 RotationRateY -0.080331 RotationRateZ -0.011461 
MagneticFieldX 0.000000 MagneticFieldY 0.000000 MagneticFieldZ 0.000000 MagneticFieldAccuracy -1 @ 200988.637128"

请注意,magneticFeld的所有读数均为零。此外,它的准确度为-1。

当我以通常的方式启动motionManager时,我没有这个问题 - 即通过调用

[self.motionManager startDeviceUpdatesUsingReferenceFrames:f];

在单独的队列中接收更新时,我还需要做些什么来让磁力计工作吗?

0 个答案:

没有答案