[ODE] Determining relative orientation and angular velocity

Marcus Brubaker aurelius.marcus at rogers.com
Mon Jun 27 14:21:29 MST 2005


Thanks Stephen.  So once I've transformed the angular velocity vector 
appropriately, how would I go from that to the quaternion derivative.  I 
imagine that the dWtoDQ function may come in to play here but I'm not 
clear how.  Thanks again.

Regards,
Marcus

SJS wrote:

>If you already know how to convert quat->euler, then all you have to do is
>transform your quaternion to the frame of the reference orientation and then
>do your quat->euler procedure on the resulting quaternion.
>
>For an angular velocity vector, just perform the transform on the vector
>(just a rotation).
>
>e.g. if you have a quaternion q0 and velocity vector v0 in the world frame
>and you want to know their values relative to some ODE object, get the
>quaternion of the ODE object (I'll call it qR), and then
>
>q1 = q0*(qR^-1)
>
>and to transform v0 you can use a quat. transform (v1 = vector part of
>qR*quat<v0, 0.0>*~qR) or just convert qR to matrix form (mR) and do
>
>v1 = v0*(mR^-1) [or (mR^-1)*v0 if you're using column-vector notation]
>
>(qR represents a transform for taking things in the local frame of the
>object and converting them to the world frame, so its inverse transforms
>things from world frame to the object's local frame)
>
>If you're more comfortable with matrices, you can just convert the
>quaternions to matrices and all of the same operations still apply.
>[Note, however, that quaternion multiplication is typically notated and
>implemented to be consistent with matrices that multiply with column
>vectors, which is the opposite order as D3D-style matrix operations (which
>use row vectors).  So if you're using row vectors with D3D-style matrices,
>use m1 = (mR^-1)*m0 for the case above.]
>
>SJS
>
>-------------------------
>Stephen Schlueter
>sschluet at alum.mit.edu
>-------------------------
>  
>



More information about the ODE mailing list