To convert IMU data from West-North-Up (WNU) to East-North-Up (ENU), you need to perform a series of transformations on the data. Here's a step-by-step process to do this:
- Rotate the data by 90 degrees around the z-axis (ENU x-axis):
First, you need to rotate the WNU data by 90 degrees around the z-axis, which is the ENU x-axis. This will convert the WNU x-axis (which is aligned with the Earth's surface) to the ENU x-axis (which is aligned with the Earth's magnetic field).
Let's call the WNU coordinates (x, y, z), and the ENU coordinates (x', y', z'). The rotation matrix for this transformation is:
R = [[0 -1 0]
[ 1 0 0]
[ 0 0 1]]
Apply this rotation matrix to the WNU coordinates to get the ENU coordinates:
x' = x
y' = -y
z' = z
2. Rotate the data by 90 degrees around the y-axis (ENU y-axis):
Next, you need to rotate the ENU data by 90 degrees around the y-axis, which is the ENU y-axis. This will convert the ENU x-axis (which is aligned with the Earth's magnetic field) to the ENU y-axis (which is aligned with the Earth's surface).
Let's call the ENU coordinates (x', y', z'), and the final ENU coordinates (x'', y'', z''). The rotation matrix for this transformation is:
R = [[0 -1 0]
[ 1 0 0]
[ 0 0 1]]
Apply this rotation matrix to the ENU coordinates to get the final ENU coordinates:
x'' = x'
y'' = -y'
z'' = z'
3. Reverse the sign of the z-component (ENU z-axis):
Finally, you need to reverse the sign of the z-component of the ENU coordinates, since the ENU z-axis points in the opposite direction of the WNU z-axis.
Let's call the final ENU coordinates (x'', y'', z''), and the converted ENU coordinates (x''', y''', z''''). The conversion matrix for this transformation is:
R = [[1 0 0]
[ 0 1 0]
[ 0 0 -1]]
Apply this rotation matrix to the final ENU coordinates to get the converted ENU coordinates:
x''' = x''
y''' = y''
z''' = -z''
The resulting coordinates (x''', y''', z''') are now in East-North-Up (ENU) coordinates.
Note that these transformations assume that the WNU coordinates are aligned with the Earth's surface, and the ENU coordinates are aligned with the Earth's magnetic field. If your coordinates are aligned differently, you may need to adjust the rotation matrices accordingly.