MPU6050 measurements

I have been working with MPU6050 for a while now but I'm not able to understand the values that my gyro sensor gives me is with respect to what? I know its relative to something but with respect to what?

Moreover, I have read that magnetometer gives me absolute value, but I see that it gives the value of magnetic field along the three axes with respect to earth magnetic field, then this must be relative too, right?

The gyro is in respect of its previous position

The mag indicate the magnetic north which is "near" the geographic one, you could calculate it with the deviation (but you don t have a mag inside the mpu6050)

Try this by the way and tell me if it works good: https://www.hackster.io/vincenzo-g/sensor-fusion-algorithms-made-simple-6c55f6

Hitesh_KHD: I have been working with MPU6050 for a while now but I'm not able to understand the values that my gyro sensor gives me is with respect to what? I know its relative to something but with respect to what?

Moreover, I have read that magnetometer gives me absolute value, but I see that it gives the value of magnetic field along the three axes with respect to earth magnetic field, then this must be relative too, right?

Gyro measurements are meant to give you rotational velocity readings (angular velocity readings) of an object .... around a particular axis. Eg. change in an angle over some relatively short duration of time.

If you're on a merry-go-round spinning at some relatively constant angular speed, and the gyro located at the axis of rotation tells you some angular velocity, then usually it's relative to ZERO radian per second.

As for the magnetometer...... if you have three axes, and if the magnetometer is calibrated, then whatever field components that are measured will result in a 3-dimensional vector. If you move your magnetometer, that vector is certainly going to point in some other direction (relative to your magnetometer's local coordinate system). But if you don't move your magnetometer, then that vector will just stay put, unless the external magnetic field changes.