[ODE] Pitch and roll euler angles

luigi at realityslip.com luigi at realityslip.com
Sun Jul 18 16:45:02 MST 2004


Sorry for the repost, I forgot the subject!

Hi Brian,

I was actually doing something similar, unforunately I get
inconsistancies/unsynchronized data.  I have been told that you cannot simply
integrate angular velocities to get pitch and roll.  Consider a pipe loop.  If
I drive up a surface (head on) my pitch will increase...if I start turning
right while I'm driving up the surface, my roll will increase as well.  Now if
I drive off the surface with 90 degrees of roll (so driving straight off the
side of the pipe), gravity will correct my roll value when I slam back onto the
ground but pitch will still be high.  Does that make sense?

Here's what I'm doing to integrate the velocities:

Convert world angular velocity to local (multiply by inverted body to world
matrix).
Integrate with previous frame in respect to time. (angles += AngVelLast +
AngVel) * dt)

I'm not quite sure why you were dividing by two in there but I tried that too
and still experienced what I mentioned above.  What did you mean by "don't
forget the accelerations?".  Should I integrate from those to velocity to
angles instead?  Are you also using this for a motion simulation platform?


Thanks for the help,


Luigi


-----Original Message-----
From: ode-bounces at q12.org [mailto:ode-bounces at q12.org] On Behalf Of Brian
Clarkson
Sent: Sunday, July 18, 2004 9:14 AM
To: ode at q12.org
Subject: RE: [ODE] Pitch and roll euler angles



>I'm working on a racing game which will run on a motion simulator with 
>full
360
>degrees of motion for pitch and roll (no yaw).  The simulator requires
pitch
>and roll angles (in degrees) and angular velocity (in degrees for each
axis).
>.I've been working on extracting continuous pitch and roll angles from 
>the
body
>(based on angular velocity) yet I can't get it quite right.  I was 
>hoping someone here may have a suggestion of how to do this or could 
>spot what I'm doing wrong.

Luigi

I do something similar and it works fine for me. dBodyGetAngularVel() returns
velocities in world space so you need to transform to body space. You can now
accumulate the angles from the velocities. Dont forget the accelerations. Also
dont forget the time step. ie.

   Angle += ((LastAngularVel + CurrentAngularVel) / 2.0f) * TimeStep;

Brian..


_______________________________________________
ODE mailing list
ODE at q12.org
http://q12.org/mailman/listinfo/ode


_______________________________________________
ODE mailing list
ODE at q12.org
http://q12.org/mailman/listinfo/ode




More information about the ODE mailing list