How to find the coordinates of two objects relative to each other given their absolute coordinates?

219 Views Asked by At

I have the x,y,z coordinates of two objects and the roll, pitch and yaw of those objects to a common origin. How do I find the x,y,z coordinates and the roll pitch and yaw of one object relative to the other?

1

There are 1 best solutions below

0
On

The roll, pitch, yaw (rotation) and x, y, z coordinates (translation) of coordinate frame $1$ (attached to object $1$) with respect to global coordinate frame $0$ are represented by homogeneous transformation matrix ${H_1^{0}}^*$. Also, the roll, pitch, yaw (rotation) and x, y, z coordinates (translation) of coordinate frame $2$ (attached to object $2$) with respect to global coordinate frame $0$ is represented by homogeneous transformation matrix ${H_2^{0}}^*$.

To find the homogeneous transformation matrix representing frame $2$ with respect to frame $1$ ($H_2^1$), we use $H_2^{1}=H_0^{1}H_2^{0}=(H_1^{0})^{-1}H_2^{0}$.

We can find the homogeneous transformation matrix representing frame $1$ with respect to frame $2$ by inverting $H_2^{1}$ (in other words, $(H_2^{1})^{-1}=H_1^{2}$).

The desired relative roll, pitch, and yaw angles and relative x, y, and z coordinates can then be read from the final homogeneous transformation matrix (either $H_2^{1}$ or $H_1^{2}$, depending on whether you want to represent frame $2$ in frame $1$ coordinates or frame $1$ in frame $2$ coordinates, respectively).

*the subscript denotes the frame being represented and the superscript denotes the frame of reference

For more information on coordinate frames and homogeneous transformation matrices, refer to Chapter 2 of book "Robotic Modeling and Control" by Spong and Vidyasagar.