Hello!
first sorry for any physics errors, but i nedd help.
Well, im using accelerometer data, but got a problem to "compensate" gravity.
searching in internet i found an equation that get the quaternions and get the gravity for axis.
But they quaternions are derived from gyroscope, and the gyroscope has an oscillation in the moment of the movement and after back to "normal state". And this is so bad for me.
The equation:
gx = 2 * (q1q3 - q0q2);
gy = 2 * (q0q1 + q2q3);
gz = q0q0 - q1q1 - q2q2 + q3q3;
And i execute every when the gyroscope has a change.
The result is good when i do a moviment, but when the gyroscope back to the "normal" state the gravity back too.
Sorry for my bad english.