Question

I'm using an Android device to get the heading(azimuth, or yaw angle).

Android API used the Accelerometer value + the mganetic field to compute a matrix rotation, the azimuth is then extracted form that matrix (aka SensorManager.getOrientation(...)) But the result is very inaccurate! especially if the phone is perturbed by some magnetic stuff.

And then I have the Gyroscope, If I integrate the value of the gyro trough time, I'm able to get an actual Angle, but like everybody knows :p, this is subject to drift... after 10 seconds even tough I'm not moving the angle drifted of 10°...

So here I have in one side the result of the accel + magneto, it's quite crap near magnetic field and on the other side I have the result of the gyro that are really good, but drift over time...

So my question is, is there an easy or smart way to combine the two results together to get a kind of "robust" heading estimation? I say easy because I know there is kalman filters.. but even tough i read the theory 50 times I can't get a damn thing :).

Thank you!

Was it helpful?

Solution 3

TO make it short:

It is not possible to combine Gyroscope + accelerometer TO GET THE AZIMUTH (I precise) Simply because the accelerometer can't sense acceleration on the XY axis..

A method would be to fuse the Gyroscope with the Compass but that won't work really good if there is magnetic pertubation

OTHER TIPS

As far as I know, either the Kalman filter or something similar is implemented in the SensorManager. Check out Sensor Fusion on Android Devices: A Revolution in Motion Processing.

You are trying to solve a problem that is already solved.

It seems to have a very generalized confusion about gyroscope sensor. I have recently answered a similar question here, so I recommend to anybody interested in these topics to have a look at that question and answer.

I have used the described technique in this application (a compass which integrates gyroscope readings to improve results). The result is not perfect, but is much better in general than other compasses.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top