[ODE] Using rays as sensors

Frugier Kevin Kevin.Frugier at insa-lyon.fr
Wed Oct 27 17:53:03 MST 2004


Hi,

I've already tried to ask about it without success. I'll try in a other way this
time.
I'm not trying to play with the dark-side of ODE, I'm simply trying to use rays
and I imagine some of you already know it.

I use a ray as a geom : a line. I don't want to "launch" a ray every frame.
I create a ray with dCreateRay
I "attach" it to a body (the sensor body, that is only a body because I don't
need any collision detection on it).
Then I set the start position and direction of my ray : dGeomRaySet
The sensor body itself is attached by a join to my robot.
( dJointCreateFixed  + dJointAttach + dJointSetFixed ).

If i do a dGeomRayGet i see that everything is as I want at that time.

In my collision detection Callback, if my ray collide another geom, i save the
distance between the start of my ray and the collision point.

If i do a dGeomRayGet i see that everything is as I want at that time.

But as soon as I do my first Worldstep, my ray's direction as changed.
If i do a dGeomRayGet... the direction is (0,0,1) >> the ray that was set to
look in a direction in the (X,Y) plan is now looking up.
The direction as changed, but not the position.

So, what the hell is wrong ?
For me a ray is a geom like others so I dont want to have to set the direction
at each frame. It shouldnt change (in the local axis).

Please, I'm sure rays have no secret for some of you so I hope I'll have answers
this time.

Kevin


More information about the ODE mailing list