Please update to ode-0.10.1 with double arithmetic

Bug #303759 reported by Chris Bainbridge
6
Affects Status Importance Assigned to Milestone
ode (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Please update to ode-0.10.1 which includes the following fix:

"Applied patch #1851394: support for GIMPACT with double precision, dCollide fix. " from http://opende.sourceforge.net/mediawiki-1.6.10/index.php/Changelog

This means ode can be updated to use double precision arithmetic.

Revision history for this message
Gonéri Le Bouder (goneri) wrote :

Hi,

I just uploaded a ode-0.10.1 package with double precision in Debian experimental.

Cheers,

    Gonéri

Revision history for this message
Chris Bainbridge (chris-bainbridge) wrote :

I tried this experimental package with pyode - it gives an error with ode.collide:

ODE INTERNAL ERROR 2: colliders array not initialized in dCollide()

From http://groups.google.com/group/ode-users/browse_thread/thread/fec5ae54b2145258?pli=1 it appears that pyode is not calling dInitODE() - a quick grep through the pyode source confirms this string doesn't appear anywhere. It also seems ode-0.10 programs have to call dCloseODE() when they're finished using ode.

Revision history for this message
Chris Bainbridge (chris-bainbridge) wrote :

These calls are documented here:
http://opende.sourceforge.net/mediawiki-1.6.10/index.php/Manual_(Support_Functions)

Seems to be new functions in ode-0.10 for multi-thread support.

The source notes "dInitODE is obsolete. dInitODE2 is to be used for library initialization."

Looks like a new release of pyODE is needed.

Revision history for this message
Ethan Glasser-Camp (ethan-glasser-camp) wrote :

Hi,

I'm playing with the experimental version of ode-0.10 in the hopes of building a new PyODE but keep running into problems. It's been a while since I played with this code, so please forgive me if I'm making a n00b mistake. I put together a simple program (attached) to do a few sanity checks on the ODE package from experimental. But when I run it, I get:

Mass=0.000000
Cg=(0.000000, 0.000000, 0.000000)
I11=0.000000 I22=0.000000 I33=0.000000
I12=0.000000 I13=0.000000 I23=0.000000

ODE Message 2: mass must be > 0 in dMassCheck() File mass.cpp Line 49
Mass=39.293915
Cg=(-0.000000, 0.000000, 0.000000)
I11=0.000000 I22=-27874.882812 I33=0.000000
I12=0.000000 I13=0.000000 I23=-0.000000

ODE INTERNAL ERROR 2: Bad argument(s) in dWorldDestroy()
Aborted

As far as I can tell, the attached code is valid. When built and run against the old libode0debian1 (0.9), it prints out the following:

Mass=0.000000
Cg=(0.000000, 0.000000, 0.000000)
I11=0.000000 I22=0.000000 I33=0.000000
I12=0.000000 I13=0.000000 I23=0.000000
Mass=83.775810
Cg=(0.000000, 0.000000, 0.000000)
I11=33.510326 I22=33.510326 I33=33.510326
I12=0.000000 I13=0.000000 I23=0.000000

Thoughts?

Ethan

Revision history for this message
Chris Bainbridge (chris-bainbridge) wrote :

Interesting... This one took a while to figure out. The ODE header files default to #define dSINGLE (at the top of odeconfig.h). It is odd that the header file isn't just fixed to dDOUBLE - I can't see any real advantages of being able to compile dSINGLE code against the headers when the library is dDOUBLE, and linking against it will confuse people with these odd errors. Anyway, try compiling with:

g++ $(ode-config --cflags) -o tutorial1 $(ode-config --libs) tutorial1.c

Incidentally, `ode--config --shared-libs` gives an error:
/usr/bin/ld: cannot find -lode@so_ext@
Obviously it has not included the SONAME version that is supposed to have changed in this release.

Revision history for this message
Ethan Glasser-Camp (ethan-glasser-camp) wrote :

Thanks. The numbers are different from what they were in the old version of ODE, but never mind. Now I'm trying to build a python extension using Pyrex and hitting similar errors. I modified setup.py to include the ode-config calls that you have, above, and easy_install seems to be compiling correctly:

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wall -g -O2 -O0 -fPIC -I/usr/include -I/usr/local/include -I/opt/local/include -I/usr/include/python2.5 -c ode_trimesh.c -o build/temp.linux-i686-2.5/ode_trimesh.o -I/usr/include -DdDOUBLE
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wall -g -O2 -O0 build/temp.linux-i686-2.5/ode_trimesh.o -L/usr/local/lib -L/opt/local/lib -lode -lstdc++ -o build/lib.linux-i686-2.5/ode.so -L/usr/lib -lode

But when I import this module and call setSphere in the same way, I still get

ODE Message 2: mass must be > 0 in dMassCheck() File mass.cpp Line 49

with random mass values in the results. Trying to track this down, I started to grovel in the generated source code (ode_trimesh.c). If I print the values of the arguments that are getting sent to dMassSetSphere, they look right -- 2500.0, 0.05. Strangely enough, if I print *before* the call to dMassSetSphere, the error goes away. If I print *after*, the error is still there.

I rebuilt ode with debugging symbols, and pyode with my modifications. Check this fascinating gdb transcript:

Breakpoint 1, dMassSetSphere (m=0xb7cf0f78, density=2.0463635885232469e-13, radius=-0.12512883157955856) at mass.cpp:121
121 radius*radius*radius * density), radius);
Current language: auto; currently c++
(gdb) print radius
$1 = -0.12512883157955856
(gdb) print density
$2 = 2.0463635885232469e-13
(gdb) up
#1 0xb7b0c6fb in __pyx_f_3ode_4Mass_setSphere (__pyx_v_self=0xb7cf0f70, __pyx_args=0xb7cc414c, __pyx_kwds=0x0) at ode_trimesh.c:567
567 dMassSetSphere(m, 2500.0, 0.05);
Current language: auto; currently c

The only thing that seems odd about this is the change of languages. I tried rebuilding python-pyode using g++, but I get a ton of compilation errors. Thoughts?

Ethan

Revision history for this message
Chris Bainbridge (chris-bainbridge) wrote :

I haven't looked at compiling 0.10.1 PyODE wrappers yet. Having said that, PyODE and ode-0.9 worked fine - I've been using it with double precision for a long time and no errors. So, pyrex can generate code that works fine with the double-precision ODE. I tracked down some other reports on the internet where the dMass errors were caused by the single/double precision confusion - are you sure you have eliminated all code using single precision?

Revision history for this message
Ethan Glasser-Camp (ethan-glasser-camp) wrote :

Yeah, that was it. Thanks. You should be able to build a new python-pyode from CVS now and get double precision (but I still haven't implemented support for some of the other stuff in ODE, like dMassSetTrimesh, etc.).

Ethan

Revision history for this message
Gonéri Le Bouder (goneri) wrote :

Fixed in Debian with ode 0.11-4.

Revision history for this message
Chris Bainbridge (chris-bainbridge) wrote :

Cool, how does the package get to Ubuntu? It would be nice for this to work in Jaunty.

Revision history for this message
Arc "warthog" Riley (arcriley) wrote :

Please do not build libraries with non-default flags such as this. If you're going to do this, build separate shared libs with the different options.

Revision history for this message
Gonéri Le Bouder (goneri) wrote :

We provide libode-sp-dev (single precision) and libode-dev.

Jackson Doak (noskcaj)
Changed in ode (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.