[ODE] dBodyGetPosition() returning non-numbers after collision

Geoff Carlton gcarlton at iinet.net.au
Wed Oct 13 12:44:07 MST 2004


This is quite common, and means the object got into a weird state and 
exploded.  The times I've seen it were:
1.) Objects being completely inside other objects.
2.) Joints with invalid or conflicting parameters.  Also connecting 
multiple joints on the same pair of bodies is bad.
3.) Applying invalid or extremely high forces to the object.
4.) Applying invalid or extremely high torques to the object.
5.) Creating the body with an invalid mass or very small mass.  Haven't 
seen this myself, but I imagine it would cause problems.

You said it only happens after the collision (so I presume its created 
and falling properly up to that point).  You could check what info you 
are putting into the contact joint, and make sure it all looks right.  
It may depend on what collision is happening, e.g. sphere-box, 
box-trimesh, etc.  What is the active object and what are you colliding 
against?

I guess you could try a simpler and simpler case, until you have a 
single sphere-trimesh (or whatever), and see if it still happens.  Also, 
you could play with ERP and CFM, and see if that helps the situation.  
Also try it with a fixed small timestep (e.g. 0.01 seconds).

Geoff


Derek Arndt wrote:

> Hey all,
>
> For the past month I've been learning the ways of ODE and attempting 
> to integrate it into my engine, currently though I'm running into a wall.
>
> In my test environment I have a number of static objects and an object 
> I drop from 0,0,0. The static objects basically ignore each other (for 
> collisions and physics) leaving only the object to collide with the 
> scene. One frame after a collision is detected between the map and 
> this object, when I do dBodyGetPosition() on that object, 
> dBodyGetPosition() (or dGeomGetPosition() with the geom) returns 
> 'nan's, or non-numbers. At that frame and beyond no more collisions 
> occur with that object and without any positioning information I am 
> unable to draw the object anymore.
>
> I've spent the last week staring at the examples not finding any fault 
> in my code, but alas I'm still without working physics. Has anyone 
> heard of this happening before? If not I'll be happy to post my source 
> code for my collisions system (although it's anything but short :/).
>
> Thanks in advanced!
> Derek Arndt
>
> /*
> http://www.dereksucks.com _game development is just my forte_
> */
>
>------------------------------------------------------------------------
>
>_______________________________________________
>ODE mailing list
>ODE at q12.org
>http://q12.org/mailman/listinfo/ode
>  
>



More information about the ODE mailing list