# Transformation from Body-frame to ECEF-frame

Tags:
1. Apr 22, 2015

### Kuu

1. The problem statement, all variables and given/known data
I have a body which is instantiated on earth at some latitude, longitude and altitude. The body has acceleration which is expressed in body coordinates and the acceleration can be integrated to obtain the velocity vector which is also expressed in body coordinates.

ECI and ECEF frames are located at the center of the earth and NED frame is located at the bodys center of gravity. The current angle of the body is presented with Euler angles which are expressed with respect to NED frame.

How I can transform the body velocity vector to ECEF coordinates so that I can integrate a new position for the body in the ECEF frame? The position in the ECEF frame can then be transformed to latitude, longitude and altitude?

This is not exactly a homework problem but something I've been trying to understand.

2. Relevant equations
--

3. The attempt at a solution
I was thinking something like this:
1. Create transformation matrix $T^{N0}_{I}$ which transforms from the ECI frame to the initial NED frame. (NED frame at the point in which the body is instantiated).
2. Create transformation matrix $T^{B}_{N0}$ which transforms from the initial NED frame to the current body orientation.
3. Create transformation matrix $T^{E}_{I}$ which transforms from inertial frame to current ECEF frame. Transpose: $T^{I}_{E}$ transforms from ECEF to inertial frame
4. Combine the transformations to get: $T^{B}_{E} = T^{B}_{N0} T^{N0}_{I} T^{I}_{E}$ which transforms from ECEF to body and its transpose $T^{E}_{B}$ which transforms from body to ECEF frame
I have feeling that the above won't work and it looks pretty complicated. I might even be completely lost here. Any help is very much appreciated.

2. Apr 25, 2015

### FactChecker

You are on the right track. You have Euler angles to get from body axis to NED. At current latitude, longitude, you have angles to go from NED to ECEF (don't get fooled by the difference between true north and magnetic north). Since the Earth centered inertial frame is arbitrary, you can assume that it is momentarily aligned with ECEF and skip that step. You will still have to be careful about integrating in a rotating frame, but that is another issue.

3. Apr 26, 2015

### Kuu

So basically I need only $T_{ne}$ which transforms from ECEF to NED and $T_{bn}$ which transforms from NED to body.

$T_{ne}$ can be obtained by converting the XYZ coordinates of an object in ECEF coordinates with some conversion algorithm to latitude, longitude and altitude. These can be used to construct the $T_{ne}$.

The $T_{bn}$ can be constructed from the Euler angles between the body and the NED frame. However, obtaining the Euler angles used to construct the transformation matrix is something that confuses me.

I do understand that if the object itself rotates, the angles between the body and the NED frame changes. But doesn't the curvature and rotation of the earth also affect these angles? Below is an image where the circle presents earth and ECEF frames z-axis is pointing towards the viewer.

In the image $x_n, y_n, z_n$ are the coordinate axes for NED frame and $x_b, y_b, z_b$ are the coordinate axes for body frame. $v_b$ is the bodys velocity vector. When the body frame moves in the direction pointed by the velocity vector it's position changes and the NED frame for the current location ($x_n', y_n', z_n'$ in image) is aligned to be tangential to the surface of the earth. Now the angles ($\phi$ in image) between the NED frame and the body frame are different from the previous position, even though the body haven't rotated, and the rotation matrix $T_{bn}$ no longer transforms correctly from NED to body?

I guess I need to somehow get the angular velocity of the NED frame and sum it up with the angular velocity of the body frame which I then integrate to get the angles between NED and body?

Last edited: Apr 26, 2015
4. Apr 26, 2015

### FactChecker

That sounds right. It's too complicated for me to understand completely. Basically, it's the equations used in inertial navigation systems. An earth centered inertial coordinate system comes back into play because gyroscopes measure rotations in inertial space. If you know the rotational rates in inertial space, you can remove the rotational rate of the Earth to get the rotational rates in the ECEF coordinate system.