aerostitch / testnavit

0 stars 0 forks source link

roads joining at obtuse angle do not create navigation maneuver #43

Open aerostitch opened 14 years ago

aerostitch commented 14 years ago

Issue migrated from trac ticket # 660

component: core | priority: major | keywords: patches

2010-09-10 08:23:57: polarbear_n created the issue


I observed in several locations that a road joining another road in an obtuse angle is not recognised as a maneuver and therefore not announced.

While that might be ok as long as the roads have the same grade, even if they change name (since even straight roads might have differently named segments), but the following conditions should clearly trigger a maneuver announcement:

  • the roads have different Ref numbers, such as motorway M9 joining M7,

  • the road have different grades, such as a tertiary road joining a secondary

  • joining a road which is clearly not just a name change, i.e. coming from road A to road B, which is B both left and right of the junction.

The strangest situation I had observed in that context was joining a road (obtuse) in a slight right turn, which was followed by a sharp left 50 m further down. Since the obtuse right was not announced, it was already announcing the sharp left, which apparently was impossibe and misleading.

aerostitch commented 10 years ago

2014-11-04 13:26:09: @mvglasow uploaded file trac660_r5917.patch (13.3 KiB)

Refine criteria for ambiguous maneuvers (fix for Emeryville test case), third try

aerostitch commented 10 years ago

2014-11-04 13:41:52: @mvglasow commented


New incarnation of the patch, which fixes case 3. The "always announce entering a ramp" rule has been restricted to apply only when all possible ways are motorway-like or ramps (indicating a potential labyrinth of ramps), or when the maneuver involves a turn (25° or more). Otherwise entering a ramp follows the same criteria as entering any other street.

I ran my test suite against the updated code, and I did see that some unexpected or unneeded maneuvers which 5917 would still generate disappear with the latest patch applied.

Binaries are at the same locations (replacing the old ones):

aerostitch commented 10 years ago

2014-11-08 07:16:53: @mvglasow commented


Committed in 5929. All that's left to do for now is handling turn restrictions... turns out this is the trickiest part of it all.

aerostitch commented 10 years ago

2014-11-08 15:46:10: @mvglasow commented


A test suite (script and data) can be found at https://github.com/mvglasow/navit-goodies/tree/master/scripts/routetest. It'll run a suite of test routes against two different git branches, export the routes as GPX and diff them.

Today in the chat I had a discussion with jandegr and tryagain if we should announce turns where they are the only option. We reached the conclusion that turns should be announced when there is a "straighter" road which we can't enter.

A clear-cut test case for this is Via_Graf 9.1439748 45.5133242 9.1391345 45.5146592

As of 5929, the right turn from Via Graf into Via Fratelli Antona Traversi is not announced because Via Graf is one way in the opposite direction after that point, thus the right turn is the only option. On the other hand, not announcing this maneuver might confuse drivers. I'll implement this.

aerostitch commented 10 years ago

2014-11-08 16:19:09: @mvglasow commented


Some more thoughts on the turn restrictions case – the test case is: Langwieder_See 11.457781 48.1648526 11.4120844 48.1983823

In the motorway ramp I am getting an announcement to go straight at the point where the two ramps going on and off the motorway join into one road. The announcement probably results from the special handling I've introduced for ramps. The reason for this were complex motorway interchanges where drivers will probably want guidance at every split.

It turns out that handling turn restrictions is extremely complex – tryagain and I spent a whole day trying to get this to work, but to no avail. Additionally, such a step is likely to be performance hungry.

I am considering an alternative: further relax the "always announce ramps" criterion so that it only applies when the route and at least one other option have a delta of less than 90°. Since on motorway interchanges the delta between two ramps is significantly lower than 90° for any allowed turn, a turn of more than 90° is likely prohibited and in any case is not what drivers would do unless instructed to do so.

aerostitch commented 10 years ago

2014-11-08 17:44:24: @mvglasow commented


Updates:

  • 5932 is a mostly cosmetic fix to use curve_limit in a more consistent manner (I'd previously introduced another threshold of 22° in the code, using one consistent value is better)
  • 5933 moves up the "always announce sharp turns over 75°" rule so that it applies even when all other options are not allowed. This fixes the issue with Via_Graf.
aerostitch commented 10 years ago

2014-11-09 06:32:22: @mvglasow commented


5934 fixes the Langwieder_See test case using the approach I described above. Additionally it fixes a regression I'd introduced in 5933 (basically an experimental change that I ended up not needing bot forgot to undo). Tests reveal it eliminates a few other unneeded maneuvers at ramps.

Anyone who'd like to thest this build under real-life conditions is welcome. If you find an important announcement is missing, or an unnecessary announcement is made, please share a route to reproduce and the point at which you encountered the error.

If no further issues are found, I'll close this ticket soon.

aerostitch commented 10 years ago

2014-11-09 09:58:42: @mvglasow commented


I've found some problematic test cases:

Werder_W 12.8770471 52.3098972 12.7570371 52.3411968
Hamburg_Sued_S 10.073060 53.508260 10.037430 53.498250
Nuernberg_N 11.1956694 49.4085208 11.2825354 49.4965279

All have one thing in common: these are motorway interchanges where one way is mapped as highway=motorway, the others are mapped as highway=motorway_link. That makes them look to Navit like regular exits, and if the route follows the highway=motorway, nothing is announced.

Hamburg_Sued_S is the textbook example for this.

At Werder_W the name of the motorway changes at the interchange, just where the ramp leaves the motorway. This can probably be fixed by looking for a name change.

Nuernberg_N is also a special case as the ramp goes off to the left. If Navit "knows" whether the territory we're in drives on the left or on the right, we could have Navit create an announcement whenever the ramp leaves the motorway on the "wrong" side. This would have side effects only where there are actual exits on the "wrong" side.

aerostitch commented 10 years ago

2014-11-09 09:58:42: @mvglasow

aerostitch commented 10 years ago

2014-11-09 12:01:09: @mvglasow commented


5935 fixes the Werder_W test case.

aerostitch commented 10 years ago

2014-11-09 14:21:39: @mvglasow commented


On Nuernberg_N and ramps on the "wrong" side: It seems Navit does not know what side of the road a particular territory drives on. The code that generates the appropriate roundabout icons uses the direction of the roundabout itself to tell if we go around it clockwise or counterclockwise.

Another idea I had was analyzing the number of lanes: Both at Hamburg_Sued_S and at Nuernberg_N the ramps have two lanes. Note that busy stretches of motorway in urban areas may occasionally have exits with 2 lanes (e.g. A9 just north of Munich), thus some more magic is required. A rule that might give us quite good accuracy would be "if the ramp has at least 2 lanes and at least as many as the motorway, assume an interchange".

The only problem is that, for all I can tell, Navit currently does not have any information on lanes in its binfile maps.

Thus, in order to solve those two cases, we'd need to

  • introduce an attribute for the number of lanes
  • adapt maptool to process the lanes=* tag in OSM data
  • implement the above logic

To get an announcement, one would need to use a map generated with an updated version of maptool.

aerostitch commented 10 years ago

2014-11-17 00:54:18: @jandegr commented


Is it something like this what the above posts are about ?[[Image(https://dl.dropboxusercontent.com/u/93775123/Navit/Capture10.JPG)]]

aerostitch commented 10 years ago

2014-11-17 00:54:18: @jandegr

aerostitch commented 10 years ago

2014-11-17 04:18:47: @mvglasow commented


I assume you mean this one: http://www.openstreetmap.org/node/271855166#map=14&layers=Q

Yes, this is the kind of problematic interchange that I meant.

As long as the route takes you on the ramp, everything's fine (current SVN can easily detect that this maneuver needs to be announced because the route goes from motorway to ramp).

However, in many (if not all) situations it is desirable to have an announcement for the main lane as well – and here lanes are our best guess.

aerostitch commented 7 years ago

2017-12-02 04:08:44: @jkoan

aerostitch commented 7 years ago

2017-12-02 04:08:44: @jkoan commented


This ticket was pushed back in order to bring 0.5.1 out soon.