通过实时数据消除错误的GPS点并快速路由到道路

时间:2016-05-31 07:31:49

标签: routing gps kalman-filter graphhopper

我正在使用Graphhopper离线创建离线GPS导航应用程序,OpenStreetMap数据和每秒从Android设备读取的GPS坐标。

到目前为止,我已经设法读取GPS坐标,从graphhopper获取路线指令并更新我在地图上的位置。但是,当我使用真实数据进行测试时,有大量的点实际上并不在路由上,并且由于我从graphhopper获得了错误的路由指令。

为了消除这种情况,我尝试使用卡尔曼滤波方法作为stackoverflow问题的答案

但我仍然得到了相当多的错误结果。我无法发布我的确切代码,因为这是针对某个产品。我的方法是,

private void showPermissionDialog() {
    // Here, thisActivity is the current activity
    if (ContextCompat.checkSelfPermission(mActivity,
            Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {

        // Should we show an explanation?
        if (ActivityCompat.shouldShowRequestPermissionRationale(mActivity,
                Manifest.permission.ACCESS_FINE_LOCATION)) {

            // Show an expanation to the user *asynchronously* -- don't block
            // this thread waiting for the user's response! After the user
            // sees the explanation, try again to request the permission.

        } else {

            // No explanation needed, we can request the permission.

            ActivityCompat.requestPermissions(mActivity,
                    new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
                    MY_PERMISSIONS_REQUEST_FOR_LOCATION);

            // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
            // app-defined int constant. The callback method gets the
            // result of the request.
        }
    } else {
        if (mGoogleApiClient != null)
            mGoogleApiClient.connect();
    }
}

为了使路径平滑,我获得了每个GPS位置读取的卡尔曼预测值。但我得到的不准确点数超过了可以接受的程度。

如果你可以通过指出我做错了什么或者解决这个问题的方法来帮助我,我将非常感激。我不是要求代码,至少指向正确的方向会对我有所帮助。

0 个答案:

没有答案