# [ODE] detecing sliding wheels?

Chris Ledwith cledwith at d-a-s.com
Sat Jun 3 15:22:14 MST 2006

```>> Would this work? Is there an ODE API call to detect a sliding contact?
>> What would be the best approach for this?
>>
>
> I don't think there is a sliding contact call in ODE per se, but since you
> can obtain the "ground" geom that the wheel's geom is in contact with from
> the array of dContactGeom structure filled in by dCollide(), you can then
> get the body that "ground" geom belongs to. Then you can get the linear
> velocity of that body (the physical truck) and subtract it from the car's
> linear velocity to get the relative linear velocity.
>

One correction: given angular velocity, w, and distance, r, from the
center of the rotation to the point in question, the linear velocity of a
point is v = rw, so it would be better to use dBodyGetRelPointVel or
dBodyGetPointVel to get the actual linear velocity of the point on the
other body that the wheel is in contact with. Imagine if the car were
driving along the outer rim of a really large carousel - the carousel body
would have no linear velocity, but the point on the carousel would, by
virtue of the carousel's angular velocity. This of course also applies to
the truck if it were spinning, but to a far lesser extent.

-C

```