I was given a task to create a demo to manipulate a 3d object in space using a Phidget Spatial 3/3/3. This device can return values from accelerometer, gyro and compass. The problem is that the object should have exactly the same rotation as the phidget (which the user is supposed to manipulate).
With accelerometer I can track 2 axis, but I cannot track the 3rd (logically) if the device is vertical towards the earth, meaning I cannot track at all the rotation around the Y-axis.
My attempts with the gyroscope are a failure. Phidget claims a drift of 4°/min but if I spin the device for a few seconds, the values get ridiculously mixed up, absolutely unusable. I would have to zero the device every 10 seconds (which of course I cannot do as it would need to stay in the same position for a short period of time).
My question is: is there any way to get the correct values for x, y and z rotation from accelerometer/gyro (maybe by the help of the compass)? Is there some formula for it? Thanks a lot!
Please note I am using Actionscript 3 but an example in any other language greatly appreciated.