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

iOS and Android results decimal #26

Closed
lefoy opened this issue Jul 3, 2017 · 7 comments
Closed

iOS and Android results decimal #26

lefoy opened this issue Jul 3, 2017 · 7 comments
Labels

Comments

@lefoy
Copy link

lefoy commented Jul 3, 2017

The X and Y axis doesn't share the same decimals on Android and iOS. This is fairly simple to handle outside of the plugin but I feel like this should be handled by the plugin.

Also the Z axis doesn't return the same values on Android and iOS, but I don't think this is an issue with this plugin.

Android

Object {x: -0.1454315185546875, y: -0.1233978271484375, z: 9.813604736328125}
Object {x: -0.1454315185546875, y: -0.1233978271484375, z: 9.813604736328125}
Object {x: -0.14489898681640626, y: -0.12292327880859374, z: 9.813818359375}

iOS

Object {x: 0.00493927001953125, y: 0.01236572265625, z: -1.0119964599609375}
Object {x: 0.00518798828125, y: 0.01222076416015625, z: -1.01226806640625}
Object {x: 0.0051116943359375, y: 0.0124603271484375, z: -1.0126296997070312}

Thank you!

@DanielMSchmidt
Copy link
Member

Hey, I would be happy to see a PR for that 👍

@lefoy
Copy link
Author

lefoy commented Jul 4, 2017

I ended up using another plugin because I needed the magnetometer. I probably won't have time to work on that sorry.

@ringcrl
Copy link

ringcrl commented Jan 11, 2018

@efoy What another plugin did you used?

@lefoy
Copy link
Author

lefoy commented Jan 11, 2018

@ringcrl I used a slightly modified version of https://github.com/pwmckenna/react-native-motion-manager

@stale
Copy link

stale bot commented Mar 27, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 27, 2018
@stale stale bot closed this as completed Apr 3, 2018
@lihue
Copy link

lihue commented Jan 14, 2019

Please note that the values reported by the accelerometers in iOS are measured in increments of the gravitational acceleration, with the value 1.0 representing an acceleration of 9.8 meters per second. See https://developer.apple.com/documentation/coremotion/getting_raw_accelerometer_events for more details.

@deLTreeTech
Copy link

deLTreeTech commented Jan 20, 2021

Thanks @lihue . This really save my time.

I just did this to remedy the challenge.

const az = accelerometer.aZ * (Platform.OS === 'ios' ? 9.8 : 1);

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

No branches or pull requests

5 participants