mapbox / mapbox-navigation-android

Mapbox Navigation SDK for Android
https://docs.mapbox.com/android/navigation/overview/
Other
622 stars 319 forks source link

Replay route with rounded corners #3018

Open kmadsen opened 4 years ago

kmadsen commented 4 years ago

The new ReplayRouteMapper detects road edges with significant turns. The current route interpolator identifies corners, this ticket is to turn those corners into curves.

B-spines in mapbox-java

Why is this needed

Right now the simulated driver stays on route, and takes an early turn. The early turn also has an impact on reducing reroutes. As our enhanced location gets better, we will also need to improve the simulated driver or it will have more reroutes.

Screen Shot 2020-05-22 at 7 35 24 AM

Nav native consideration

The enhanced location may want to smooth route edges. This could create a better experience for in ride navigation. cc: @mskurydin

kmadsen commented 4 years ago

Also interesting read from https://www.win.tue.nl/~vanwijk/zoompan.pdf#page=5

kmadsen commented 4 years ago

Created a notebook that tests the approach I had in mind for resolving this

https://observablehq.com/@kmadsen/path-curves

kmadsen commented 4 years ago

It would be nice to add the bezier curves to mapbox-java. Reference to turf's spline https://github.com/Turfjs/turf/blob/master/packages/turf-bezier-spline/lib/spline.ts

kmadsen commented 4 years ago

Spent some time on the weekend trying to figure this out. I can build routes with curved intersections, but haven't figured out how to interpolate speeds across them yet.

Progress on this branch https://github.com/mapbox/mapbox-navigation-android/compare/km-add-route-bender?expand=1 Screen Shot 2020-09-21 at 3 25 22 PM

kmadsen commented 2 years ago

I have a working prototype for this.

Screen Shot 2022-05-13 at 11 44 10 PM