To visualize the sensor
in the world navigation frame of North, East, Down (NED), we first
calculate the vectors North, East, and down from sensor magnetometer
and accelerometer data. Down is simply the gravitational
vector
defined by static accelerometer data. To calculate East, one
simply has to take the cross product of Down and the magentic field
vector B. The B field vector only has components of North and
Down, so the cross product of Down and North results in a vecotr
pointing East. Finally, to find North it
necessary to
remove the Down component of the B vector. This is
accomplished
by applying the dot product to find the projection of B on Down., and
then subtracting this out of B. The image below shows the
rendered IMU with its body frame axis and the vectors North, East, and
Down as calculated from a set of static sensor data.
Figure: NED
Once
North, East, and Down are determined, a transformation (rotation)
matrix can then be applied to each body frame vertice in order to
transform the sensor into the NED navigation frame.