# IMU quarternion output interpretation?

Im a bit confused about the quarternion output of IMU. By what i understand, the gyroscope measure the angular rate of change in deg/s right? Lets say i got an object move from position A -> B ->C. Should the output at C be the angular change compared to that at position B? How the output of IMU in ROS gives quarternion.?

Lets say at C, i have output of quarternion X and at D , i got quarternion Y. If i just get XY, i will get the total rotation . Is that right?