[ODE] RE: Angular velocity

Yefei He yhe at nads-sc.uiowa.edu
Thu Apr 14 17:20:50 MST 2005


Hi, Jon, 

    The source codes are in rotation.cpp. I also feel one of them are wrong.

I interprete _R(m, n) as mth row and nth column, so my layout of the matrix 
is 

   _R(0,0)  _R(0,1)  _R(0,2) 
   _R(1,0)  _R(1,1)  _R(1,2) 
   _R(2,0)  _R(2,1)  _R(2,2) 

    It looks to me in ODE the matrix is transposed, by looking at the 
source code for dRFromEulerAngle(R, phi, theta, psi): 

   cpsi*ctheta                     spsi*ctheta                     -stheta 
   cpsi*stheta*sphi - spsi*cphi    spsi*stheta*sphi + cpsi*cphi
ctheta*sphi 
   cpsi*stheta*cphi + spsi*sphi    spsi*stheta*cphi - cpsi*sphi
ctheta*cphi 

    and so matrix multiplication is applied in the left to right order. If 
that's the case, then the function dRFromAxisAngle() is wrong, and angular 
velocity is wrong too, because ODE has: 

    dRFromAxisAngle( R, 1, 0, 0, a ) 
    1       0       0 
    0    cos(a) -sin(a) 
    0    sin(a)  cos(a) 

    dRFromAxisAngle( R, 0, 1, 0, a ) 
 cos(a)     0    sin(a) 
    0       1       0 
-sin(a)     0    cos(a) 

    dRFromAxisAngle( R, 0, 0, 1, a ) 
 cos(a) -sin(a)     0 
 sin(a)  cos(a)     0 
    0       0       1 

    They match the rotation matrices that are intended to be applied in the 
right to left order, instead of the transposed ones. However things do match
if 
I negate either all the Euler angles, or the angles in dRFromAxisAngle() and
the 
angular velocity. I didn't check the other rotation functions. Perhaps all 
others match dRFromAxisAngle(). 

    Best Regards, 

    Yefei 

> -----Original Message-----
> From: Jon Watte [mailto:hplus-ode at mindcontrol.org]
> Sent: Thursday, April 14, 2005 4:38 PM
> To: Yefei He; ode at q12.org
> Subject: RE: [ODE] Angular velocity
> 
> 
> 
> 
> >     That means Euler angles need to be negated to match the
> results of
> > rotation around x, y, or z axis. The discrepancy between
> Euler angles
> > and angular velocity is the same.
> 
> I have no idea. That seems wrong.
> 
> Note that your illustration doesn't tell me whether you use row
> vectors or column vectors, nor whether you interpret the rotation 
> matrices in row-major or column-major order, so it's hard to tell 
> WHICH one of them is wrong -- but one is wrong.
> 
> Grep the ODE internal source for these functions; chances are, only
> one of them is used, and chances are, that one is right.
> 
> Cheers,
> 
> 			/ h+
> 




More information about the ODE mailing list