osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.73k stars 1.03k forks source link

Position Icon Orientation Stuck During Navigation #21067

Open Dollarius opened 1 month ago

Dollarius commented 1 month ago

Description

When in (cycling) navigation mode, the orientation of the position icon gets stuck to a random angle (blue arrow in the following screenshots taken while moving): image

This usually happens a few kilometres AFTER starting the navigation. My usual use scenario is:

  1. Set navigation
  2. Turn screen OFF and ride for a while
  3. Manually turn screen ON to check that I am following the correct route
  4. Turn screen OFF again

I noticed that for the first few kilometres (when the icon works correctly), the elevation widget restarts from 0km every time I turn the phone screen back ON. Once the icon is stuck, it stays stuck forever unless the navigation is ended, after which it re-orients correctly.

Steps to reproduce

  1. Set navigation on a gpx route
  2. The position icon correctly rotates following the direction of motion
  3. Screen OFF
  4. Ride for a while
  5. Screen back ON
  6. The position icon is frozen in a random orientation

This bug possibly started 1-2 months ago, when the following options were introduced

Actual result

The position icon is frozen to a certain orientation.

Expected result

The position icon should rotate following the direction of motion.

Your Environment (required)

Possibly important settings:

OsmAnd Version: 4.9.0#3398m, released 2024-10-09
Android/iOS version: Android 14
Device model: Samsung Galaxy S23
yuriiurshuliak commented 1 month ago

The bug could not be reproduced. For testing, I used the bicycle profile, enabled map orientation as North is Up, and turned on 3D Relief, Hillshade, Contour lines at Zoom 13, and Weather. I also added the Elevation profile widget at the bottom of the screen. Then selected a GPX track for navigation in portrait mode, enabled simulated navigation, and repeatedly turned the phone screen off and on manually during the route.

Throughout the test, the position icon continued to follow the navigation and rotated correctly in the direction of travel after turning the screen back on.

To help us better reproduce the issue, could you please share your bicycle profile settings by exporting them via Menu → Settings → Export, and attach the file here? Additionally, we need the GPX track you're using for navigation.

OsmAnd~ 4.9.0#3487m, released: 2024-10-17

https://github.com/user-attachments/assets/3ecbf5f2-3125-45e2-bd4f-c04eae4859d3

Dollarius commented 1 month ago

Thanks for looking into this. The arrow correctly follows the direction of motion for the first 10-15km, only after that it gets stuck. It happened with many different GPX files, but please find attached the one used in my example, along with my exported cycling settings. StuckPositionArrow.zip

P.S. I just noticed that someone reported a similar issue, though in my case I am manually turning the screen ON/OFF. https://github.com/osmandapp/OsmAnd/issues/20858

yuriiurshuliak commented 1 month ago

The bug was not reproduced. I used your profile settings and GPX track, and during navigation, I followed the track for an extended period while turning the screen off and on. The position icon continued to follow the navigation and correctly rotated in the direction of route when the screen was turned back on.

Please try testing with our nightly build: https://osmand.net/docs/versions/nightly_versions#nightly-builds

OsmAnd~ 4.9.0#3518m, released: 2024-10-22

https://github.com/user-attachments/assets/1fbd3a19-71d8-4d51-833f-dfe9a2606cb1

vshcherb commented 1 month ago

It could happen during route recalculation, what's strange that orientation is stuck not in the north position, probably it's stuck in the previous known position as we implemented for the car and current orientation is unknown.