How to get roll, pitch and yaw of a device

Hi.

Does anyone know how to get roll, pitch and yaw of a device with Corona SDK ?

iOS has deviceMotion.attitude of CMMotionManager for the purpose.
Does Corona support it? Looks like there’s no such APIs.

I tried to calculate them with rotation rates of gyroscope, but the result was very bad.
The rotation rates were noisy even if my iphone was not moved.

Have a nice day! [import]uid: 25490 topic_id: 17107 reply_id: 317107[/import]

I think something here is lost in translation.

If the device has an attitude, I don’t want to know about it :wink:

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 17107 reply_id: 64391[/import]

Hi, JayantV.

I think my choice of word “attitude” may not be good.
I changed my question a little.

Thank you for your comment. [import]uid: 25490 topic_id: 17107 reply_id: 64594[/import]

Please, I’d like to push this question again. I’m having the same problem: reading the gyroscope produces poor results.

The suggested code is:
local deltaXRadians = event.xRotation * event.deltaTime
local deltaXDegrees = deltaXRadians * (180 / math.pi)

However, there is noise in the system. I’ve read of a “complementary filter” as a way to reduce this, but don’t know what the function is.

Help? [import]uid: 37366 topic_id: 17107 reply_id: 74499[/import]