jjzjj

updatedHeading

全部标签

ios - 罗盘和陀螺仪传感器融合 : between 0 and 360 degrees

我正在开发一个小型室内导航应用程序,我在其中使用陀螺仪和指南针来确定设备方向。我使用陀螺仪来平滑罗盘数据。我的传感器融合如下所示。这是我的motionHandler,一切都在这里发生。//ListentoeventsfromthemotionManagermotionHandler=^(CMDeviceMotion*motion,NSError*error){__blockfloatheading;heading=mHeading;CMAttitude*currentAttitude=motion.attitude;//Initialheadingsettingif(lastHeadi