But when I build it, I got a build error 2 with this:
**src/inertial.cpp:21:7: error: no member named 'transform' in 'vex::inertial'**
dti.transform(accurateOrientationX, accurateOrientationY, accurateOrientationZ);
~~~ ^
1 error generated.
make: *** [vex/mkrules.mk:13: build/src/inertial.o] Error 1
Build Failed: Make process closed with exit code: 2
As Mentor_355U said, does seem a little over complicated, but if you succeed let us know how things worked out. I originally added the quaternion class with graphics in mind, transforming vectors for visualizing how the inertial sensor was oriented, however, the raw data that comes from the inertial sensor to the V5 brain is in quaternion format where we convert to a roll, pitch and yaw attitude (heading and rotation are derived from yaw), so it could be used as an alternative to heading.
And, to be clear, if OP would like to use the Inertial sensor for one of the other degrees of freedom (e.g. pitch and roll, for example) the dti.pitch(degrees); and dti.roll(degrees); functions seem simpler than dealing with the quaternion…