Combine the gyroscope with the accelerometer to get the title

I use an Android device to get the title (azimuth or angle of rotation).

The Android API used the Accelerometer value + mganetic field to calculate the rotation of the matrix, the azimuth is then extracted from this matrix (aka SensorManager.getOrientation (...)). But the result is very inaccurate! especially if the phone is concerned about some kind of magnetic material.

And then I have a gyroscope. If I integrate the gyro time value, I can get the actual angle, but as everyone knows: p, it is subject to drift ... after 10 seconds even I donโ€™t move the angle 10 ยฐ ...

So, on the one hand I have the result of acceleration + magnetically, this is pretty shit near the magnetic field and on the other hand I have the result of a gyroscope, which is really good, but changes over time ...

So my question is: is there a simple or smart way to combine the two results together to get a kind of โ€œreliableโ€ rate assessment? I speak easily because I know that there are kalman filters. but even hard I read the theory 50 times, I canโ€™t get the damn thing :).

Thanks!

+6
source share
3 answers

Make a short:

Unable to combine gyroscope + accelerometer. GET AZIMUTH (I for sure). Just because the accelerometer cannot sense the acceleration on the XY axis.

The method is to fuse the gyro with a compass, but this will not work really well if there is magnetic perturbation

0
source

As far as I know, SensorManager implements Kalman filter or something similar. Check out Sensor Fusion on Android devices: a revolution in motion handling .

You are trying to solve a problem that has already been resolved.

+4
source

It seems to have a very generalized confusion regarding the gyro sensor. I recently answered a similar question here , so I recommend that anyone interested in these topics look at this question and answer.

I used the described technique in this application (a compass that combines gyro readings to improve results). The result is not perfect, but overall better than other compasses.

+1
source

Source: https://habr.com/ru/post/901030/


All Articles