How to resolve the drift around Z axis in MU6050 Gyroscope?
The accelerometer doesn't see changes in gravity when you rotate around the vertical z-axis. You would need a compass (magnetometer) for that; that does see changes in heading/yaw. The IMU6050 doesn't have a magnetometer built in, unfortunately, so it can't compensate for gyro drift around the z-axis on its own.