I don't know about the MPU6050 but you're at least supposed to have an absolute external reference, e.g., 3D Compass values.
Anyway, the MPU6050 (and even the MPU9150 providing a comapss) are outdated.
I'm succesfully using another IMU providing an onboard cpu for Kalman filtering and sensor fusion to do the required maths for you:
http://de.manu-systems.com/CMPS11.shtml
http://www.hobbytronics.co.uk/cmps11-tilt-compass
http://www.roboter-teile.de/Oxid/Navigation/Kompassmodul-CMPS11.html
manual: CMPS11 I2C documentation
you'll just have to poll the I2C register to read heading, pitch, and roll (or read by Serial).