Navigation with Maps #6105
Replies: 1 comment
-
Posted at 2023-05-15 by @gfwilliams Yes, sorry about that, it's been something I have really been missing, and it's no my todo list but other things keep jumping in ahead. Basically I had a fork of Gadgetbridge which did it but in order to push the navigation images it changes some things I wasn't happy pushing back into the main repo immediately - but then it seems a lot of the message handling in Gadgetbridge got refactored and that broke all my changes - the same notification from Google maps got given a different ID every time it updated :( I was hoping we might have some success with https://codeberg.org/Freeyourgadget/Gadgetbridge/issues/2387 but while I thought that hooked into an OSMAnd API I think it actually required a special OSMAnd build - and it's not like many folks use that for navigation anyway! My current plan is just to add some code to parse the Google Maps notifications inside Gadgetbridge and pull out the needed information, then to push that to the Bangle. It should be relatively inoffensive and easy to contribute to Gadgetbridge - although it's likely to need contributions from non-english speaking countries to ensure it can parse the data correctly. Posted at 2023-05-19 by edb Actually that gadgetbridge OSMAnd branch should use the OSMAnd api, but they didn't like the binary distribution of it so they copied only the code they needed instead of using the library (there might be a point in that as it's 2MB) Posted at 2023-05-19 by @gfwilliams Ahh, interesting thanks! I didn't realise that was why - I wonder whether OSMAnd could slim down the API at all... I have just released a new Gadgetbridge on the Play store (as long as you've enabled testing at https://microcosm.app/out/6TE9i) and that has the Google Maps parser in. If you update your Bangle.js apps (Android and Messages UI) you should now find navigation works. Working out the directions is a little fraught as the only thing we can do is to look at the picture, so right now it only does straight, left and right - but if someone goes for a drive with navigation on and Gadgetbridge set to log to a file, it should be possible to dig out the other images it doesn't recognise and I can fix those up - I just haven't had a chance yet. Posted at 2023-05-19 by edb I think their pebble integration still works, that basically sends their voice output as pebble intents, so I guess that could still be used: That kind of works but only shows the route changes, what I did was make an small app with the OSMAnd api that converts the route updates to intents to be sent to the watch, so I can display the distance to the next turn + the one after that on the watch and buzz when the turn is imminent. This works quite ok for walking and biking, only seems to loose connection to OSM when you stand still for a while so you need to restart the app. Posted at 2023-05-19 by @halemmerich I have used the OsmAnd Pebble Integration by just filtering normal notifications in GadgetBridge. Watch buzzes with a new message whenever Osmand would have done some voice output. That worked well enough for walking around in areas with street name signs and when I had at least an rough idea of my route it even worked fine for biking. Normal OsmAnd notifications on the Bangle are completely useless as they are updated much too often (a notification every few meters). Posted at 2023-05-30 by stweedo I've been testing this out and there's a pretty big issue with how maps is sending the distance values when using imperial units. It will send the distance value to bangle.js in meters, which it's supposed to, until it gets to 0.1 miles at which point maps decides to send the distance value directly in feet instead. Now when the locale file on the bangle.js sees this new value in feet it still thinks it's working with meters and the distance becomes inaccurate as a result. I've tried getting the log data from gadgetbridge while using navigation, but it only showed one single nav message at the beginning of my drive with a distance of 0 and that's it. The navigation ran the whole trip on my phone and the watch so I don't know why there weren't more. I was also testing some formatting changes in the locale file to make it use one decimal place at less than 10 miles and convert to feet when less than 0.1 miles (this is about ~500ft or 152.4 meters which is when maps changes from miles to feet). This works great and makes the distances match exactly what is shown on the phone (except the bug with the units switching), but I'm thinking this may not be the right place for this code. Perhaps it would be better placed in the messagegui app and could be made compatible with all locales?
Posted at 2023-06-04 by Pringels This is great! I admit that when I first got my BangleJS 2 I was quite bummed out that navigation didn't work. I was really looking forward to cycling around town without having to check my phone for directions all the time. I'd be happy to go for a drive and log images Posted at 2023-06-05 by @gfwilliams That's great, thanks! @stweedo maybe you could take a screenshot of your phone's notification screen when it's showing the distance in feet? Does it just say something like Gadgetbridge parses the notification in https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3136/files#diff-3dacbc2d2b6a5f9fe4a6ea7f82994629bf3fb71a and right now it doesn't handle feet - tweaking it should be easy Posted at 2023-06-05 by stweedo Going from memory, but the phone will show ft starting at 500ft and decrement down 50ft until it reaches 0ft. On the bangle with the code snippet I posted above in my locale file, it will switch back to 0.3mi starting after 0.1 mi instead of switching to ft like on the the phone, then when it gets to 0.1mi on the watch again it switches to ft but at this point the phone will be at 150ft maybe . It is exactly 3.28084 times more than what it should be due to the meter->ft conversion. It's also worth mentioning there were some weird instances where it would read one less mile on the watch than the phone and at other times it would match perfectly, albeit with a slight delay in both cases. Posted at 2023-06-05 by @gfwilliams Well, I just added handling for 'ft' as a distance unit, so hopefully that one is solved (or will be when I push the next Play Store release) Posted at 2023-06-05 by stweedo Awesome! The navigation messages is a really nice feature to have for sure. Works so much better than having your phone open the whole time during a trip. I look forward to testing it out Posted at 2023-06-08 by stweedo I was able to test the navigation out using a nightly build with the newest fixes and the feet work correctly now except for a very minor rounding error where the watch will show 49ft instead of 50ft for example. Besides that it works very well now. The roundabout also works but will need to reflect which side of the road we drive on and maybe a little more dithering or removal of the opposite side of the roundabout that wasn't used to make it easier to distinguish the path. I also was able to grab some of the new icon images after I remembered to turn logging back on. I missed a few others before that.
A couple things I noticed:
Everything else seems to work great as far as I can tell. Attachments: Posted at 2023-06-09 by @gfwilliams Thanks! I'll try and get those added.
I think I fixed that this morning!
Yes, those would be great! Were you able to get icons for those? I'd have to add new enums in NavigationSpec for those but I guess that'd be easy enough.
It'd be great if you could drag some examples out of the logs and maybe we could use them for testing? But I'd imagine that just replacing all Posted at 2023-06-09 by stweedo
I didn't get the icons for the lane indicators but I did snag some screenshots on my phone. We'll have to scrape/parse this other icon container too. It's also used to display the turn coming up next I believe. For the names, an example I noticed was like this below where Main St flows into Centerpoint Dr after it divides into one way streets but it is also an alternate route for the interstate. So it's one road sharing names, most likely this is an edge case. Posted at 2023-06-09 by @gfwilliams Ok, just pushed some changes so it splits Gadgetbridge master now has the new icons in, but it was a bit too late to go in the testing release I put out today Posted at 2023-06-09 by stweedo Great, that was fast! There was just one other thing that may need to be implemented yet. Formatting the distance to match what maps shows. In my case it starts showing miles with 1 decimal place at less than 10 miles and switches to 500 feet after 0.1 miles. This is how the distance is currently formatted in the
And this is how it needs to be configured in my case for it to closer match the distance formatting of maps.
So we will need to figure out a way to properly format the distance values based on the users locale. Can this be added to the interface.html of locale? Posted at 2023-06-09 by stweedo Actually something like this would probably be better, but I still need to test it.
Posted at 2023-06-09 by @gfwilliams I feel like this is a bit of a non-issue. Why does that have to match the maps app exactly? It's still showing the same distance, just with different units in some cases? The problem is you'll change it for you for this one use-case in the US, but then for other locales they will have different rules - in fact there may be different rules for different countries on google maps too which we might have to emulate. And if you change it globally, it'll probably annoy some people. I mean, if I'm walking and logging my walk, probably I'd rather see the distance I've walked in feet up to around a mile? If after 0.1 mile it suddenly just changed to say So if you really think it matters, maybe we should file an issue with Gadgetbridge to see if they can just push the distance as a String, rather than an number? There hasn't even been an official release yet so that might be a more sensible option? Posted at 2023-06-09 by stweedo Yes, you're right. I completely understand that it will be different for everyone, and it's not an issue for me to maintain my own custom locale file either.
When I'm driving having the watch start showing feet at 1 mile is a little unusual, and they change in 0.1 mi increments because that is how maps sends it (presumably as 160.9344 meters?) until it reaches 500ft. Posted at 2023-06-09 by @gfwilliams Yes, it is a bit of a pain - as you say, custom locale might be the best idea for now. But I just realised that the only other navigation watch (PineTime) actually converts the number to a string (badly!) so I think having a string in the NavigationSpec is probably better, and would solve all these issues. I'll try and do a PR for it when I get a moment next week Posted at 2023-06-09 by stweedo Thanks, Gordon. And that does sound a lot simpler and eliminates the need to convert units, maintain settings, follow regional variances, as well as variations in whether you're walking, biking, driving, on the train/bus... Letting all of that be handled by maps itself seems to make the most sense in all cases. Posted at 2023-06-18 by Poolitzer Thanks for the quick implementation! Posted at 2023-06-18 by @thyttan Someone on reddit:
https://www.reddit.com/r/Banglejs/comments/14aojr5/google_maps_watch_buzzez_every_second/ Posted at 2023-06-19 by @gfwilliams Thanks - just answered there. Does anyone here see that kind of problem? I get the 'unread message' vibrations (I'll have a look at that) but otherwise nothing that would be considered 'a frenzy' Posted at 2023-06-19 by johan_m_o Before testing the new navigation mentioned in this thread I've had notifications off for my map app (Osmand+), since the constant updating of the navigation notification caused a constant number of notification events on the bangle.js. Must have been about a year since I tested that last though... Posted at 2023-06-19 by @gfwilliams I've just pushed some changes which attempt (in the dev app loader) to get rid of some of the annoying repeated buzzing in the messages app Posted at 2023-06-22 by stweedo The only thing I've noticed is Google maps is very persistent in sending new nav messages while using it, so messages always tries to open these up if you are on the clock or in the launcher. At one point I thought it was working where if you were actively using navigation you could tap on the display to transition back to the clock and it would stay there until you hit the flashing nav icon in the widget bar to get back to the nav message gui. Posted at 2023-06-22 by @gfwilliams
Yes, that is an annoying one. Just pushed a fix to the dev app loader Posted at 2023-07-01 by ShizzleOfNith I'm interested in using OsmAnd with the Bangle.js 2 but didn't get how you realized that. Could you please give me a hint how to enable the "OsmAnd Pebble Mode" with filtering normal notifications in Gadgetbridge? Are you able to explain that a bit more detailed? Posted at 2023-07-02 by @halemmerich I had just enabled the Pebble-messages and disabled normal notifications for OsmAnd in the GadgetBridge notification filters. But at least for the current Bangle.JS GadgetBridge nightly installed from FDroid this seems to be no longer needed. With the default Message UI app the navigation messages seem to be handled correctly via some kind of native OsmAnd integration. At least I see arrows and symbols for things like roundabouts when using navigation with OsmAnd. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2023-05-15 by Poolitzer
Hey there,
I was really looking forward to that feature, since I bicycle a lot in traffic and I can miss the navigation voice telling me where to go. Looking at the wiki, that's not implemented yet, I can't find a way to make it, probably due to changes missing in the android app. Just wanted to know if its still being worked on.
Beta Was this translation helpful? Give feedback.
All reactions