Gyroscope offset

Is it possible to get just a raw Gyroscope data? I don’t need delta rotation, I just need an offset relative to gravity (like in portrait orientation my device rotated to 15 degrees to right, relatively to the gravity,  and I need to get that 15 degrees as variable). 

Thx. 

  1. Have you examined the sample that comes with the simulator?

You can build that and install it on your device and see if the values you get are what you need.

  1. Whatever the case, you’ll probably need to do some math to convert the values to what you need.  The values don’t come out in degrees.

https://docs.coronalabs.com/api/event/gyroscope/index.html

radians to degrees calc required>>> https://docs.coronalabs.com/api/event/gyroscope/xRotation.html#gotchas

Note: A gyroscope by (as determined by the physics of the concept) is designed to measure torque which is then translated to changes in rotation over time, not orientation of the device held in a static position.

Please build and install the sample ‘Gyroscope’ that comes with the simulator, then modify it to display in degrees and I think you’ll be fine to convert/use it from there.

It occurs to me, that you may actually be thinking of the kind of output that the accelerometer gives.

Try the accelerometer example too as that may be more suitable to your needs:

https://docs.coronalabs.com/api/event/accelerometer/index.html

>>> https://docs.coronalabs.com/api/event/accelerometer/xGravity.html#gotchas

  1. Have you examined the sample that comes with the simulator?

You can build that and install it on your device and see if the values you get are what you need.

  1. Whatever the case, you’ll probably need to do some math to convert the values to what you need.  The values don’t come out in degrees.

https://docs.coronalabs.com/api/event/gyroscope/index.html

radians to degrees calc required>>> https://docs.coronalabs.com/api/event/gyroscope/xRotation.html#gotchas

Note: A gyroscope by (as determined by the physics of the concept) is designed to measure torque which is then translated to changes in rotation over time, not orientation of the device held in a static position.

Please build and install the sample ‘Gyroscope’ that comes with the simulator, then modify it to display in degrees and I think you’ll be fine to convert/use it from there.

It occurs to me, that you may actually be thinking of the kind of output that the accelerometer gives.

Try the accelerometer example too as that may be more suitable to your needs:

https://docs.coronalabs.com/api/event/accelerometer/index.html

>>> https://docs.coronalabs.com/api/event/accelerometer/xGravity.html#gotchas