[ODE] Torque: Bug in 0.025, apparently fixed in CVS

nlin@nlin.net nlin at nlin.net
Sat Nov 24 08:48:02 MST 2001


Hello Ruud and the list -

I am convinced. There WAS a bug in ode-0.025. It is fixed in the current CVS
version. Russ, maybe you could look at this and make sure that the bug has been
intentionally and completely fixed, and that this is not just a lucky
conicidence?

Summary: ODE 0.025 has an apparent torque reversal problem, which does
not appear in the CVS version checked out on 24.11.2001.

Now that I think about it, I did have some strange torque reversal behavior,
but I attributed it to an orientation error in my level editor. It looks like
this was exactly the problem that I had seen and written off. Good that you
pointed this out, Ruud.

-Norman

The nauseating hard data:

===============================================
ODE 0.025:
- Compiled under Linux
- Release mode
- dDOUBLE
- Copy ruud.cpp (see below) into ode/test
- Compile ruud.cpp with 

  gcc ruud.cpp -DdDOUBLE -L ../../lib -lode -L/usr/X11/lib -L/usr/X11R6/lib -lGLU -lGL -L/usr/X11/lib -L/usr/X11R6/lib -lX11 -lm -I../../include

- Output from ./a.out (drum roll please):

Initial matrix:
0.000000 0.000000 1.000000
0.000000 1.000000 0.000000
-1.000000 0.000000 0.000000
post-rel Tx=+:
0.000000 -0.001250 0.999999
-0.000000 0.999999 0.001250
-1.000000 -0.000000 0.000000


================================================

ODE CVS snapshot 24.11.2001:
- Compiled under Linux
- Release mode
- dDOUBLE
- Copy ruud.cpp (see below) into ode/test
- Compile ruud.cpp with 

  gcc ruud.cpp -DdDOUBLE -L ../../lib -lode -L/usr/X11/lib -L/usr/X11R6/lib -lGLU -lGL -L/usr/X11/lib -L/usr/X11R6/lib -lX11 -lm -I../../include

- Output from ./a.out (drum roll please):

Initial matrix:
0.000000 0.000000 1.000000
0.000000 1.000000 0.000000
-1.000000 0.000000 0.000000
post-rel Tx=+:
0.000000 0.001250 0.999999
-0.000000 0.999999 -0.001250
-1.000000 -0.000000 0.000000

===============================================

The test file:

// bug_reltorque.cpp

#include <stdio.h>
#include "ode/ode.h"

static dWorldID world;

void mPrint(const dReal *R,char *s)
{
  printf("%s:\n",s);
  printf("%f %f %f\n",R[0],R[1],R[2]);
  printf("%f %f %f\n",R[4],R[5],R[6]);
  printf("%f %f %f\n",R[8],R[9],R[10]);
}

void BugTest()
{
  dBodyID body;
  dMatrix3 R;

  body=dBodyCreate(world);
  // Initial matrix
  R[0]=0; R[1]=0; R[2]=1; R[3]=0;
  R[4]=0; R[5]=1; R[6]=0; R[7]=0;
  R[8]=-1; R[9]=0; R[10]=0; R[11]=0;
  dBodySetRotation(body,R);
  mPrint(R,"Initial matrix");

  dBodyAddRelTorque(body,50,0,0);
  dWorldStep(world,0.005);
  mPrint(dBodyGetRotation(body),"post-rel Tx=+");
}

int main(int argc,char **argv)
{
  // create world
  world = dWorldCreate();
  BugTest();
  dWorldDestroy (world);

  return 0;
}



More information about the ODE mailing list