MPU 9250 gyro/accel/mag

I am in need of a good library that will help me read and interpret the values from a MPU 9250 in a ypr format. There needs to be as little drift as possible on the ypr variables.
Any help is welcome!
Thanks a bunch

If anyone has any ways to filter the variables for drift, even that would be helpful.

try this library

this post is another alternative

Thanks! another question, Does anyone know of a good way/ know of a good resource to help with creating a drift filter?

know of a good resource to help with creating a drift filter?

You can't filter out drift, but you can merge data from various sensors to cancel drift. Most people use Kalman filters for this purpose. It is a complex subject, but you can download several complete examples, like this one for the Arduino.

Yes, my research has brought me to the same conclusion. Do you know of a library that just deals with the kalman filter? I would like to implement it in a slightly different way that Richard did in the link you provided.

The simplest way of doing this is using a complementary filter, which is easier to implement than a Kalman filter. It simply merges the data from both the gyros and acceleros. Results are, obviously, often less accurate, but in most cases the difference is not that high.

I did try to use the complimentary filter. It did not seem to be accurate enough for me; the variables where still drifting. I did find a library with the Kalman filter, and have implemented it as best as I can. It seems to be working alright for now.