I have Code Close to Perfection Well not quite there but I have A PID Calibration routine that does a great gob at zeroing out drift for the mpu6050/MPU6500 or Equivalent MPU9150/MPU9250 I have now have easy access to the compass with the same code and I am using DMP V 6.12 and I also have access to every register through simple macro requests that use the same naming structure as the Registry Map documents.
My Library is Simple_MPU6050 and so to be clear I am VERY interested in the same goal you are attempting. I have not yet achieved it but I am interested in working with you towards gyro / Compass integration or 9 Degrees of freedom.
I can share with you a library that is precompiled that is supposed to do this but I am afraid it is for ARM processors but I could be wrong and you may be able to get it working.
Invensense Developer corner is where these are located. The attached files are only the 9Degree of Freedom library and .h associated files they created. If you are able to get this to successfully compile these with an Arduino UNO I will be most grateful (This is a hobby and my skill set is limited when it comes to pre-compiled libraries) With this library compiling we should shortly achieve 9 Degrees of freedom with magnetometer calibration and more:
The Motion Driver 6.12 contains a binary library which contains InvenSense proprietary algorithms for sensor fusion and dynamic calibration. The MD 6.12 driver pushes the sensor data into the MPL and the MPL will handle the 9-axis sensor fusion including the compass integration.
The libmplmpu.lib file failed to attach. Forum error you will need to get a login for https://www.invensense.com/developers/login/
and go to the link: https://www.invensense.com/developers/software-downloads/
look for Embedded MotionDriver 6.12
once downloaded unzip and look in directory \motion_driver_6.12\msp430\eMD-6.0\core\mpl\
Added it with the .txt extension. Change it to .lib to get the file.
accel_auto_cal.h (1.01 KB)
compass_vec_cal.h (804 Bytes)
fast_no_motion.h (1.29 KB)
fusion_9axis.h (1022 Bytes)
gyro_tc.h (888 Bytes)
heading_from_gyro.h (762 Bytes)
inv_math.h (184 Bytes)
invensense_adv.h (637 Bytes)
mag_disturb.h (948 Bytes)
motion_no_motion.h (651 Bytes)
no_gyro_fusion.h (762 Bytes)
quaternion_supervisor.h (583 Bytes)
libmplmpu.txt (351 KB)