Locus Map - forum

Development => Developers => Topic started by: abrensch on April 09, 2016, 16:16:20

Title: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: abrensch on April 09, 2016, 16:16:20
Hi Menion,

I'm working on providing map-based voice-hints from BRouter in order to have a more precice voice-guiding.

My understanding is that I can simply carry them along with the GPX, either imported explicitly into Locus or requested via BRouter's aidl-interface. Howver, I failed to get any vital sign from Locus actually using my hints.

I tried the simple syntax with the <wpt>-Tag:

<wpt lon="8.615649" lat="49.695896">
  <name>right</name>
  <sym>Right</sym>
  <type>Right</type>
</wpt>

as well as a version with locus specific extensios ( <extensions><locus:rtePointAction> ...), but with no success.

Any hint what I have to write into the GPX in order to hear my own voice-hints while navigating with Locus?

thanx in advance, Arndt
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: Menion on April 09, 2016, 21:40:30
Good day Arndt,

I think that best option is to create really simple track in Locus with some navigation commands and then export it into GPX file. You may then check difference compare to you own solution. Anyway solution with <extension> should work after import in all cases. Also you may attach any file that do not work here and I'll tell you where is a problem.
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: abrensch on April 10, 2016, 15:13:43
Quote from: menion on April 09, 2016, 21:40:30Anyway solution with <extension> should work after import in all cases.

Thanks Menion,

now it works for me when I manually import the GPX Track. The waypoints look like:

  <wpt lon="8.608944" lat="49.674370">
     <name>right</name>
     <extensions>
        <locus:rteDistance>292.0</locus:rteDistance>
        <locus:rtePointAction>7</locus:rtePointAction>
     </extensions>
  </wpt>

Everything fine, I am hearing MY waypóints in MY lamnguage - perfect.

However, it does not work when I initiate the GPX-calculation via Locus. When I select the "calculate instruictions" checkbox, I hear the locus-generated waypoints, and when I do not select it, I get nother type of display (guiding?) amd yet another style of voice messages, which are also no my ones.

See the discussion here:

https://groups.google.com/d/msg/osm-android-bikerouting/1ZRP9qzn3-k/pgQw3s2xAgAJ

Can you confirm that you always ignore the waypoints when reading a GPX from BRouter's AIDL-Interface?
It there a quick solution or do we need a software change?

thanx, Arndt
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: Menion on April 11, 2016, 07:53:05
Good day abrensch,

also from a post in a discussion group, may I understand that you are a part of development team behind BRouter and wants to extend it? Finally :).

So as I read, main problem is format, how to exchange some data, right? My opinion is, that BRouter should be the one, who define format. Other apps may use it if wants. So I see some option like "export for OsmAnd, export for Locus, ..." quite crazy.

Also there is no universal format for this task. TCX format may include some instructions, but is quite limited = useless. GPX by default do not have any extension for this case. So I really suggest to create own extension to GPX format with all information you may provide. I'll gladly, as well as other app developers, adapt it to own applications.

Anyway if you will wants to use format I use in Locus, less work for me, anyway it's not clear solution I think. Locus is app who wants something, so it should adapt to BRouter format, not opposite (in this case of course, when we do not have any universal format).

About "ignoring waypoints". It is quite possible. Locus by default do not merge them into track. If you may provide me some beta version, I'll fix it of course. Let me know ... I'm here at your service!

EDIT: ehm, sorry. I finally looked on your name Arndt. I'm sorry, we already talked about BRouter long time ago, so I didn't recognized you immediately.
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: tommi on April 11, 2016, 22:06:25
Menion, wouldn't the format of data which Graphhopper exchanges with Locus perfectly match the needs for integration of BRouter?
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: Menion on April 11, 2016, 22:16:39
I do not know what format are you talking about. GraphHopper add-on use Java objects (classes) for exchange, not any readable format.
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: tommi on April 12, 2016, 14:20:55
Well then these Java objects are the "data format" which are used to exchange information.
But maybe you are in direct contact with Arndt and have already found a solution with him.
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: poutnikl on April 12, 2016, 15:37:15
Arndt has mentioned in Brouter Google group idea of advanced hints info in the GPX comments.

https://groups.google.com/forum/#!topic/osm-android-bikerouting/1ZRP9qzn3-k (https://groups.google.com/forum/#!topic/osm-android-bikerouting/1ZRP9qzn3-k)



Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: abrensch on May 06, 2016, 14:18:18
Quote from: menion on April 11, 2016, 07:53:05
Anyway if you will wants to use format I use in Locus, less work for me, anyway it's not clear solution I think.

Hi Menion,

sorry for the long delay, but here's what I came up with.

You can use the latest version (1.4.) of BRouter from it's homepage (not yet on Google Play):

http://brouter.de/brouter/revisions.html

use the apk there'in, and also update the routing profiles (they are not automatically overwritten by an APK update. Simplest way is to just delete the "profiles2" directory, it will be re-created on next brouter app start)

After careful consideration, I decided to go with the native turn-instruction formats used by Locus and OsmAnd.

3 ways to generate an GPX, so 3 ways to make sure that Locus format is used:

- when creating a GPX via the BRouter app, nothing special to do. The profiles are configured to "turnInstructionMode = 1 = auto, which means it generates Locus format when using a Locus waypoint-database.

- when creating the GPX by requesting it via the AIDL interface, you must send an additional parameter
  "turnInstructionFormat" with value "locus".(Just the same way you are sending "lons" and "lats", but with a String value)

- when creating a GPX via the Web-Interface ( http://brouter.de/brouter-web/ ) you have to modify the profile to contain turnInstructionMode = 2 (use the "upload" button the upload the modified profile)

I tested the voice hints by manuelly importing them into Locus, and that works fine. So I really wold like to be able to use them also when using BRourer via the AIDL-Interface...

What you have to change for that is:

- send turnInstructionFormat = locus as secribed above

- evaluate the locus extensions containing the turn-instructions the same way you do it when importing with "merge waypoints into track"

What you should also do is look at a bug I encountered when using the "roundabout" hints:
the first instruction after a roundabout that is not a roundabout is announced as the last roundabouts exit count ("third exit") instead of the actual next instruction ("turn left").

Thanks in advance for looking into this,

regards, Arndt

Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: Menion on May 09, 2016, 18:34:26
hello @abrensch,

no problem with delay, I was just little worried to make this working till next Locus version. Anyway I'm really glad you made a decision. No matter if native formats or now ... decision :)

Let's finish method with direct compute over Locus (AIDL):
- first smaller problem in Locus - waypoints before track. Fixed

- second issue are roundabouts. You use method where is only a single navigation command at start of roundabout. For this is needed to include "Simple roundabout (https://bitbucket.org/asamm/locus-api/src/45d6ea6319dc356a3c929fcf3a0608a8a63e0f9f/src/locus/api/objects/extra/ExtraData.java?at=default&fileviewer=file-view-default#ExtraData.java-296)" parameter to track.

This may be done by two options.

1. improve your export to GPX as in attached track_modif.gpx file (compare to orginal). Probably best solution as it will improve all GPX files from BRouter to Locus

2. I may setup this in Locus, but it will then work only over AIDL

3. my recommended solution ... this about option to place also second waypoint on place where user should exit the roundabout. In case of huge rounabout, this second command has also a send as Locus then correctly inform about place where to really exit.

So I suggest to make solution no. 1 as soon as possible and later think about 3. option.

Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: abrensch on May 09, 2016, 22:22:30
Quote from: menion on May 09, 2016, 18:34:26So I suggest to make solution no. 1 as soon as possible and later think about 3. option.

Thanx Menion,

so I implemented solution no. 1 and uploaded revision 1.4.1, see http://brouter.de/brouter/revisions.html

I test-drived it and it really solves my issue with roundabout-announcements.

I will look at the extended roundabout announcements later.

I will upload version 1.4.1 to google play shortly if I do not get any alarms.

looking forward for the new locus release :-)

regards, Arndt
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: Menion on May 09, 2016, 23:10:19
Perfect, thanks!


I have one more questions for You if possible. Can you imagine, that request over AIDL should contains also a name of file with "profile"? Because I can imagine UI selection of profile directly in Locus. There is a lot of people who make a nice profiles and with this improvements (generated commands), I'm more and more thinking how to get your tool to people in some "more usable form". Or is this a total nonsense and you need to map profiles only over app itself (or file)?
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: abrensch on May 09, 2016, 23:32:55
Quote from: menion on May 09, 2016, 23:10:19
I have one more questions for You if possible. Can you imagine, that request over AIDL should contains also a name of file with "profile"? Because I can imagine UI selection of profile directly in Locus.

Sure no problem. But 2 API Extension would be two-fold:

- request to get all availabe profiles
- parameter to select profile by name

I would not favor an API that sends net data of profile directly (or absolute path to it somewhere on sd-card), because the tight coupling between brouter software and profile would raise compatibilty issues.

However, if you want that for the next release you would have to give me 3 days...

ragards, Arndt
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: Menion on May 09, 2016, 23:40:24
Nono, it's not needed to next release. It will take also some time on my side, so no hurry.

For me, it's not a problem to accept whatever method will be best for you. Request on all profiles and name of profile, or just name of profile that Locus get directly from brouter/profile directory, or maybe a full content of profile file as parameter ( which should be most useful from my point of view as it may allow to include some special profiles directly into app/assets and send them just over AIDL). But what is and what isn't possible, you know it. Thanks for consideration!
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: Christian on May 10, 2016, 15:27:40
Quote from: abrensch on May 09, 2016, 23:32:55
- request to get all availabe profiles
- parameter to select profile by name
That would be nice! We can use any profile located in brouter directory even these not mapped in Locus.
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: Andrew Heard on May 11, 2016, 01:15:41
it would be brilliant
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: zossebart on May 11, 2016, 08:32:06
This feature would be great! I always have a hard time to remember the profile mappings.
Also, I typically have more profiles (variants, e.g. for bad weather) in use than  the 5 "slots" that are available and changing the mapping by means of the brouter standalone app is too cumbersome when on a trip.
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: Menion on May 11, 2016, 12:20:34
No need to comment this topic guys. Better selection (mapping) for profiles is wanted from my side for a long time. How this will be done, is another thing. From my point of view, best should be option to post a code for a routing profile directly over API, so Locus then should offer some internal profiles + profiles stored in BRouter directory. Same as with map themes.

Anyway it all depend now on time of @abrensch ;).
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: poutnikl on May 11, 2016, 18:34:20
There is the related suggestion I have raised in Brouter Github page as an issue 50 (https://github.com/abrensch/brouter/issues/50), I was suggesting implementation of ALIAS a/o CUSTOM Brouter navigation modes.

As direct addressing of profiles is now considered ( Arndt originally hesitated to expose profiles), it may be now obsolete. 

So, just for your information.
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: Paketenwerfer on January 22, 2022, 12:39:33
This feature stopped working in Locus Map Pro some time in 2020. Since then it only offers turn instructions according to the shape of the track, which is useless.
I sometimes want to create a route with brouter-web with Locus-style turn instructions and I'd like Locus to actually say them. That was the most useful feature for me.
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: 0709 on January 23, 2022, 11:21:20
Still works as usual and correctly. See attachment: Laarne - 2.5km.gpx
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: Paketenwerfer on January 23, 2022, 21:40:03
Quote from: 0709 on January 23, 2022, 11:21:20
Still works as usual and correctly. See attachment: Laarne - 2.5km.gpx
I just found out there is Locus Map 4, which is something else than Locus Map Pro (3). Two versions in parallel  :-\
It works in Locus Map 4. But it have never found that feature in 3 since 2020, which worked fine until then. Just makes it very complicated.
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: 0709 on January 23, 2022, 23:35:10
Works in Locus Pro.  V3.56.5 . You checked set Merge points at import dialog ?
Title: Re: Navigation-Instructions in GPX-Format (BRouter-Interface) ?
Post by: Paketenwerfer on January 24, 2022, 22:10:03
Thanks!
'Merge points with imported track' does the trick. I've been searching for so long!
Works now in Locus Map 3.