# Get rotation of IMU data snapshot

I received snippets of data of an IMU with 9 DoF in motion. For these I wanted to get their rotation by angles relative to the earth frame. My goal is to receive the absolute vertical acceleration, therefore I'd like to know about the sensors rotation.

Thus I was reading about pitch, roll and yaw and also about AHRS Filters like Madgwick- and Complementary-Filter. Now I have a question about the feasibility and understanding:

Since I only have snippets, I don’t know the initial sensor rotation. Is my understanding correct that the filters are only calculating the rotation relative to the last known rotation, so I‘d always have an offset of the initial orientation regarding to the earth frame? Is it even possible to calculate the rotation having only a random snapshot and if so, what would be the best approach?

Thank you very much.

• @user9155899 if your object is doing aerobatics or something and that's the only part of the run you captured then yeah, you're going to get invalid results, but there's nothing any filter is going to be able to do about that. To your question directly, Is my understanding correct that the filters are only calculating the rotation relative to the last known rotation, no, you can recover rotation from accelerometers (by looking for down) and magnetometers (by looking for North). I'd highly recommend giving the Madgwick filter a shot, visualize the results, and then see how it looks to you. Jul 27, 2022 at 0:03