Changing the coordinate system of the sensor in android

Android provides sensor data in the device’s coordinate system no matter how it is oriented. Is there any way to get the sensor data in the "gravity" coordinate system? I mean, no matter how the device is oriented, I want accelerometer data and orientation in a coordinate system where the y axis is directed toward the sky, the x axis is east and the z axis is toward the south pole.

I glanced at remapCoordinateSystem, but, apparently, was limited only to a replacement axis. I assume that for orientation I will have to do a small transformation of the rotation matrix at a low level (or is there a better solution?). But what about acceleration data? Is there a way to have data in relation to a fixed coordinate system (a kind of world coordinate system).

The reason I need it, I try to make a few simple movements when the phone is in my pocket, and it would be easier for me to have all the data in the coordinate system associated with the device’s user coordinate system (which will have a slightly different orientation in different user pockets )

0
source share
1 answer

, - ( ).

(Direction Cosine Matrix) , . .

, , . . , , .

DCM, , . , . , , !

0

All Articles