dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.04k stars 1.73k forks source link

Sensors - OrientationSensor, Accelerometer - result NAN #17666

Open TiDaGo opened 1 year ago

TiDaGo commented 1 year ago

Description

I use simple code

OrientationSensor.Default.ReadingChanged += Orientation_ReadingChanged;
OrientationSensor.Default.Start(SensorSpeed.Game);

private void Compass_ReadingChanged(object sender, CompassChangedEventArgs e)
{
  if(e.Reading.Orientation.W == float.NaN || e.Reading.Orientation.X == float.NaN || e.Reading.Orientation.Y == float.NaN)
  {
    throw new Exception("DATAM");
  }
}

May appear after 5 - 10 minutes of continuous operation.

Accelerometer - too

Steps to Reproduce

  1. Create MAUI application
  2. Add code
  3. Use Android physical device.

Link to public reproduction project repository

No response

Version with bug

7.0.92

Is this a regression from previous behavior?

No test

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 12

Did you find any workaround?

No response

Relevant log output

image

samhouts commented 1 year ago

When you say it used to work in MAUI, do you mean in .NET 6 or in a previous version of .NET 7? Thanks!

ghost commented 1 year ago

Hi @TiDaGo. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

TiDaGo commented 1 year ago

When you say it used to work in MAUI, do you mean in .NET 6 or in a previous version of .NET 7? Thanks!

Yup ) wrong information. im not try in other versions. Sorry.