Fixed a bug in which the quaternion magnitude was not calculated properly,
causing the quaternion orientation fed to the driver to be incorrect.