1

I have two fixed frames A and B. I have a mobile point P for which I know the 3D orientation (in terms of unit direction vectors) wrt A and B at each time step.

I need to find the Rotation Matrix from B to A.

I checked other answers (e.g. Expression of rotation matrix from two vectors, Calculate Rotation Matrix to align Vector A to Vector B in 3d?), and I'm able to find a rotation matrix R.

But I don't understand why this matrix R changes when the orientation of point P changes. Shouldn't it be fixed since A and B are fixed frames, regardless of P orientation?

EDIT:

Example: B is a frame rotated of -$\pi$/4 on the Y (green) axis wrt to A. If I have the following direction vectors:

$v_a = [-1, 0, 0]; v_b = [-0.70, 0, 0.70]$

Using the procedure in Expression of rotation matrix from two vectors I get this rotation matrix:

$R=\begin{bmatrix}0.70&0&-0.7\\0&1&0\\0.70&0&0.70\end{bmatrix} $

But when the rigid body P turns and for example I have the following direction vectors:

$v_a = [-0.866, 0.5, 0]; v_b = [-0.61, 0.5, 0.61]$

I get the following:

$R=\begin{bmatrix}0.83&-0.04&-0.55\\0.22&0.94&0.26\\0.51&0.34&0.79\end{bmatrix} $

esdi
  • 41
  • It's unclear what you mean. What is the "3D orientation" of a point? – David K Jul 25 '20 at 17:36
  • 1
    If you read the answer to the linked question carefully, you should know that it does not give you a unique rotation matrix. For a single set of input data to the problem, there are infinitely many matrices to choose from. – David K Jul 25 '20 at 17:41
  • Thank you for your answer. I mean that I have the 3D orientation of the rigid body P (not a point). So I understand that there are infinitely many matrices, but if the vectors are linearly independent (which is my case) it is possible to obtain the "best" rotation. My question is why for different sets of linearly independent unit direction vectors I obtain different rotation matrices given that the two frames are fixed. – esdi Jul 25 '20 at 22:09
  • That procedure in the link produces the rotation that preserves the plane in which $v_a$ and $v_b$ reside. i.e., a rotation about the normal vector of that plane. I am fairly sure the planes spanned by the two examples you gave are different so that would imply a different rotation matrix. – Rollen S. D'Souza Jul 25 '20 at 23:04
  • A single vector does not give the full orientation of a body. It only gives partial information. The missing information can be filled in differently for different vectors when you try to reconcile the two frames of reference, giving you different transformation (rotation) matrices. Try using two independent vectors to describe the orientation of the object in each frame (so for two frames, you are using four vectors total, not just two). That will remove the ambiguity. – David K Jul 26 '20 at 01:15

1 Answers1

2

Thanks to David K and Rollen comments I was able to find a solution:

I only had $v_{Ax}$ and $v_{Bx}$ but I could calculate $v_{Ay}$ and $v_{By}$ using other information about the rigid body (i.e. the positions of two aligned points of the rigid body) I constructed the rotation matrices for the two frames using these two direction vectors and the cross product between them.

$R_A=\begin{bmatrix}v_{Ax}&v_{Ay}&v_{Ax}\times v_{Ay}\end{bmatrix}$; $R_B=\begin{bmatrix}v_{Bx}&v_{By}&v_{Bx}\times v_{By}\end{bmatrix}$

and then the rotation matrix from A to B is given by:

$R = R_B \cdot R_A^T$

Thank you for your help.

esdi
  • 41