How to get the vector in the same direction in local coordinate system as the global?

49 Views Asked by At

I have a robot simulation model which is in terms of local coordinate system $x, y, z$. so every joint here will be with respect to a parent.

I have some data about an action and these actions are given in terms of the global coordinate system.

Now since I am feeding this data into the model and the axis are rotated, but the direction in space of the vector would remain the same.

So now I want to find the coordinates of this vector (which was pointing in some direction in the global frame) in terms of the local frame

Here is a desmos visualization. The RGB longer vectors are the global $x, y, z$. The shorter RGB are the local $x_l, y_l , z_l$ The grey vector is the vector $v$ which I am interested in, here $v$ is defined in terms of the global axis. Keeping the pointing direction same I want the vector in terms of local $x_l, y_l , z_l$.

How did I get the local axis?

  • I had a quaternion which was used to rotate the 3 basis axis