My question is probably very simple, but it may be that I am completely wrong, so I decided to ask. In the end, I will calculate my phone orientation using the data from the gyro sensor. I know that I should use something like a Kalman filter or an additional filter to deal with the gyro drift. I will do this in the second step, but the problem I ask here is the same for both approaches. So the real question is this:
From the gyroscope, I get only angular changes (after integration). So I need some initial value, I can add the current measured change. But how do I get this starting point? Do I use an accelerometer and magnetometer to determine the orientation of the phone? Or is this the best way?
If that matters, I use Android for this and have an implementation to determine the orientation of the phone with an accelerometer and magnetometer, but this is very inaccurate.
source share