Android develops a method to obtain gravity acceleration and magnetic field strength

This paper describes the method of obtaining gravity acceleration and magnetic field strength developed by Android. Share with you for your reference, as follows:

Android mainly relies on:

input data:

Gravity is the gravity acceleration measured by the gravity sensor, float [3]; Geomagnetic is geomagnetic data measured by compass sensor float [3];

Output data:

R is the conversion matrix from the mobile phone device to the coordinate system to the real world coordinate system calculated by this method

I is the rotation matrix of the coordinates from the geomagnetic data to the gravity data

[0 g] = R * gravity [0 m 0] = I * r * geomagnetic (M = magnetic field strength)

The following is the result diagram I made

The core code is as follows:

More readers interested in Android related content can view the special topics of this site: introduction and advanced tutorial of Android development, summary of Android view skills, summary of activity operation skills of Android programming, summary of Android file operation skills, summary of Android resource operation skills and summary of Android control usage

I hope this article will help you in Android programming.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>