【问题标题】:CoreLocation - but for indoors (Swift 2 / IOS)CoreLocation - 但适用于室内 (Swift 2 / IOS)
【发布时间】:2016-06-25 20:49:12
【问题描述】:

我正在为一个应用开发概念验证功能。此应用将主要在室内使用。预期的结果是能够跟踪用户在按下按钮后是否在室内移动了 3 米以上。我使用 CoreLocation 进行这项工作 - 但结果并没有削减它。数字有时会“跳跃”,这会认为这个应用程序没用。

我正在寻找任何可能的替代方案。还查看了加速度计和 pedamater,但仍然觉得 GPS / CoreLocation 是我最好的选择。 (或者是...?)

我想到的一件事是使用 requestLocation,并每 10 秒重新检查一次,看看手机是否移动了 3 米以上。它不需要是实时的,所以我可以使用 10 秒的缓冲区。这会是最好的方法吗? (缺点是在 ios9 中引入了 requestLocation ......需要 ios8 及以下版本的替代解决方案)

这是我的代码(产生 GPS“跳跃”):

func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {

    let latestLocation: AnyObject = locations[locations.count - 1]


    if startLocation == nil {
        startLocation = latestLocation as! CLLocation
    }

    let distanceBetween: CLLocationDistance = latestLocation.distanceFromLocation(startLocation)

    distanceLabel.text = String(format: "%.2f", distanceBetween)

    if distanceBetween > 3.0{
        labelOutput.text = "you traveled more than 3 meters"
    }

}

提前谢谢..

【问题讨论】:

标签: gps swift2 cllocationmanager


【解决方案1】:

GPS 定位是通过处理 L1 和 L2 频率的 GPS 信号来完成的(对于较新的 GPS 卫星,需要额外的 L3)。离开 GPS 的信号在经过电离层和对流层后被 GPS 接收器接收,这会导致信号失真。测量 GPS 信号(有误差)行进的总距离,并根据测量结果计算您的位置。已经开发了许多技术来减轻离子和对流误差。但是如果你在建筑物内,GPS 信号会有严重的多径误差,很难处理。我想说,对于室内应用,您可能需要考虑结合其他传感器,而不仅仅是 GPS。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-04-06
相关资源
最近更新 更多