Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Issue with gyroscope — Gideros Forum

Issue with gyroscope

joelghilljoelghill Member
edited July 2012 in Bugs and issues
Hello,

I am attempting to learn how to incorporate te gyroscope for player control in a project of mine. I've encountered an issue that I cannot resolve on my own, and I'm wondering if anyone here has a solution.

For the most part it is working fine. I am using the rads/second from the gyroscope in combination with the event.deltaTime to calculate the degrees at which the phone is tilted on the x and y axis. This works well, however I've noticed that the y axis seems to be more sensitive in one direction of rotation than the other. Each time I tilt the phone on that axis, and then lay it back down on a flat surface, the angle in the y axis is incorrect. Eventually it thinks the phone is at an extreme angle.

Has anyone encountered this problem before? I'm running this on a Samsung Galaxy S2.

Attached the code in case anyone wants to take a look.

Thanks.
Tagged:

Comments

  • @joelghill Please attach the gideros files, I can't really tell you much with the compiled .jet files :)

    I haven't personally ran into the issue on my Droid X, but then again when I run your code and it did nothing on my Droid X. Have you tried using the Accelerometer example that comes with Gideros Studio and seeing if you have the same issue with it?

    (I am assuming you mean the Accelorometer, not the gyroscope, but if I am mistaken please let me know :))

    Eli

    ThumbHurt Games / FB: ThumbHurt Games / FB: Eli/Teranth | Skype: teranth37
  • Hey @Teranth ,

    I was able to implement the control sceme I wanted with the accelerometer, however I was initially trying to use the gyroscope.

    As far as I can tell, I could have done what I wanted with either one (minus the weird issue I had with the gyroscope). The gyroscope seems to measure the rate of rotation of the device, while the accelerometer seems to detect the orientation of the device in relation to the ground (or towards the center of the earth following the force of gravity).

    Sorry about the files. If you're still curious about what I was doing I can upload them at some point so you can see the difference.
  • @joelghill not a worry, I just wasn't able to read much into it to try and help you is all :) Glad you got it to work as you wanted, that's all that really matters anyway :)
    ThumbHurt Games / FB: ThumbHurt Games / FB: Eli/Teranth | Skype: teranth37
Sign In or Register to comment.