5
The orientation algorithm
The orientation algorithm uses inertial sensor data (accelerometer and gyroscope, optionally
compass) to calculate the orientation of a node. This is represented in quaternions and Euler
angles. The initial
roll
and
pitch
angles relative to the Earth’s gravitational field are instan-
taneously determined using the accelerometer. The
yaw
angle relative the Earth’s magnetic
field is determined by the compass. If the compass is not enabled, the initial
yaw
provided in
Section 4.11.5 is used. Every new inertial sample is combined with the current orientation to
calculate the new orientation. The order for Euler angle rotations is
ZYX
.
For the best performance, the accelerometer and compass should be calibrated as described
in Section 4.9. An uncalibrated accelerometer can cause a slight change in the
roll
or
pitch
angles while the node is lying flat. An uncalibrated compass can cause an incorrect
yaw
angle
or strange jumps in the
yaw
angle.
There are two situations that have to be considered with respect to the usage of the compass:
•
The compass is used.
Please note that the compass is highly influenced by the surrounding
metal objects and electromagnetic fields and therefore it is in general not useful indoors.
To be used indoors, the node has to be at least one meter away from any metal object
and elevated at least one meter from the ground. In this case, the compass needs to be
calibrated (see Section 4.9).
•
The compass is not used.
In this case, the nodes start with the same initial
yaw
angle, which
can be configured from
Preferences -> Orientation
(Section 4.11.5). The computation of the
orientation using the compass has to be disabled. There are two options for doing this:
–
Deselect the option
Use compass
from
Preferences -> Orientation
–
Disable the compass sensor from
Sensor Settings
At the beginning of an experiment, it is recommended to reset the initial orientation of the
algorithm by using the
Reset
button in the
Tracker
window (Section 4.10). In this way, all nodes
will start with the correct initial
yaw
angle.
Page 54 of 60