Frame Transform Fun
Transform is a crucial tool in the realm of robotics and many others. From camera calibration to object grasping, it is extensively used through the entire pipeline. The conventional transform between static frames, however, is presumably elaborated in many sources, and our topic is hence about something more dynamic and interesting. Before we start, as usual, we have to set the notation for our discussion. Define the symbol \(^BP_A\) as state \(P\) in frame \(A\) viewed in frame \(B\), that is, the transform of \(P\) from frame \(A\) to \(B\).
The topic we want to discuss is relative motion. The static poses and frames transformation are easy; no matter how many transforms there are, just link them together and match the superscripts with subscripts. For motion, the time derivatives of distances, simple matrix multiplication is not sufficient. We start from two observers, A, and B, looking at some moving object M, simplified as a particle. Given A’s observation of M’s translation \({}^Bv_M\) and self-rotation \({}^B\omega_{M'}\), we want to deduce B’s observation. This is a trivial problem, because A and B are both static, it’s merely a different point of view:
\[\begin{align}\begin{bmatrix}{}^{B}v_M\\{}^B\omega_{M'}\end{bmatrix} &= \begin{bmatrix}{}^BR_A & 0\\0 & {}^BR_A\end{bmatrix} \begin{bmatrix}{}^Av_M\\{}^A\omega_{M'}\end{bmatrix}\end{align}\]here we use apostrophe \(M'\) to indicate self-rotation of M, to differentiate from \({}^A\omega_{M}\), which means the angular velocity of particle M rotating around frame A’s axis.
What if, say, one observer, A, is also moving, translating or rotating by itself? This makes frame A non-inertial, that is, it does not necessarily exhibit inertia. It could be accelerating arbitrarily, and we cannot perform any useful analysis. In an accelerating car, objects will appear to start moving without external force. We have to find another inertial frame, that is either static or in uniform motion, and in our case, that is observer B.
How we pick this frame of reference creates problems. No matter how “relative” we get, when we talk about velocity, we need to have one observer inertial and evaluate the velocity of the other in its frame, otherwise the notion of “velocity” doesn’t make sense. But how do we know if any frame is actually inertial? For a robot arm, it could be the robot base. If the arm is mounted on a moving base, then somewhere on the ground. If the vehicle is an aircraft, then somewhere on the earth, but we know for a fact that earth is moving non-uniformly in the universe. Then there’s the sun, the Milky Way, the Local Group, the Virgo Supercluster, the Laniakea Supercluster. Seems like everything is non-inertial, and this caused widespread panic, because people like stability and controllability; such a dynamic and chaotic view of the universe is unacceptable. Where “on earth” can we find the real inertial frame of reference, and regulate the motion once for all?
About a hundred and fifty years ago scientists faced the same problem. In the era of exploding physics development, the discovery of electromagnetic waves and the nature of light incurred many realistic issues. How does light travel in the vast space? Suddenly the choice of “earth” as a reference frame becomes negligible on the universal scale. They coined the term Ether, referring to the media for light transmission, as an absolute static frame of reference of the universe, for the peace of mind. That’s where Hilbert Einstein came into play. He stated the Equivalence Principle, which is built upon Galileo’s Weak Equivalence Principle, and also a crucial founding stone for his later Theory of Relativity. The principle itself focused on the equivalence between a gravitational field and an accelerating frame of reference—imagine a rapidly upwards accelerating elevator in deep space, and a human on earth, both seeing the same behavior of object falling to the ground. We can further extend this principle and interpret it as, a raindrop falling towards the earth, can view itself as stationary, while the earth is rushing towards it. There is no notion of global inertial frame, and we do not need it. We only need to find the inertial reference frame for local analysis.
With that in mind, going back to the goal of the original problem, we want to describe the motion of M in the inertial frame, B, through A’s observation of M. Starting from the simplest assumption, where there is only linear velocity of A and M, we can write the velocity of M in inertial frame B as
\[{}^Bv_M = {}^Bv_A + {}^BR_A{}^Av_M\]For simplicity, we sometimes drop the superscript of the inertial frame, and replace it by the object frame. We will, however, keep the full notation to reduce confusion.
This concludes the linear velocity part. If we consider angular velocity, things get more involved. It was a bit handwaving in the previous example, but now, when it gets serious, to not further confuse ourselves, we have to define the terms. Rotation, or self-rotation, refers to the object spinning around its own axis; revolution refers to the object orbiting around an axis in another frame. Thus an object can have angular velocity wrt its own frame, but it cannot have linear velocity wrt its own frame, because nothing can translate relative to itself. Note that when describing self-rotation, the object’s original frame of reference (neutral pose of zero rotation) should not change as a reference. In our discussion, we use \({}^A\omega_{A'}\) to denote object A’s self-rotation, and \({}^B\omega_A\) for object A’s revolution about some axis in inertial frame B.
Another important point is that, since we are describing the motion in the frames using linear velocities \({}^Bv_A\) and \({}^Av_M\), there is naturally no revolution angular velocity \({}^B\omega_A\) and \({}^A\omega_M\) in the picture. Only self-rotation is allowed, because an object is able to translate and self-rotate at the same time, but not translate and revolve at the same time, since an arbitrary translational motion will conflict with the revolving motion. A pure revolution is a special case, but also falls under linear description framework using \(v = \omega \times{}r\), where \(\omega\) is equivalently expressed by the linear velocity. We do consider the self-rotation \({}^A\omega_{A'}\) and \({}^M\omega_{M'}\), but assuming there is no internal angular acceleration either.
Let us continue the analysis. If we look at \({}^A\omega_{A'}\) by itself, we can see that it contributes to the linear velocity of M in frame A. We then convert this velocity into inertial frame B:
\[{}^BR_A({}^A\omega_{A'}\times{}^{A}t_M)\]Note since frame A’s origin does not change when rotating, \({}^{A'}t_M\) and \({}^{A}t_M\) are equivalent. \({}^BR_A\) represents the rotation of reference A in frame B, as mentioned above, it remains constant as a reference. The only time-varying component is \({}^At_M\). For the \({}^M\omega_{M'}\) term, self-rotation of M does not affect its linear velocity in B. We can also rewrite the self-rotation in its own frame with one superscript of the frame, \({}^A\omega\) and \({}^M\omega\). We will keep using the apostrophe when indicating self-rotation viewed in another frame.
Since each velocity component acts independently at any given time, the problem is linear, and we can simply add up all the components for the final linear velocity (no pun intended):
\[\begin{equation}{}^Bv_M = {}^Bv_A + {}^BR_A{}^Av_M + {}^BR_A({}^A\omega\times{}^{A}t_M)\end{equation}\]The next part is angular velocity \({}^B\omega_{M'}\). The biggest contributor is obviously M’s self-rotation, observed by A:
\[{}^BR_A{}^A\omega_{M'}\]Similar to the linear velocity equation, which contains A’s linear velocity, the final angular velocity also contains A’s angular velocity in frame B:
\[\begin{equation}{}^B\omega_{M'} = {}^BR_A{}^A\omega + {}^BR_A{}^A\omega_{M'}\end{equation}\]We can rewrite the expressions in matrix form:
\[\begin{equation}\begin{bmatrix}{}^Bv_M\\{}^B\omega_{M'}\end{bmatrix}=\begin{bmatrix}\mathbf{I} & {}^BR_A[{}^Mt_A]_\times\\\mathbf{0} & {}^BR_A\end{bmatrix}\begin{bmatrix}{}^Bv_A\\{}^A\omega\end{bmatrix}+\begin{bmatrix}{}^BR_A & \mathbf{0}\\\mathbf{0} & {}^BR_A\end{bmatrix}\begin{bmatrix}{}^Av_M\\{}^A\omega_{M'}\end{bmatrix}\end{equation}\]Pay special attention to the cross product part in equation (2). We arrive at the final expression by doing following conversion:
\[\begin{align}{}^BR_A({}^A\omega\times{}^At_M) &= ({}^BR_A{}^A\omega)\times({}^BR_A{}^At_M)\\ &=[{}^BR_A{}^At_M]_\times ({}^BR_A{}^A\omega)\\&={}^BR_A[{}^At_M]_\times{}^AR_B({}^BR_A{}^A\omega)\\&={}^BR_A[{}^At_M]_\times{}^A\omega\end{align}\]where step (5) is based on \(\mathbf{R}(a\times b) = (\mathbf{R}a)\times(\mathbf{R}b)\), step (7) is from \([\mathbf{R}v]_\times=\mathbf{R}[v]_\times \mathbf{R}^T\).
There is an analogy to the relative motion transformation, but not exactly the same. The velocity of a point can be described by 3d linear velocity and 3d self-rotation angular velocity; another important physical quantity, wrench, also describes the state of a point using 3d force and 3d torque, imposed on the point. Same as the velocity example, if the point P is not rigidly attached to its observer O, then the wrench observed in frame O is merely a viewpoint transform,
\[\begin{align}\begin{bmatrix}{}^{O}F\\{}^O\tau\end{bmatrix} &= \begin{bmatrix}{}^OR_P & 0\\0 & {}^OR_P\end{bmatrix} \begin{bmatrix}{}^PF\\{}^P\tau\end{bmatrix}\end{align}\]Similar to the leap we took in the velocity example, where we made observer A moving, in this case, if P and O are rigidly attached, when a wrench is exerted on point P, what is the corresponding wrench on O? The deduction process is comparable to that of velocity, and readers can try on their own. Here we give the solution:
\[\begin{align}\begin{bmatrix}{}^{O}F\\{}^O\tau\end{bmatrix} &= \begin{bmatrix}{}^OR_P & 0\\ \left[{}^Ot_P\right]_\times{}^OR_P & {}^OR_P\end{bmatrix} \begin{bmatrix}{}^PF\\{}^P\tau\end{bmatrix}\end{align}\]This similarity and difference between these two cases hint the physical nature behind velocity and wrench. We may dig deeper in this direction, and combine it with an analysis on acceleration terms in future articles.
Enjoy Reading This Article?
Here are some more articles you might like to read next: