Framstag / libosmscout

Libosmscout is a C++ library for offline map rendering, routing and location lookup based on OpenStreetMap data
Other
256 stars 79 forks source link

Routing instructions with complex junction #1165

Open Karry opened 2 years ago

Karry commented 2 years ago

When some junction is mapped in detail, routing instructions may be misleading.

For example this junction in Prague:

Screenshot_20211203_235939

when routing from the north to south-east, routing just generates "name change" instructions, but user would expect "turn left" at least.

./Demos/Routing  czech-republic 50.10355 14.53185 50.06029 14.55739
...
----------------------------------------------------
     At| After|  Time| After|
----------------------------------------------------
  0.0km         0:00h        Start at 'Start'
                             Drive along highway_primary 'Průmyslová (601)'
  3.7km  0.0km  0:04h  0:00h Way changes name from 'Průmyslová (601)' to 'unnamed road'
  3.8km  0.0km  0:04h  0:00h Way changes name from 'unnamed road' to 'Černokostelecká (333)'
  4.3km  0.0km  0:05h  0:00h Way changes name from 'Černokostelecká (333)' to 'Kutnohorská (333)'
  5.6km  0.0km  0:06h  0:00h Pass: Frolík & Rataj
  5.7km         0:06h        Target reached 'Target'
Karry commented 1 year ago

Testing other routing engines:

Framstag commented 1 year ago

I see a few suboptimal descriptions in our solution:

The principle problem is that we do not have a junction explicitly mapped. There is no tag "junction". We could write a post processor that tries to take some heuristics to detect junction and set a state, that could be used by another postprocessor to clean up or change behavior. But such a state machine can make things worse if state is calculated wrongly, and especially not resetted correctly. Think of a few junctions in a row or similar...

What would be the ideal description you would expect or find helpful?

Karry commented 1 year ago

Hi Tim. Do you have any experience with machine learning? I'm considering that some kind of ML would be able to generate instructions for such complex junctions. I just chat about this possibility with ChatGPT, it was fun ;-) It is wrong in some aspects (like suggesting proprietary software when I was asking for open-source libraries), but it provides me some hints...

Framstag commented 1 year ago

I've read a book a few years ago about (classical) machine learning, which uses mathematical approached for data categorization. I have also implemented a italian card card application years ago and tried to use a neuronal network to train a computer opponent. I however failed after a few days because I did not get the neural network stable. There was always the idea to come back and use a library for the low level stuff and concentrate on the handling of input, lerning and replay. I never had time :-/

AFAIK for training a neural network you need:

The question in the concrete context is first: What should it learn? What exactly is the problem?

The concrete problem: Where do you get (much) training material and how do you know what is right and wrong? If you are google and have traffic information (you know how people drive over the crossing) the would be a way. But what would the system learn from it? If I give it the entry to the crossing and the exit of the crossing and the form of the crossing it might learn how people would drive through the crossing (and how not). But is this the problem to solve? You must also be aware, that the solution of the system might not match to actual crossing it is just the generalized behaviour for crossing that look alike.

Looks like the ChatGPT answer is similar (but not that specific to the concrete problem). I would take another appoach as described above. I would try to find a generalize image-like description of crossing with start and end point and possible hint points or similar. Trainig data would offer actual car navigation tracks. The system then have to "guess" the tracks from "new" material with given, start, end and hint points.

I do not think a decision tree would be helpful, but of course might be in error.

For general navigation information you "just" teach the KI how people drive on a given road and through given turns with given parameter (max speed, state of the road, angles...) and it is able to reproduce this information. If you a driving races on streets this might be (very) helpful but for a more general use!?

Do not trust ChatGPT. It is just the statistical most relevant answer of the internet. I assume most people on the internet have no good idea of KI, so likely you will also not get the best answer. IMHO ChatGPT does not "know" it just has a feeling for how likely the sentence will continue.

Just my 2 cents and ideas :-)

Karry commented 1 year ago

What exactly is the problem?

I don't want to improve routing now. It works good enough. I "just" want to get better route description with voice commands. And better voice commands for car navigation may be just beginning. Once I saw video with proprietary app for navigation of blind people (or with eye defect) in the cities. It was amazing how good this navigation was describing environment around... There is no such open-source app AFAIK.

How to get training data? We may start with random junctions and current voice instructions that we generate. Then we may improve learning data manually (correct instructions)...

Karry commented 2 months ago

I will just store bookmark here... Paper solving similar problem (instructions for pedestrians) with graph neural network: https://typeset.io/papers/generating-landmark-navigation-instructions-from-maps-as-a-1bm3wvbrcd