[ODE] Bug either in ODE or in implementation (more likely?)

Adam D. Moss adam at gimp.org
Thu Mar 17 10:42:12 MST 2005

Sawyer wrote:
> I am trying to use the Gazebo Robot simulator which uses ODE.  For most 
> situations this has worked very well but I am having problems getting 
> reliable sensor returns from trimeshes.
> This issue only occurs when using trimesh support.  The sensors are modeled as 
> rays using ode.  The problem occurs when a ray has multiple collisions with a 
> single (although large and complex) trimesh.  It seems to return the distance 
> of a random collision, ie. not the closest one as would be the expected 
> behavior

ODE doesn't make any guarantees about the order of the contacts returned
or that only the 'closest' contact will be returned -- it's up to you
to sort the contacts by depth if that's what you actually want.

That said, there are some undocumented ODE features that will
probably help you out, that are currently (I believe) specific to
ray-trimesh collisions:

void dGeomRaySetParams (dGeomID g, int FirstContact, int BackfaceCull);
void dGeomRayGetParams (dGeomID g, int *FirstContact, int *BackfaceCull);
void dGeomRaySetClosestHit (dGeomID g, int closestHit);
int dGeomRayGetClosestHit (dGeomID g);

Adam D. Moss   -   adam at gimp.org

More information about the ODE mailing list