智能手机GPS定位算法研究

我正在开发一个Android应用程序来根据传感器的数据计算位置


加速度计 - >计算线性加速度


磁力计+加速度计 - >运动方向


初始位置将取自GPS(纬度+经度)。


现在根据传感器的读数,我需要计算智能手机的新位置:


我的算法遵循 - (但不计算准确位置):请帮我改进它。


注意: 我的算法代码在C#中(我将传感器数据发送到服务器 - 数据存储在数据库中。我正在计算服务器上的位置)


所有DateTime对象都是使用TimeStamps计算的 - 从01-01-1970


    var prevLocation = ServerHandler.getLatestPosition(IMEI);

    var newLocation = new ReceivedDataDTO()

                          {

                              LocationDataDto = new LocationDataDTO(),

                              UsersDto = new UsersDTO(),

                              DeviceDto = new DeviceDTO(),

                              SensorDataDto = new SensorDataDTO()

                          };


    //First Reading

    if (prevLocation.Latitude == null)

    {

        //Save GPS Readings

        newLocation.LocationDataDto.DeviceId = ServerHandler.GetDeviceIdByIMEI(IMEI);

        newLocation.LocationDataDto.Latitude = Latitude;

        newLocation.LocationDataDto.Longitude = Longitude;

        newLocation.LocationDataDto.Acceleration = float.Parse(currentAcceleration);

        newLocation.LocationDataDto.Direction = float.Parse(currentDirection);

        newLocation.LocationDataDto.Speed = (float) 0.0;

        newLocation.LocationDataDto.ReadingDateTime = date;

        newLocation.DeviceDto.IMEI = IMEI;

        // saving to database

        ServerHandler.SaveReceivedData(newLocation);

        return;

    }



    //If Previous Position not NULL --> Calculate New Position

   **//Algorithm Starts HERE**


    var oldLatitude = Double.Parse(prevLocation.Latitude);

    var oldLongitude = Double.Parse(prevLocation.Longitude);

    var direction = Double.Parse(currentDirection);

    Double initialVelocity = prevLocation.Speed;


    //Get Current Time to calculate time Travelling - In seconds

    var secondsTravelling = date - tripStartTime;

    var t = secondsTravelling.TotalSeconds;

这是我得到的结果 - >电话没有移动。你可以看到速度是27.3263111114502 所以计算速度有问题,但我不知道是什么

绝地无双
浏览 491回答 3
3回答

临摹微笑

加速度传感器和陀螺仪不适合位置计算。几秒钟后,错误变得令人难以置信。(我几乎不记得双重整合是问题)。看看这个关于传感器融合的Google技术谈话视频,他非常详细地解释了为什么这是不可能的。
打开App,查看更多内容
随时随地看视频慕课网APP