2
我正在探索使用GPS进行VR游戏的可能性。在我目前的测试版本中,频率和精度都非常低。提高GPS频率和精度
在清单我
<uses-permission android:name="android.permission.LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
我实例位置经理像
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
0, 0, this);
我然后使用distanceBetween函数来获取轴承和距离
public void onLocationChanged(Location location) {
if(lastLocation != null) {
Location.distanceBetween(lastLocation.getLatitude(), lastLocation.getLongitude(), location.getLatitude(), location.getLongitude(), distanceBetween);
newGpsDataToSend = true;
if(debug)
debugListener.debugGPS(distanceBetween);
releaseSendThread();
}
lastLocation = location;
}
频率为低于1hz(5-10hz应该可以吧?),而且方位和距离都很跳跃年。
我在做代码错了吗?我不在乎电池消耗等,我只是想从手机中获得最快速,最可靠的数据。
所以你说它不可能获得更好的性能? Bummer,猜猜我必须尝试卡尔曼滤波器和加速度计融合:/ – Anders 2013-03-08 15:31:13
它的手机,而不是导弹航空电子设备:-) – Stefan 2013-03-09 08:23:34