rinigus / pure-maps

Maps and navigation
https://rinigus.github.io/pure-maps/
GNU General Public License v3.0
249 stars 43 forks source link

Allow to start navigation from current position before having a fix #546

Open jonnius opened 3 years ago

jonnius commented 3 years ago

On some UT devices getting a GPS fix can take up to a few minutes. That means one cannot start navigation.

I have seen users struggling with and asking about it. My personal workaround is to select some random start address to start navigation so I that I can start driving. When it gets a fix, the route is recalculated anyways.

Could we just allow to start navigation from "current position" without having a fix yet, so that the random start address workaround is not needed?

rinigus commented 3 years ago

Sure, will look into it.

rinigus commented 3 years ago

There isn't much what is required to start navigation. I wonder whether 708b35b827e370d2ed45c6f9362c05eb81df2a79 has helped on UT.

In particular, all what is required that the positioning data is given to Qt. On SFOS it is usually on start of the app. Pure Maps doesn't make any assumptions regarding accuracy while calculating the route. While navigating, it is requested to be accurate, but that makes sense.

Let's see if my change helped - let me know when you get to test it.

jonnius commented 3 years ago

I just tested the current master and the issues is still the same. The system has GPS enabled and is searching for a fix (an indicator in the top bar shows that). I guess that during that time, Qt does not provide position data. My request here is that Pure Maps allows me to start navigation anyway.

I don't see how starting navigation from "current position" before having a fix (1) is different from starting navigation from an address I enter (2). Navigation will try to locate me and recalculate the route anyway. Pure Maps allows (2) while it does allow (1). The button is disabled until having a fix or entering a random start address.

jonnius commented 3 years ago

If you think, the system should behave differently, I would open an issue in the Ubuntu Touch issue tracker instead. In that case, could you describe what you would expect from it?

rinigus commented 3 years ago

But is there such a location as a current location displayed by Pure Maps? Does it show some coordinates as a blue dot on the map?

jonnius commented 3 years ago

Nope. There is no current location shown.

rinigus commented 3 years ago

But in that case Qt does not even provide any kind of valid location estimate. Not much we can do on Pure Maps side.

jonnius commented 3 years ago

Why can't we switch to navigation view where route calculation would start once there is a location? If I add a random start address the same happens.

rinigus commented 3 years ago

OK, I missed the whole point of it. So, we would need some kind of mode or ability to preorder navigation mode to some destination(s) before the origin is known. I'll have to think how to do that.

rinigus commented 2 years ago

As positioning source has changed in the master - not tagged for release yet - is this still an issue?

jonnius commented 2 years ago

I would expect this to be the same issue. But I'll try and report back.

rinigus commented 2 years ago

If it will not help, we can actually cache last known position and that way you will get is as "current" on new start of Pure Maps.

rinigus commented 2 years ago

@jonnius : any news regarding it?

jonnius commented 2 years ago

It is still the same issue.

rinigus commented 2 years ago

To be clear, this is on UT device that used to have GPS fix before and wasn't reflashed? So, on UT, I open Pure Maps, get the fix, close it, wait a bit of time, and start Pure Maps again. On the second start, there is no estimate such as old fix coordinate available, "center on location" cannot center anywhere. Id that correct?

On start, Pure Maps writes "Acquired QGeoPositionInfoSource:" with the name of the plugin. I wonder what is that plugin in UT.

jonnius commented 2 years ago

Acquired QGeoPositionInfoSource: "ubuntu"

Correct. You don't get a position estimation based on the last fixed. You always need to wait for a new fix.

rinigus commented 2 years ago

Do you know why is it so? On SFOS, we have position cache and it is set to the last known location on new start. We also have MLS based fix if you install MLS offline datasets (as in https://openrepos.net/content/blacksheepdev/mls-manager). Sounds like nothing like it on UT.

Do you have a link to QGeoPositionInfoSource implementation of "ubuntu" plugin?