I am trying to use Invensense's MPU9250. I am using provided library to read euler angle. When the IMU rotates about one axis, angles about other two axes change too. What could be potential cause to it?
Your chip is a MicroElectronicalMechanicalSystem (short MEMS) based Inertial Measurement Unit. These chips itself are analog devices which measure your desired values. For example the gyroscope uses in most cases a moving mass which is inflenced by the coriolisforce of the rotating system. This force leads to a displacement of the mass. This displacement leads to changed capacity in a capacitor, which can be measured.
If you look at the manufacturing of a semiconductor device you will see that you have tons of different tolerances. If you group up all these different tolerances to specific worst cases you can name these groups "corners". It's more or less so:
you got a transistor with characteristic numbers A, B and C there tolerances +/-a, +/-b and +/-c. e.g. A is set to A-a, B+b and C-0.2*c the transistor switchtime will be the fastest of all possible tolerance combinations. Then you call this the fast corner.
You have all these different corners/tolerances and at the end you do not know how your device is placed within all these tolerances.
Some tolerances have an influence on the physical structure. All the complex internal devices won't be alligned to each other prefectly orthogonal. Furthermore the internal chip has be placed into a package which is far away from perfect. It is within a specific tolerance. All these lead to a non perfect chip.
In addition an industrial grade IMU start at 2000\$ and end at several million \$ for military-naval navigation /spacehips. These high quality IMUs do use MEMS (the 2k\$ industrial ones) but they have complex software compensation algorithms to get rid of the non-perfect chip.
The drotek website refers to the github link, and in the github page, there's a disclaimer that the code is mostly broken.
From what I understand from the specs, the rates are user selectable (up to 2000 d/s), and I would expect to see some small changes in the other angles (roll and pitch) if you are rotating by hand around the z-axis, and not translating.
Small changes would be acceptable I guess.
Note: this post was a comment at first, but it was recommended to be changed into an answer, and I did.