Finding a transformation between a positional and an acceleration vectors

50 Views Asked by At

I'm trying to solve the following problem. I have two sensors sticked together. The first one gives its positional data (x, y, z) in meters in a custom coordinate system with its a certain origin in a real world. The second sensor is an accelerometer which gives its acceleration data (m/s2) in a North East Down (NED) coordinate system. Now what I need to do is to transform all the incoming data from the accelerometer to the custom coordinate system of the positional data sensor.

I'm not a hundred percent sure if it's even mathematically possible, so that would be the first question. Is it possible? If it is, what would I need to do? What mathematical or algorithmic methods could be usefull here? So far I haven't found anything useful for this particular example.

I was thinking about some kind of a calibration procedure, where a person would move with the whole device. While this the required transformations would be calculated. I wasn't able to think of anything specific, so I hope someone can help me here or direct me to the right course. Any suggestions (for mathematic methods, articles, literature, algorithms etc.) would be appreciated.

(Also I wasn't completely sure about posting the question to this forum, but it's kind of a mathematic problem.)

1

There are 1 best solutions below

0
On

If I understand you correctly (your description is vague in a number of important aspects), then yes this is possible. Indeed, it is not particularly difficult. However, you do need to know how your custom coordinate system and the NED coordinate system are related. If you do not have that information, then it is impossible.

In your custom coordinate system, you should have 3 axis vectors, $\hat x, \hat y, \hat z$, that give the directions from the origin to the points $(1, 0, 0), (0, 1, 0), (0, 0, 1)$, respectively. When expressed in terms of your custom coordinates, these three vectors are given by $$\hat x = \begin{bmatrix}1\\0\\0\end{bmatrix}_{cc}, \quad \hat y = \begin{bmatrix}0\\1\\0\end{bmatrix}_{cc}, \quad \hat z = \begin{bmatrix}0\\0\\1\end{bmatrix}_{cc}$$

Similarly, the NED coordinate system has 3 axis vectors $$\hat n = \begin{bmatrix}1\\0\\0\end{bmatrix}_{NED}, \quad \hat e = \begin{bmatrix}0\\1\\0\end{bmatrix}_{NED}, \quad \hat d = \begin{bmatrix}0\\0\\1\end{bmatrix}_{NED}$$ when expressed in terms of the NED coordinate system.

So far, this is of no use. But since vectors are magnitudes and directions in space, they exist in both coordinate systems. I.e., it is possible to express $$\hat x = x_N\hat n + x_E\hat e + x_D\hat d\\\hat y = y_N\hat n + y_E\hat e + y_D\hat d\\\hat z = z_N\hat n + z_E\hat e + z_D\hat d$$ That is, when expressed in NED coordinates, $$\hat x = \begin{bmatrix}x_N\\x_E\\x_D\end{bmatrix}_{NED}, \quad \hat y = \begin{bmatrix}y_N\\y_E\\y_D\end{bmatrix}_{NED}, \quad \hat z = \begin{bmatrix}z_N\\z_E\\z_D\end{bmatrix}_{NED}$$

What these values $x_N, ..., z_D$ are depends on how you are defining your two coordinate systems. If you know how they are related, then you can calculate these values. These values tell you how to convert from custom coordinates to NED coordinates and back.

If $$\vec v = \begin{bmatrix}v_x\\v_y\\v_z\end{bmatrix}_{cc}$$ in custom coordinates, that means $$\begin{align}\vec v &= v_x\,\hat x + v_y\,\hat y + v_z\,\hat z\\&= v_x\begin{bmatrix}x_N\\x_E\\x_D\end{bmatrix}_{NED} + v_y\begin{bmatrix}y_N\\y_E\\y_D\end{bmatrix}_{NED} + v_z\begin{bmatrix}z_N\\z_E\\z_D\end{bmatrix}_{NED}\\&=\begin{bmatrix}x_N & y_N & z_N\\x_E & y_E & z_E\\x_D & y_D & z_D\end{bmatrix}_{NED}\begin{bmatrix}v_x\\v_y\\v_z\end{bmatrix}\end{align}$$ Thus when expressed in NED coordinates, $$\vec v = \begin{bmatrix}v_N\\v_E\\v_D\end{bmatrix}_{NED} = \begin{bmatrix}x_N & y_N & z_N\\x_E & y_E & z_E\\x_D & y_D & z_D\end{bmatrix}\begin{bmatrix}v_x\\v_y\\v_z\end{bmatrix}_{cc}$$

The matrix $$M = \begin{bmatrix}x_N & y_N & z_N\\x_E & y_E & z_E\\x_D & y_D & z_D\end{bmatrix}$$ converts custom coordinate vectors into NED vectors.

The same principle works the other way. If when expressed in terms of custom coordinates $$\hat n = \begin{bmatrix}n_x\\n_y\\n_z\end{bmatrix}_{cc},\quad \hat e = \begin{bmatrix}e_x\\e_y\\e_z\end{bmatrix}_{cc}, \quad \hat d = \begin{bmatrix}d_x\\d_y\\d_z\end{bmatrix}_{cc}$$ then the matrix $$N = \begin{bmatrix}n_x & e_x & d_x\\n_y & e_y & d_y\\n_z & e_z & d_z\end{bmatrix}$$ converts NED coordinate vectors into custom coordinate vectors.

In general $M$ and $N$ have to be inverse matrices. If you convert $\vec v$ from custom coordinates to NED coordinates, then back to custom coordinates again, then you should get the exact some coordinates back. So $NM = I$ and similarly $MN = I$. If both the custom coordinates and NED coordinates are orthonormal - i.e. all vectors $\hat x, \hat y, \hat z, \hat n, \hat e, \hat d$ are of length 1, and $\hat x, \hat y, \hat z$ are perpendicular to each other, and $\hat n, \hat e, \hat d$ are also perpendicular to each other - then it turns out that the two matrices $M$ and $N$ are just transposes: $M = N^T$ and $N = M^T$, which makes it particularly easy to find one if you know the other.

The NED system is orthonormal. Without knowing how your custom coordinate system is defined, I cannot say for sure, but orthonormal coordinate systems are vastly preferred to those that are not, so it is likely to be as well.