I'm using arduino to read from an accelerometer and gyroscope, from which I can get a vector of accelerations and also a vector of speeds of rotations in the device's coordinates, now I want to transform the accelerometer data into the absolute coordinates, in which the Z axis straightly points up aligned with the direction of gravity force, and X, Y form an absolute horizontal plane.
I've read many posts on internet, but cannot find a good solution yet. These posts either discuss how to remove noise by combining gyroscope with accelerometer (e.g., http://www.starlino.com/imu_guide.html) or provide a solution based on Android, which could directly leverages the rotation matrix provided by Android API (For example, this post: Transforming accelerometer's data from device's coordinates to real world coordinates).
But now, I only have raw readings of accelerometer and gyroscope, how can I transform accelerations from device coordinates to absolute coordinates via python?
BTW, in my experiments, the device will be always in an relative stable state in a while, which can be used to estimate the direction of gravity in device's coordinates.