[ODE] initializing heading

Don Burns don at andesengineering.com
Tue May 11 10:32:12 MST 2004


Hi Sever,

I had a similar question within the last few weeks.  Check the archives 
for the dialog between Martin and I regarding this issue.  In a nutshell, 
you need to place your wheels with a translate/rotate, as well as provide 
the wheels with a rotation about their own axis.

For converting from osg to ode matricies:

        static inline void OsgToOdeMat( const osg::Matrix &R, dMatrix3 &r 
)
        {
            r[ 0] = R(0,0);
            r[ 1] = R(1,0);
            r[ 2] = R(2,0);
            r[ 3] = 0.0;
            r[ 4] = R(0,1);
            r[ 5] = R(1,1);
            r[ 6] = R(2,1);
            r[ 7] = 0.0;
            r[ 8] = R(0,2);
            r[ 9] = R(1,2);
            r[10] = R(2,2);
            r[11] = 0.0;
        }

-don

On Tue, 11 May 2004, a Sever wrote:

> hi all I have set up a small app using osg and ode, where I'm loading
> from file a terrain and a list of models with way points, and for each
> graphic model an ode eequivalentis set. the vehicle(s) starts driving to
> the way points one after the other. the thing is, I can't seem to set
> the body's heading correctly. the start position is defined by x,y,z and
> h ,p ,r (in degrees). on init I position the graphical object and then
> pull osg's transform matrix and translate it into a quaternion, using
> it's data to set the ode object with dBodySetQuaternion. the thing is,
> the wheels start accelerating and turning to reach the next WP
> immediately, before the body settles, creating extra torque. so :  -
> anyone knows of differences between osg and ode matrices that might
> explain why the yaw isn't set correctly? - anyone knows how I can verify
> the body is completely settled before starting the wheels going?
>  
> thanks 
>  
> a. sever
> 
> 
> 
> 		
> ---------------------------------
> Do you Yahoo!?
> Win a $20,000 Career Makeover at Yahoo! HotJobs 




More information about the ODE mailing list