0
$\begingroup$

everyone,

If there is a coordinate system A, and a coordinate system B(the relation of A and B is:if I let coordinate system A rotates around z, y and x axis around $\psi$,$\theta$ and $\psi$ degrees, then I can get coordinate system B). Also, there is a rigid body and I can read position($x$,$y$,$z$) and rotation(Euler angle:roll is $\alpha$, pitch is $\beta$ and yaw is $\gamma$) of this rigid body in coordinate system A, is there any way that I can get the position and rotation of this rigid body represented in coordinate system B?

$\endgroup$

1 Answer 1

0
$\begingroup$

Yes. You can represent the coordinates of an object in various reference frames from using transformation matrices. Here, I assume the origins of the reference frames are aligned based on your description, so you only need to use a rotation matrix.

You can compute the rotation matrix for rotating reference frame $A$ on reference frame $B$ by rotations about each axis in sequences. The rotations around $x$, $y$, and $z$ axes are given as follows:

$$ R_x(\theta) = \begin{bmatrix} 1 & 0 & 0\\ 0 & \cos{\theta} & -\sin{\theta} \\ 0 & \sin{\theta} & \cos{\theta} \end{bmatrix} $$

$$ R_y(\phi) = \begin{bmatrix} \cos{\phi} & 0 & \sin{\phi} \\ 0 & 1 & 0 \\ -\sin{\phi} & 0 & \cos{\phi} \end{bmatrix} $$

$$ R_z(\psi) = \begin{bmatrix} \cos{\psi} & -\sin{\psi} & 0\\ \sin{\psi} & \cos{\psi} & 0 \\ 0 & 0 & 1 \end{bmatrix} $$

Now, the order that you apply the rotation matters, so if you want to rotate around $z$, then $y$, then $x$, the rotation matrix is computed as follows:

$$ R = R_x(\theta)R_y(\phi)R_z(\psi) $$

Now, if the angles represent the amount that you rotate frame $A$ to align frame $B$, then the above rotation matrix can be used to transform points from frame $B$ to frame $A$, which we can denote by ${}^A R_B$. This notation represent the orientation of frame $B$ in reference frame $A$. If we want to transform points from frame $B$ to frame $A$ ,then we take the inverse of the rotation matrix ${}^B R_A = {}^A R_B^{-1}$.

Now, consider a point on the rigid body of an object in frame $A$ denoted by ${}^Ap$. To get the position of that point in frame $B$, you simple multiply by the appropriate rotation matrix as follows: $$ {}^Bp = {}^B R_A {}^Ap $$ where ${}^Bp$ is the same point as ${}^Ap$ but represented in frame $B$. You can repeat this process for any point on rigid objects.

$\endgroup$
2
  • $\begingroup$ sorry for the late reply. your answer is helpful. One more question is your $^Bp$ is the position which is represented in frame B. But what about the roll, pitch, yaw angle which are represented in frame B? $\endgroup$
    – DarkKnight
    Aug 24, 2021 at 18:32
  • $\begingroup$ @DarkKnight Correct. ${}^Bp$ is the position represented in frame B. Representing orientation in 3D (i.e., roll, pitch, and yaw) can be confusing, but you can obtain the roll, pitch, and yaw from the rotation matrices. So, ${}^BR_A$ would represent the orientation of frame A in frame B and vice versa for ${}^AR_B$. See the following link for extracting the angles: planning.cs.uiuc.edu/node103.html $\endgroup$
    – Ralff
    Aug 31, 2021 at 15:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .