resibots / robdyn

Wrapper around ODE to make dynamic simulators for robots
GNU General Public License v2.0
8 stars 3 forks source link

ODE assertion fails #3

Open costashatz opened 8 years ago

costashatz commented 8 years ago

Sometimes when running the ITE experiments I am getting the following error/assertion failure:

ODE INTERNAL ERROR 1: assertion "bNormalizationResult" failed in _dNormalize4() [../../../../../include/ode/odemath.h]

We should fix this.

jbmouret commented 8 years ago

We can't because it is in ODE and not in our code! This is a very classic issue with ODE. The classic fixes are:

In ode/src/odemath.h these two lines (note that the ODE library on our cluster already has this patch).

PURE_INLINE void _dNormalize3(dVector3 a)
{
  int bNormalizationResult = _dSafeNormalize3(a);
  if(bNormalizationResult==false)
    throw(3);
  dIVERIFY(bNormalizationResult);
}

PURE_INLINE void _dNormalize4(dVector4 a)
{
  int bNormalizationResult = _dSafeNormalize4(a);
  if(bNormalizationResult==false)
    throw(4);
  dIVERIFY(bNormalizationResult);
}

This is a dirty way to solve the problem, but it works. If you have time, you can look around if there is an option (like a Cflags, or an configure parameter) that disables these assert.

By the way, do not forget to set ODE in double precision mode with this option: --enable-double-precision (by doing ./configure --enable-double-precision )

jbmouret commented 8 years ago

In addition, if you were thinking about changing our code so that this error never happens, this is not a good idea. We did try for a long time, and we can minimize them, but we can never be sure that these errors will not happen when we use learning/evolutionary algorithms (that will try crazy things!).