Converting speed vector base coordinate system to preserve destination

1.3k Views Asked by At

I have a vector that stores speeds for 3 degrees of freedom, like this: $v=[dx,dy,d\theta]$. Now, these speeds are obviously directional. The direction is measured in a global base frame. In this world I have an object that I want to move with $v$. I can only move it in reference to it's own local origin (of which I know the position in world space). With $v$ comes a $t \in R^+$, that indicates the time for how long that speed vector should be applied to the object.

How do I transform the speed vector into the local coordinate frame of the object I want to move, so that it ends up in the same place as if I could move it in global space, if there are constraints on the maximum speed allowed? It is ok to change the duration, for which the vector is applied.

My thoughts:

Let's say $t$ is in seconds, elements in $v$ are in $m/s$, respective $rad/s$. I calculate how the object would move in global space: $d=t*v$ is a directional vector.

Let $o = [x,y,\theta]$ be the position of the object in world space. Then $d+o = \hat{o}$ is the world space position of the object after moving it. I can now transform $\hat{o}$ into the the unmoved object's local frame. This is now the distance vector that I need to move: $m = [x',y',\theta']$. Let $v'=[dx,dy,d\theta]$ be the speed vector that I am looking for. Then $v'=1/t_{new} * m$. Let's say I want to travel not slower or faster than $v_{linear\_max}, v_{angular\_max}$.

I now solve

$x'/v_{linear\_max}=t_1 \\ y'/v_{linear\_max}=t_2 \\\theta'/v_{angular\_max}=t_3$

Let $t_{actual} = max(t_1,t_2,t_3)$. This is the time I need to travel, since I want to reach a certain position and can't get there faster in at least one degree of freedom. I can now recompute the velocities as $[dx,dy,d\theta] = [x'/t_{actual}, y'/t_{actual},\theta'/t_{actual}]$.

Is this correct, and can it be done with less effort? (E.g applying one coordinate transform to the global velocity vector).

Thank you!

1

There are 1 best solutions below

0
On BEST ANSWER

You’ve got the right idea, but your computation of the minimum time for the movement looks a bit off.

Let’s deal with the coordinate systems first. Assuming that they’re both Euclidean and that there’s no scaling involved, you have an isometry. Moreover, the coordinate transformation can be decomposed into a rotation followed by a translation. Since the linear velocity vector is essentially the displacement between two points, its length is unchanged, but it does get rotated. The intrinsic rotational speed of the object (its spin rate) is, of course, unchanged by the coordinate transformation. The upshot of this is that it doesn’t matter whether you work in the global or local coordinate system—the linear velocity vectors are related by a simple rotation.

Now for the minimum time for the movement. It looks like you have a maximum linear speed $v_\text{max}$ and a maximum rotational speed $\omega_\text{max}$. Linear speed is the length of the linear velocity vector, so we have for the minimum transit time $$t_\text{min}=\max{\left\{{\sqrt{\Delta x^2+\Delta y^2}\over v_\text{max}},{\Delta\theta\over\omega_\text{max}}\right\}}.$$ Once you have this value, you can proceed as you’ve proposed: for the linear velocity we get $v_x=\Delta x/t_\text{min}$ and $v_y=\Delta y/t_\text{min}$, and for the rotational speed $\omega=\Delta\theta/t_\text{min}$.

If you do this computation in the global frame, you will now need to rotate the linear velocity part $[v_x,v_y]$ to convert it into the object’s local frame. This is easily done even if you don’t happen to know the rotation angle. In homogeneous coordinates, the matrix of the global-to-local coordinate mapping will be of the form $$\left[\begin{array}{c|c}R_\phi&\mathbf w\\\hline0&1\end{array}\right],$$ where $R_\phi$ is a $2\times2$ rotation matrix. Applying this submatrix to $[v_x,v_y]^T$ will give you the transformed linear velocity. If instead of a matrix, you have equations of the form $x'=cx-sy+h$, $y'=sx+cy+k$, then the linear velocity can be transformed by dropping $h$ and $k$, i.e., $v_x'=cv_x-sv_y$, $v_y'=sv_x+cv_y$.