maddevsio / mad-location-manager

Mad Location Manager is a library for GPS and Accelerometer data "fusion" with Kalman filter
MIT License
533 stars 154 forks source link

can we add a network provider in case of GPS is unavailable? #71

Open FX-HAO opened 4 years ago

FX-HAO commented 4 years ago

Since GPS is accurate enough, can we add a network provider to improve accuracy in case of GPS is unavailable?

FX-HAO commented 4 years ago

We can fuse location information from many different sources (such as GPS and Wi-Fi), does it help to improve accuracy? I guess it's what FusedLocationProvider does?

Lezh1k commented 4 years ago

FusedLocationProvider does all work, you don't need to fuse sensor data with that thing :)

FX-HAO commented 4 years ago

But most of our phones (in china) don't have google play services installed :(

So I can just add this line and nothing else needed to be done, right?

m_locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, m_settings.gpsMinTime, m_settings.gpsMinDistance, this);
Lezh1k commented 4 years ago

I don't think that LocationManager.NETWORK_PROVIDER works with enough precision, sorry. So if you don't have google play services installed, then you need to try our approach. But you need GPS at least + set of sensors (accelerometer, gyroscope, magnetometer) .

FX-HAO commented 4 years ago

Yes, location information from network provider has less accuracy. But I'm thinking of a case that GPS is unavailable but the network works (I am not sure whether or not this could happen). In this case we are losing all location information without network provider. And I think Kalman filter can correct these locations from network. Since their accuracy is bigger, the measurement is trusted more.

Lezh1k commented 4 years ago

It will work, I guess. But you need to know, that noise integration produces very big error. So you can get very inaccurate position in this case.

FX-HAO commented 4 years ago

Thanks for the suggestion! I'll give it a try and feed back :)