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

Roll sensor value jumps from 0 to ~ 2*pi on iPhone 8 when the phone lays flat. #6

Open
FrankenApps opened this issue Aug 25, 2019 · 0 comments

Comments

@FrankenApps
Copy link

FrankenApps commented Aug 25, 2019

I have used this library on android (emulator and real device without any problems), however on the iPhone 8 (physical device) the roll sensor value jumps from 0 to approximately 2*pi or 6.28... when the phone lays flat.
Whereas on android it changes from 1 to 0 to -1 for example, when i rotate the device.
I think, the library should give consistent results on android and iOS.
I would prefer it the android way. In the meantime I use this workaraound:

if(Platform.isIOS){
  if(event.roll < (-1)*pi){
    sensorValue = 2*pi+event.roll;
  } 
  else{         
    sensorValue = event.roll;
  }
} 
else{
  sensorValue = event.roll;     //roll in radians for android 
}
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

No branches or pull requests

1 participant