mapbox-navigation-android icon indicating copy to clipboard operation
mapbox-navigation-android copied to clipboard

NN Reroute Controller

Open RingerJK opened this issue 2 years ago • 6 comments

Description

Native reroute controller

Changes

  • Removed:
    • MapboxRerouteController.
  • Added:
    • MapboxRerouteControllerFacade wraps native RerouteControllerInterface to use via platform;
    • NativeRerouteControllerWrapper extend native RerouteControllerInterface and extend it with platform's required API: setRerouteCallbackListener, setRerouteOptionsAdapter;
    • RerouteControllerAdapter adapts customer's NavigationRerouteController to native implementation;
    • RerouteControllersManager handles what set of sdk's and native reroute controllers can work together. For instance, when the default native reroute controller is running it must work together with the internal platform reroute controller.
  • Added RerouteActivity to qa-app module.
    • 2 modes: simulate and not;
    • 3 types of reroute controllers: internal(default), external(property works for simulate work only), and disabled.

RingerJK avatar Aug 08 '22 10:08 RingerJK

Codecov Report

Merging #6131 (9bc938b) into main (14b8460) will decrease coverage by 0.01%. The diff coverage is n/a.

:exclamation: Current head 9bc938b differs from pull request most recent head 90e7a1f. Consider uploading reports for the commit 90e7a1f to get more accurate results

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #6131      +/-   ##
============================================
- Coverage     68.86%   68.85%   -0.02%     
+ Complexity     4521     4453      -68     
============================================
  Files           683      668      -15     
  Lines         27068    26690     -378     
  Branches       3171     3147      -24     
============================================
- Hits          18641    18378     -263     
+ Misses         7208     7104     -104     
+ Partials       1219     1208      -11     
Impacted Files Coverage Δ
...om/mapbox/navigation/dropin/NavigationViewModel.kt 0.00% <0.00%> (-69.24%) :arrow_down:
...ternal/extensions/NavigationViewContextFlowable.kt 0.00% <0.00%> (-62.50%) :arrow_down:
...app/internal/controller/LocationStateController.kt 65.21% <0.00%> (-20.50%) :arrow_down:
.../navigation/ui/maneuver/view/MapboxManeuverView.kt 62.85% <0.00%> (-13.02%) :arrow_down:
.../ui/maneuver/view/MapboxUpcomingManeuverAdapter.kt 68.29% <0.00%> (-12.09%) :arrow_down:
.../mapbox/navigation/dropin/NavigationViewContext.kt 54.05% <0.00%> (-9.11%) :arrow_down:
...igation/dropin/component/camera/CameraComponent.kt 82.30% <0.00%> (-4.07%) :arrow_down:
...n/ui/maps/internal/ui/CameraModeButtonComponent.kt 63.63% <0.00%> (-3.04%) :arrow_down:
...ion/ui/maps/internal/ui/RecenterButtonComponent.kt 81.81% <0.00%> (-1.52%) :arrow_down:
...gation/ui/maps/building/view/MapboxBuildingView.kt 63.33% <0.00%> (-1.19%) :arrow_down:
... and 72 more

codecov[bot] avatar Aug 09 '22 15:08 codecov[bot]

Just a note to check if native reroute controller supports recently introduced logic: https://github.com/mapbox/mapbox-navigation-android/pull/6164

VysotskiVadim avatar Aug 16 '22 09:08 VysotskiVadim

Just a note to check if native reroute controller supports recently introduced logic: #6164

@DenisPryt could you have a look

RingerJK avatar Aug 17 '22 11:08 RingerJK

I noticed, that moving logic from platform implementation to native implementation increased size of platform solution by ~4k lines of code. Did we expect that reusing some logic between platforms can make SDK more complex? 🤔 cc @mapbox/navigation-android

VysotskiVadim avatar Sep 15 '22 12:09 VysotskiVadim

I noticed, that moving logic from platform implementation to native implementation increased size of platform solution by ~4k lines of code. Did we expect that reusing some logic between platforms can make SDK more complex? 🤔 cc @mapbox/navigation-android

I see that at least 4000 of added lines in this PR are JSON files, which are used for testing.

Zayankovsky avatar Sep 29 '22 09:09 Zayankovsky

@DenisPryt , where do you create Directions API request for getting a new route from Directions API? Is that RerouteDetectorWorker::makeRerouteRequestUri?

If so, I noticed some difference in added parameters between NN implementation(which adjust only waypoints and avoid dangerous manoeuvre parameter) and Android route options updater which adjust more parameters. Did I miss something or there are some missed cases in NN?

VysotskiVadim avatar Oct 12 '22 10:10 VysotskiVadim

The PR was declined, because of Nav SDK v3, where the API will be refactored

RingerJK avatar Feb 06 '23 10:02 RingerJK