osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.67k stars 1.02k forks source link

Android Auto: movement direction map orientation is flipped and jiggles #16041

Closed ZeLonewolf closed 1 year ago

ZeLonewolf commented 1 year ago

Description

When using Android Auto, driving south in map direction mode, the map is upside down and rocks back and forth.

Your Environment

Samsung Galaxy S22+ 2022 Chevrolet Spark Android Auto Android v13

Live video while sitting at a stop sign

https://user-images.githubusercontent.com/3254090/209214066-36741312-e9fa-4c39-8685-7307866c0fe0.mp4

I also have a longer video of it happening while moving forward.

vshcherb commented 1 year ago

Looked at short video, some things need to be clarified:

  1. Is it the latest 4.3 version?
  2. Car was moving in opposite direction than suggested route?
  3. What was map orientation mode?

It's also not clear whether the car was moving or standing still. We have quite a big refactoring how to handle when the car stands still, so we disabled map rotation to compass which was enabled with low speed.

sonora commented 1 year ago

Also: We have the Kalman filter (Menu button > Configure profile > General settings > Use Kalman filter) to mitigate such situations. But from the look of things it may already be activated?

ZeLonewolf commented 1 year ago

Here is a longer video of it happening: https://youtu.be/BJ66l2WTtA4

In both videos, I'm driving along the planned route, but the orientation is flipped from the expected. In the short video, I'm stopped at a red light and in the video here I'm driving down the road.

Version info

Driving mode settings

vshcherb commented 1 year ago

It looks totally wrong indeed it makes sense to try switch other settings but you need to do it in a car profile

sonora commented 1 year ago

Could also be the device orientation is detected wrong for this setup: Test the fixed device orientations "Portrait" and "Landscape" rather than "Same as device" under Menu button > Settings > Screen orientation (this is a different setting than the Map orientation).

(We once had a support ticket with a rather non-standard hardware (a camera) where the device x-, y-, and z-axis were left-handed.)

Zirochkabila commented 1 year ago

OsmAnd~ 4.4.0#14059mqta, released: 2022-12-29 @ZeLonewolf As you can see in the video - it could not be reproduced. Try to set the profile settings to default: Menu > Configure profile > Reset to default or do as wrote about it @vshcherb and @sonora

https://user-images.githubusercontent.com/104760013/209995953-2709a368-103c-4095-afde-026596732750.mov

ZeLonewolf commented 1 year ago

Thanks - I will run some more tests with the settings described here once I'm back from vacation.

nicosensei commented 1 year ago

I'm having the same issue, reached out to support and was directed to this issue ticket.

I'll try the workarounds but I have little confidence it will work, because car orientation is properly detected on the app, i.e. this issue happens only when connected to my car through Android Auto.

Here's my device I fo:

Device : vayu Brand : POCO Model : M2102J20SG Product : vayu_global Build : SKQ1.211006.001 release-keys Version : 12 App Version : OsmAnd+ Apk Version : 4.3.4 4304

sonora commented 1 year ago

Watching the available movies, it seems to me the issue occurs only if you do not follow the calculated route but instead go the opposite direction? Or is that an artifact, and the blue arrow is actually pointing wrong?

Also: It somehow reminds of #16081, have you tried with both "Animation" settings disabled?

ZeLonewolf commented 1 year ago

It occurs when following the calculated route, and the blue arrow is point wrong. I'll try to make a longer video today.

sonora commented 1 year ago

Has anybody tried my hint to use the fixed device orientations "Portrait" and "Landscape" rather than "Same as device" under Menu button > Settings > Screen orientation (this is a different setting than the Map orientation)?

ZeLonewolf commented 1 year ago

Has anybody tried my hint to use the fixed device orientations "Portrait" and "Landscape" rather than "Same as device" under Menu button > Settings > Screen orientation (this is a different setting than the Map orientation)?

I've tried changing the device to used the fixed orientation mode of "landscape". This changes the orientation on the phone but does not appear to impact the behavior on the auto display.

ZeLonewolf commented 1 year ago

Sorry for the delay, below are some video sequences that I captured earlier in the month.

Jan 3: (default settings) https://www.youtube.com/watch?v=lH4niDcWVnc https://www.youtube.com/watch?v=I8tiHduXsIc https://www.youtube.com/watch?v=43se_kzs5hw https://www.youtube.com/watch?v=Qy__8fhHkYs

Jan 4: (landscape mode enabled) https://www.youtube.com/watch?v=PIqZW6J37kM

sonora commented 1 year ago

It reminds me of this story #2131, where we had the weird occurrence that the device in question (in your case the car screen) had a non-standard internal coordinate system and hence OsmAnd interpreted some orientation-related directions falsely.

In e.g. video 1 it seems that the left hand edge of the car screen is assumed to be the top edge, therefore the blue position arrow always points towards it (in orientation mode "Movement direction" the arrow always point towards the top of the device). But the map, at the same time, seems to follow a different rotation logic, that's why the blue arrow direction contradicts with the underlying street orientation.

"Sign error", I would say. Unfortunately I would have a hard time debugging because I have no way of testing AA, so I am hoping someone else can take a look.

BTW: Maybe I missed your response: "have you tried with both "Animation" settings disabled?", just to check if this is in the animation or more fundamental code portion.

ZeLonewolf commented 1 year ago

I'm planning to run a test this evening.

I see two settings:

I guess it makes sense to try one at a time?

sonora commented 1 year ago

Yes, exactly thanks! Anything would help to locate which code portion would need checking.

Also: I understand the issue is limited to using Map orientation= Movement direction? If you set it to e.g. "Fixed (North is up)", you see no such anomalies?

ZeLonewolf commented 1 year ago

If you set it to e.g. "Fixed (North is up)", you see no such anomalies?

That's a good question. I would never navigate with the map set to fixed north! :sweat_smile: But I can certainly try it in the interest of science.

Zirochkabila commented 1 year ago

OsmAnd~ 4.4.0#14092mqta, released: 2023-01-13 We managed to reproduce a similar behavior when Simulating location by GPX (navigation didn't start)

https://user-images.githubusercontent.com/104760013/212315637-82c2e1b5-2d69-4b79-9fc1-4d3039d3a826.mov

vshcherb commented 1 year ago

Track doesn't have heading / bearing provided so it looks like we could "auto generate " heading in this case.

sonora commented 1 year ago

@vshcherb Do I understand it correctly that the original issue reported here is not a general issue affecting all users, but is specific to this particluar hardware setup? In other words, the vast majority of users use Androind Auto in mode "Movement orientation" without such issue, and as a consequence we are not looking for a general glitch in our code, but rather for something which only occurs in certain environments or under certain circumstances?

vshcherb commented 1 year ago

it's not clear yet but very likely it's a rare case & device specific.

ZeLonewolf commented 1 year ago

Here is a video I took a few days ago:

https://www.youtube.com/watch?v=apUTdMWmsWw

For this, I used the settings:

ZeLonewolf commented 1 year ago

Note that in my original tests, the behavior in https://github.com/osmandapp/OsmAnd/issues/16041#issuecomment-1381759456 was exactly what I saw.

sonora commented 1 year ago

Thanks for the new video! We can conclude that

It does not look like merely a false coordinate system.... more like the magnetic sensor or some similar slow-changing effect is in play here... or a bearing value is submitted which confuses the output.

alex-osm commented 1 year ago

There is a topic at Android Auto Help Center. May be this issue is related to AA itself. I would suggest to update Android Auto app and Google Play Services on the phone and probably update car multimedia system as well.

alex-osm commented 1 year ago

Other thing is try to change Location Source

ZeLonewolf commented 1 year ago

That linked Android Auto issue sounds different from what I'm experiencing - the position does not fly around to random locations, and Google Maps navigation works normally with no artifacts.

sonora commented 1 year ago

@vshcherb I don't understand why we still have one open Issue each in the milestones 4.3-android and 4.3-backend, which are both closed? An oversight? Shouldn't the Issues be transferred to 4.4?

vshcherb commented 1 year ago

nope yet, 4.3.9 still be done, that's under control.

vshcherb commented 1 year ago

Setting was added (we're discussing whether it's advanced development option or should be default or should be device dependent)

ZeLonewolf commented 1 year ago

Not sure I understand the final disposition - this bug will occur by default unless a special setting is enabled?

vshcherb commented 1 year ago

With this setting enabled you should not have bug with bearing incorrectly produced by device

dmpr0 commented 1 year ago

Doc team We need to mention in Android Auto article about new option Approximate bearing