Skip to content
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

Expose list of key points leading up to the enhanced location update #2452

Merged
merged 11 commits into from
Feb 12, 2020

Conversation

LukasPaczos
Copy link

This PR exposes an additional list of points as part of LocationObserver#onEnhancedLocationChanged. When available, this list created out of a route-snapped target and intermediate points leading up to it. This way, in UI components we can interpolate the puck's position along the route's geometry.

Before:
ezgif com-optimize (9)

After:
ezgif com-optimize (10)

This is based on changes from the Maps SDK - mapbox/mapbox-gl-native-android#166.

We can merge whenever a new Nav Native snapshot is released (and bumped here) with both key_points and uncertain state changes.

@LukasPaczos LukasPaczos requested review from korshaknn and a team February 6, 2020 18:22
@LukasPaczos LukasPaczos force-pushed the lp-location-key-points branch 2 times, most recently from 26e9f22 to 390d1f7 Compare February 6, 2020 19:07
@Guardiola31337
Copy link
Contributor

Took this for a spin and run into the following native 💥 crash when testing SimpleMapboxNavigationKt

02-07 13:52:34.407 4216-5779/com.mapbox.navigation.examples A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 5779 (Worker 1)
02-07 13:52:34.509 195-195/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-07 13:52:34.509 195-195/? A/DEBUG: Build fingerprint: 'google/hammerhead/hammerhead:6.0.1/M4B30Z/3437181:user/release-keys'
02-07 13:52:34.509 195-195/? A/DEBUG: Revision: '11'
02-07 13:52:34.509 195-195/? A/DEBUG: ABI: 'arm'
02-07 13:52:34.509 195-195/? A/DEBUG: pid: 4216, tid: 5779, name: Worker 1  >>> com.mapbox.navigation.examples <<<
02-07 13:52:34.510 195-195/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
02-07 13:52:34.559 195-195/? A/DEBUG: Abort message: '/usr/local/google/buildbot/src/android/ndk-release-r20/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:73: abort_message: assertion "terminating" failed'
02-07 13:52:34.559 195-195/? A/DEBUG:     r0 00000000  r1 00001693  r2 00000006  r3 995e1978
02-07 13:52:34.559 195-195/? A/DEBUG:     r4 995e1980  r5 995e1930  r6 00000000  r7 0000010c
02-07 13:52:34.560 195-195/? A/DEBUG:     r8 995e1868  r9 9713a500  sl ffffff56  fp 00000000
02-07 13:52:34.560 195-195/? A/DEBUG:     ip 00000006  sp 995e12a8  lr b6c6cb61  pc b6c6ef50  cpsr 40070010
02-07 13:52:34.581 195-195/? A/DEBUG: backtrace:
02-07 13:52:34.581 195-195/? A/DEBUG:     #00 pc 00041f50  /system/lib/libc.so (tgkill+12)
02-07 13:52:34.581 195-195/? A/DEBUG:     #01 pc 0003fb5d  /system/lib/libc.so (pthread_kill+32)
02-07 13:52:34.581 195-195/? A/DEBUG:     #02 pc 0001c30f  /system/lib/libc.so (raise+10)
02-07 13:52:34.581 195-195/? A/DEBUG:     #03 pc 000194c1  /system/lib/libc.so (__libc_android_abort+34)
02-07 13:52:34.581 195-195/? A/DEBUG:     #04 pc 000174ac  /system/lib/libc.so (abort+4)
02-07 13:52:34.581 195-195/? A/DEBUG:     #05 pc 0001af23  /system/lib/libc.so (__libc_fatal+16)
02-07 13:52:34.582 195-195/? A/DEBUG:     #06 pc 00019549  /system/lib/libc.so (__assert2+20)
02-07 13:52:34.582 195-195/? A/DEBUG:     #07 pc 00216215  /data/app/com.mapbox.navigation.examples-1/lib/arm/libmapbox-gl.so
02-07 13:52:34.582 195-195/? A/DEBUG:     #08 pc 0021629b  /data/app/com.mapbox.navigation.examples-1/lib/arm/libmapbox-gl.so
02-07 13:52:34.582 195-195/? A/DEBUG:     #09 pc 00214a61  /data/app/com.mapbox.navigation.examples-1/lib/arm/libmapbox-gl.so
02-07 13:52:34.582 195-195/? A/DEBUG:     #10 pc 002149f9  /data/app/com.mapbox.navigation.examples-1/lib/arm/libmapbox-gl.so (_ZSt9terminatev+28)
02-07 13:52:34.582 195-195/? A/DEBUG:     #11 pc 00213e2f  /data/app/com.mapbox.navigation.examples-1/lib/arm/libmapbox-gl.so (_ZNSt6__ndk16threadD2Ev+10)
02-07 13:52:34.583 195-195/? A/DEBUG:     #12 pc 0008d3b1  /data/app/com.mapbox.navigation.examples-1/lib/arm/libmapbox-gl.so
02-07 13:52:34.583 195-195/? A/DEBUG:     #13 pc 0020f84d  /data/app/com.mapbox.navigation.examples-1/lib/arm/libmapbox-gl.so
02-07 13:52:34.583 195-195/? A/DEBUG:     #14 pc 0004a817  /data/app/com.mapbox.navigation.examples-1/lib/arm/libmapbox-gl.so
02-07 13:52:34.583 195-195/? A/DEBUG:     #15 pc 000e4f6d  /data/app/com.mapbox.navigation.examples-1/lib/arm/libmapbox-gl.so
02-07 13:52:34.583 195-195/? A/DEBUG:     #16 pc 000e4f8d  /data/app/com.mapbox.navigation.examples-1/lib/arm/libmapbox-gl.so
02-07 13:52:34.583 195-195/? A/DEBUG:     #17 pc 0020f84d  /data/app/com.mapbox.navigation.examples-1/lib/arm/libmapbox-gl.so
02-07 13:52:34.583 195-195/? A/DEBUG:     #18 pc 0004a817  /data/app/com.mapbox.navigation.examples-1/lib/arm/libmapbox-gl.so
02-07 13:52:34.583 195-195/? A/DEBUG:     #19 pc 000e531f  /data/app/com.mapbox.navigation.examples-1/lib/arm/libmapbox-gl.so
02-07 13:52:34.583 195-195/? A/DEBUG:     #20 pc 0010ce47  /data/app/com.mapbox.navigation.examples-1/lib/arm/libmapbox-gl.so
02-07 13:52:34.583 195-195/? A/DEBUG:     #21 pc 0003f45f  /system/lib/libc.so (_ZL15__pthread_startPv+30)
02-07 13:52:34.583 195-195/? A/DEBUG:     #22 pc 00019b43  /system/lib/libc.so (__start_thread+6)

This is pretty reproducible as soon as location updates start coming in (puck moves) and when long press (requesting a route). Maybe because changes brought from Maps 9.0.0-20200206.150107-26 👇?

This is based on changes from the Maps SDK - mapbox/mapbox-gl-native-android#166.

I also run into the following leak 👇

simple_mapbox_navigation_kt_location_engine_callback_leak

cc @kmadsen @LukasPaczos @mskurydin @SiarheiFedartsou @zugaldia

@zugaldia
Copy link
Member

zugaldia commented Feb 7, 2020

02-07 13:52:34.559 195-195/? A/DEBUG: Abort message: '/usr/local/google/buildbot/src/android/ndk-release-r20/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:73: abort_message: assertion "terminating" failed'

That seems similar to mapbox/mapbox-gl-native#16180.

Guardiola31337 added a commit to mapbox/mapbox-gl-native-android that referenced this pull request Feb 7, 2020
Guardiola31337 added a commit to mapbox/mapbox-gl-native-android that referenced this pull request Feb 7, 2020
@Guardiola31337
Copy link
Contributor

Can't reproduce the crash in #2452 (comment) anymore with 3ab6921 but after updating to either ms-mm-fixes-SNAPSHOT-1 or master-SNAPSHOT-0 (latest changes from NN) and cherry-picked cc381e3 and fe790bb the puck is flying over to the Antarctica back and forth 👀

puck_flying_over_antarctica_back_and_forth

It seems a regression introduced when bringing the different NN changes into master. Any ideas why this could happen @mskurydin @SiarheiFedartsou?

cc @kmadsen @langsmith @mskurydin @LukasPaczos @andrewychen @Aurora-Boreal

@Aurora-Boreal
Copy link

Next steps here as follows:

Plan A: NN team to fix issue.
Plan B: Roll back to last known good version.

@SiarheiFedartsou
Copy link
Contributor

SiarheiFedartsou commented Feb 8, 2020

@Guardiola31337 maybe it is because of fix of our previous bug when we messed up longitude/latitude in key points. @LukasPaczos knows the details. He applied workaround for it on your side just by swapping Lon/lat

@mskurydin
Copy link
Member

Double checked what we return in status.location (first point in a row) and status.key_points (the rest in a row). Note, there are some places where there are no key points - these are the statuses when we are in free driving and doing the map-matching - corner interpolation doesn't work for free driving (it needs a different algorithm at the moment). The longtitude and latitude order is the same. And also no aspects of it were changed in the latest snapshot from yesterday.

[139.7511749,35.6593323],[139.7511749,35.6593323],
[139.7511749,35.6593323],[139.7511749,35.6593323],
[139.7511749,35.6593323],[139.7511749,35.6593323],
[139.7511749,35.6593323],[139.7511749,35.6593323],
[139.7511749,35.6593323],[139.7511749,35.6593323],
[139.7511292,35.6593399],[139.7511292,35.6593399],
[139.7510529,35.6593475],[139.7511139,35.6593399],[139.7510529,35.6593475],
[139.7509918,35.6593590],[139.7509918,35.6593590],
[139.7509308,35.6593666],[139.7509308,35.6593666],
[139.7508698,35.6593781],[139.7509003,35.6593704],[139.7508698,35.6593781],
[139.7508240,35.6593857],[139.7508240,35.6593857],
[139.7507172,35.6593246],[139.7507629,35.6593971],[139.7507172,35.6593246],

As for travelling back and forth between DC and Antarctica - it's a lon/lat swap. During the very first PoC for corner interpolation our code had a bag where lon/lat were swapped. Lukas pointed this out and we fixed it in our next snapshot. There is a chance though this warkaround was left by accident in the android code.

Anyway, the numbers I show are printed in the order of X (lon), Y (lat) [this order is prevailing everywhere on the backend] from the statuses we return to our clients.

image

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [
          -77.025146484375,
          38.950865400919994
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [
          38.950865400919994,
          -77.025146484375
          
        ]
      }
    }
    
  ]
}

@Guardiola31337
Copy link
Contributor

Follow up addressing above-mentioned issues in #2458

@zugaldia
Copy link
Member

@Guardiola31337 Is this PR still a draft, or is it ready for review?

@Guardiola31337
Copy link
Contributor

@zugaldia

Is this PR still a draft, or is it ready for review?

This could be probably ready for review (although I cannot change the Draft as I didn't open the PR).

In any case, #2458 needs to be merged first and also we're using a SNAPSHOT from Maps

mapboxMapSdk : '9.0.0-20200207.215725-27',
👀 mapbox/mapbox-gl-native-android#166

cc @LukasPaczos

LukasPaczos pushed a commit to mapbox/mapbox-gl-native-android that referenced this pull request Feb 11, 2020
@LukasPaczos
Copy link
Author

also we're using a SNAPSHOT from Maps

mapbox/mapbox-gl-native-android#166 has been merged, but let's keep using the 9.1.0-SNAPSHOT (after mapbox/mapbox-gl-native-android#170 lands) and let the changes go through a full QA cycle instead of rushing it into the release that's happening in the next few days.

Guardiola31337 added a commit that referenced this pull request Feb 11, 2020
* make configure router http interface parameter nullable

* add nn uncertain route state

* expose nn cache last route api in mapbox navigator

* remove lat long workaround not needed anymore as nn master-SNAPSHOT-0 includes the fix

* bump mapbox-navigation-native version to ms-bearing-from-shape-on-interpolation-SNAPSHOT-2
Łukasz Paczos and others added 9 commits February 11, 2020 18:14
* make configure router http interface parameter nullable

* add nn uncertain route state

* expose nn cache last route api in mapbox navigator

* remove lat long workaround not needed anymore as nn master-SNAPSHOT-0 includes the fix

* bump mapbox-navigation-native version to ms-bearing-from-shape-on-interpolation-SNAPSHOT-2
@LukasPaczos LukasPaczos marked this pull request as ready for review February 12, 2020 14:27
@LukasPaczos
Copy link
Author

All the features and test changes have landed, this is ready for a review.

Changes in this PR include:

  • The optional list of keyPoints provided alongside location updates that describe intermediate animation points.
  • UNCERTAIN Nav Native state that lets us update the UI accordingly when we're unsure of the position and couldn't or shouldn't map match the location.
  • Updates the HTTP clients to use the callback system.

@codecov-io
Copy link

Codecov Report

Merging #2452 into master will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master    #2452   +/-   ##
=========================================
  Coverage     32.29%   32.29%           
  Complexity      621      621           
=========================================
  Files           143      143           
  Lines          5605     5605           
  Branches        434      434           
=========================================
  Hits           1810     1810           
  Misses         3595     3595           
  Partials        200      200

Copy link
Contributor

@Guardiola31337 Guardiola31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @LukasPaczos 🚀

Left some minor comments / questions.

Copy link
Contributor

@Guardiola31337 Guardiola31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still experiencing the leak mentioned in #2452 (comment) 👀

simple_mapbox_navigation_kt_leak

simple_mapbox_navigation_kt_leak_report

Also unrelated to this PR but note the flashing behavior when switching routes ☝️

Other than that this looks good to me.

Thanks for addressing the feedback @LukasPaczos

@Guardiola31337
Copy link
Contributor

@LukasPaczos Going to cut a ticket to investigate the leak above-mentioned #2452 (review) and merge here to unblock @kmadsen

@Guardiola31337
Copy link
Contributor

Going to cut a ticket to investigate the leak above-mentioned #2452 (review)

Follow up ticket 👉 #2472

@Guardiola31337
Copy link
Contributor

Also unrelated to this PR but note the flashing behavior when switching routes ☝️

Follow up ticket 👉 #2473

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants