[ODE] Introducing myself... and a possible bug

Ignacio García Fernández ignacio.garcia at uv.es
Mon Nov 3 12:51:02 MST 2003


Hi!

This is my first post to the list, so I'll start introducing myself. My
name is Ignacio García-Fernández, I come from Spain and work in dynamic
simulation of heavy vehicles and cranes.

I generally develop my own code, but use som parts of ode, mainly for
collision detection.

In my first post, I'd like to report a problem I found. I didn't find
any other place to report it, so I decided to tell about this here.

The problem appeared whe detecting the collision between a pair of boxes.
I they are almost parallel and collide edge against edge the contact point
is detected somewhere in the common edge but far away from the boxes.

Debugging the collision routines, I found a division by something almost zero
in the file collision_util.cpp

@@ -78,8 +78,8 @@
   dReal q1 =  dDOT(ua,p);
   dReal q2 = -dDOT(ub,p);
   dReal d = 1-uaub*uaub;
-  if (d <= 0) {
-    // @@@ this needs to be made more robust
+  if (d <= 0.0001) {
+    // @@@ this needs to be made more robust                   <
     *alpha = 0;
     *beta  = 0;
   }

if d is not found to be least or equal to zero, then alpha and beta are
computed using 1.0/d. If d is small enough the computed values are not right.

I've patched it as shown before... but probably "it should be made more
robust" ;)  Indeed, after patching If still found situations when the
collision point is somewhere outside both boxes.

I've seen that this appears in all versions of collision_util.cpp

Hope it helps

Regards

Ignacio


-- 
May the source be with you
--------------------------------------------------------------------
Ignacio García Fernández                       Instituto de Robótica
<ignacio.garcia_at_uv.es>                    Universidad de Valencia
http://robotica.uv.es/~ignacio/                     Tlf. 96 354 3564


More information about the ODE mailing list