-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Native Router #4791
Native Router #4791
Conversation
...n-router/src/main/java/com/mapbox/navigation/route/internal/offboard/MapboxOffboardRouter.kt
Show resolved
Hide resolved
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterWrapper.kt
Outdated
Show resolved
Hide resolved
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterMapper.kt
Outdated
Show resolved
Hide resolved
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterWrapper.kt
Outdated
Show resolved
Hide resolved
aad83d5
to
1900612
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vanmaxim just double-checking, does Nav Native respect the Common SDK OfflineSwitch
and the connectivity listener it's tied to?
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterWrapper.kt
Outdated
Show resolved
Hide resolved
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterWrapper.kt
Outdated
Show resolved
Hide resolved
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterWrapper.kt
Outdated
Show resolved
Hide resolved
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterWrapper.kt
Outdated
Show resolved
Hide resolved
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterWrapper.kt
Outdated
Show resolved
Hide resolved
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterWrapper.kt
Outdated
Show resolved
Hide resolved
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterWrapper.kt
Outdated
Show resolved
Hide resolved
@LukasPaczos The hybrid router doesn't use the connectivity manager right now - it makes 2 requests in parallel, and if the online one fails, it uses the results from the onboard router. |
But since the HTTP client from Common SDK does respect the offline switch, then the resulting behavior will be correct after all 👍 We might just possibly log unnecessary errors or warnings for that failed HTTP request. Should we adjust Nav Native to respect the offline switch? Also, should we make the fallback requests sequential instead of parallel? We are trading the speed of the fallback response for some CPU usage, do you think it's worth it when most of the fallback requests will never be used? Not saying it's bad behavior, just wanted to get your opinion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation LGTM to me in general but there seems to be one bug where onboard requests cannot be canceled:
request_not_canceled.mp4
This uses the IndependentRouteGenerationActivity
which does integrate cancellation of previous route requests whenever a new one is scheduled. We should see only the second route but we see both because the first request couldn't be canceled.
This works correctly when the connection is available and offboard router is used but doesn't when the onboard router is used.
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterWrapper.kt
Outdated
Show resolved
Hide resolved
@LukasPaczos it's NN bug, right? |
Yes, looks like it. |
@LukasPaczos @korshaknn could you file a ticket for on-board router with more details? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took this for a quick spin and for me when disabling connectivity I always get Route request failed.
It seems Onboard
is not currently working 🤔
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterWrapper.kt
Show resolved
Hide resolved
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterWrapper.kt
Show resolved
Hide resolved
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterWrapper.kt
Outdated
Show resolved
Hide resolved
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterWrapper.kt
Outdated
Show resolved
Hide resolved
72e7878
to
45cbf7e
Compare
Could you check what response the on-board router returns and file an issue? Wondering if the tiles are in place (the output of tilestore contents with |
@Guardiola31337 checked with |
45cbf7e
to
076a6e2
Compare
Setup wise, what's different between |
Noting that I re-tested |
there is a bug on NN side. Onboard router requests can not be cancelled. |
This is Proguard (
|
libnavigation-router/src/test/java/com/mapbox/navigation/route/internal/BaseTest.kt
Outdated
Show resolved
Hide resolved
...ts/src/androidTest/java/com/mapbox/navigation/instrumentation_tests/core/RouteRefreshTest.kt
Outdated
Show resolved
Hide resolved
...ts/src/androidTest/java/com/mapbox/navigation/instrumentation_tests/core/RouteRefreshTest.kt
Outdated
Show resolved
Hide resolved
eda07e6
to
7871dfe
Compare
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterWrapper.kt
Outdated
Show resolved
Hide resolved
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterWrapper.kt
Show resolved
Hide resolved
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterWrapper.kt
Outdated
Show resolved
Hide resolved
libnavigation-router/src/test/java/com/mapbox/navigation/route/internal/RouterWrapperTests.kt
Outdated
Show resolved
Hide resolved
@Guardiola31337 @LukasPaczos @kmadsen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the feedback @korshaknn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -0,0 +1 @@ | |||
{"availableVersions":["2021_10_15-03_00_00","2021_10_09-03_00_00","2021_10_03-03_00_00","2021_09_17-03_00_00","2021_09_12-03_00_00","2021_09_05-03_00_00","2021_09_04-03_00_00","2021_08_23-14_04_46","2021_08_23-03_00_00","2021_08_21-03_00_00","2021_08_16-03_00_00","2021_08_08-03_00_00","2021_07_31-03_00_00","2021_07_25-03_00_00","2021_07_17-03_00_00","2021_07_10-03_00_00","2021_07_04-03_00_00","2021_06_27-03_00_00","2021_06_20-03_00_00","2021_06_13-03_00_00","2021_06_06-03_00_00","2021_06_05-03_00_00","2021_05_30-03_00_00","2021_05_23-03_00_00","2021_05_16-03_00_00","2021_05_09-03_00_00","2021_05_01-03_00_00","2021_04_26-03_00_00","2021_04_25-03_00_00","2021_04_18-03_00_00"],"metadata":{"2021_10_15-03_00_00":{"map":{"tileset_version":"2021_10_15-03_00_00"}},"2021_10_09-03_00_00":{"map":{"tileset_version":"2021_10_09-03_00_00"}},"2021_10_03-03_00_00":{"map":{"tileset_version":"2021_10_03-03_00_00"}},"2021_09_17-03_00_00":{"map":{"tileset_version":"2021_09_17-03_00_00"}},"2021_09_12-03_00_00":{"map":{"tileset_version":"2021_09_12-03_00_00"}},"2021_09_05-03_00_00":{"map":{"tileset_version":"2021_09_05-03_00_00"}},"2021_09_04-03_00_00":{"map":{"tileset_version":"2021_09_04-03_00_00"}},"2021_08_23-14_04_46":{"map":{}},"2021_08_23-03_00_00":{"map":{}},"2021_08_21-03_00_00":{"map":{}},"2021_08_16-03_00_00":{"map":{}},"2021_08_08-03_00_00":{"map":{}},"2021_07_31-03_00_00":{"map":{}},"2021_07_25-03_00_00":{"map":{}},"2021_07_17-03_00_00":{"map":{}},"2021_07_10-03_00_00":{"map":{}},"2021_07_04-03_00_00":{"map":{}},"2021_06_27-03_00_00":{"map":{}},"2021_06_20-03_00_00":{"map":{}},"2021_06_13-03_00_00":{"map":{}},"2021_06_06-03_00_00":{"map":{}},"2021_06_05-03_00_00":{"map":{}},"2021_05_30-03_00_00":{"map":{}},"2021_05_23-03_00_00":{"map":{}},"2021_05_16-03_00_00":{"map":{}},"2021_05_09-03_00_00":{"map":{}},"2021_05_01-03_00_00":{"map":{}},"2021_04_26-03_00_00":{"map":{}},"2021_04_25-03_00_00":{"map":{}},"2021_04_18-03_00_00":{"map":{}}}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will we need to keep updating this file? Do we need to mock it in general? We are not mocking routing tiles request (yet), so why do we need to mock the routing tiles version requests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to update it, we mock it to prevent mockWebServer exception
throw Error(
"""Request url:
|${request.path}
|is not handled.
|
|Available handlers:
|$formattedHandlersBuilder
""".trimMargin()
)
We are not mocking routing tiles request (yet), so why do we need to mock the routing tiles version requests?
not 100% sure, looks like because version request made by NN and tiles request by common (Tilestore).
I mocked it because of the mockWebServer exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, since we redirect everything localhost, the onboard router will probably always fail because it has no tiles. This shouldn't impact the test as long as the device doesn't go offline.
libnavigation-router/src/main/java/com/mapbox/navigation/route/internal/RouterWrapper.kt
Outdated
Show resolved
Hide resolved
83d202b
to
0d26dec
Compare
|
0d26dec
to
4dd92fa
Compare
@Guardiola31337 fixed |
There are still some random test failures 👀
Same as #5036 (comment) cc @mskurydin
Refs. #4791 (comment) |
I've fixed alternatives parsing (routeRequest instead of a route) and moved util fun to base module. |
55822d3
to
735eb2e
Compare
735eb2e
to
f41eff5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the feedback @korshaknn
Going ahead and merging here in preparation for the upcoming release 🚀 Hope you don't mind @korshaknn |
Description
This PR removes platform side hybrid/onboard/offboard routers and adds RouterWrapper object. RouterWrapper translates router requests and route refresh requests to NavNative using
RouterInterface
.refresh tests are blocked with RoutingProfile issue
Screenshots or Gifs