user85515: I am currently usinga BNO055 sensor fitted on the Arduino Nine-axis motion shield to measure ocean wave heights and periods. To do this, I'd like to use the quaternions provided, however I have a slight issue. A quaternion should be <cos(theta/2), Xsin(theta/2), Ysin(theta/2), Z*sin(theta/2)>, with X, Y and Z the coordinates of a unit vector and theta the angle of rotation around that vector. Therefore, I expect all three to be inferior to one.
However, when I run a simple code to see the raw data, the W given by my sensor when on the table is 16 375, and X, Y and Z values are in the high hundreds range...
This gives me a wave height of hundreds of thousands of kilometers :slightly_smiling_face:
Does anyone know why this happens? Do I need to divide the quaternion by it's norm to get the correct result? Or maybe I am misunderstanding the use of a quaternion?
Oh, and I have calibrated the sensor beforehand
Thanks in advance for your help

user7508: I am not familiar with this sensor, so I am just guessing.
The sensor is likely giving you fixed-point numbers. Judging from
the real part, there are most likely 14 bits right of the implicit
radix point. If that is the case, the actual quaternion can be computed
as:
float w = raw_w / 16384.0;
float x = raw_x / 16384.0;
float y = raw_y / 16384.0;
float z = raw_z / 16384.0;

You can check whether this is reasonable by computing the norm, which
should be very close to one.

85515: <p>I am currently usinga BNO055 sensor fitted on the Arduino Nine-axis motion shield to measure ocean wave heights and periods. To do this, I'd like to use the quaternions provided, however I have a slight issue. A quaternion should be &lt;cos(theta/2), X<em>sin(theta/2), Y</em>sin(theta/2), Z*sin(theta/2)&gt;, with X, Y and Z the coordinates of a unit vector and theta the angle of rotation around that vector. Therefore, I expect all three to be inferior to one.</p>
<p>However, when I run a simple code to see the raw data, the W given by my sensor when on the table is 16 375, and X, Y and Z values are in the high hundreds range...</p>
<p>This gives me a wave height of hundreds of thousands of kilometers :slightly_smiling_face:</p>
<p>Does anyone know why this happens? Do I need to divide the quaternion by it's norm to get the correct result? Or maybe I am misunderstanding the use of a quaternion?</p>
<p>Oh, and I have calibrated the sensor beforehand</p>
<p>Thanks in advance for your help</p>
 7508: <p>I am not familiar with this sensor, so I am just guessing.</p>
<p>The sensor is likely giving you <a href="https://en.wikipedia.org/wiki/Fixed-point_arithmetic" rel="nofollow noreferrer">fixed-point</a> numbers. Judging from
the real part, there are most likely 14 bits right of the implicit
radix point. If that is the case, the actual quaternion can be computed
as:</p>
<pre class="lang-c prettyprint-override"><code>float w = raw_w / 16384.0;
float x = raw_x / 16384.0;
float y = raw_y / 16384.0;
float z = raw_z / 16384.0;
</code></pre>
<p>You can check whether this is reasonable by computing the norm, which
should be very close to one.</p>
