# How does ODE determine contact points in Gazebo?

I was looking at the contact points for the Atlas in the DRCsim package. Each foot has 4 contact points at each vertex of the rectangle. I'd like to know how these points are determined. I've tried looking at the ODE code, but C++ isn't my strong suit so I had some difficulty figuring out what was going on. What I understand is that ODE compares the geometries one by one however it's not possible to compare all points so it only compare a select few points. What I'm trying to understand is what basis are those particular points selected? Why does the Atlas have the 4 contacts set up the way they are, and not some additional points on the heel? Can I add them myself?

Thanks.

edit retag close merge delete

Sort by ยป oldest newest most voted

According to the manual ODE approximates the contact between two bodies using a set of contact points. Given two geoms o1 and o2 that potentially intersect, the method dCollide generate these contact points and store them in an array then used to create contact joints. Depending on geoms type a different collision function is called. Usually the number of contact points as well as their order is determined within this latter function. For example in the case of box-plane collision dCollideBoxPlane method is called. It computes up to 4 collision points on the box and orders them based on their collision depth.

I suppose Atlas feet are approximately considered as boxes (check the feet collision meshes), that's why you get only 4 contact points. In ODE there is the possibility to create custom collision functions as callbacks, but I don't know how much effort is needed to change gazebo simulation code.

What you can easily do, instead, to get more collision points is to replace the collision meshes of Atlas feet with a more refined mesh made up by triangles (is easy to create one and export it in an STL file using Blender for instance).

Be careful since each extra contact point added to the simulation will slow it down, so sometimes we are forced to ignore contact points in the interests of speed.

Hope this can help.

more