[ODE] Some objects pass through other objects

Keith Wiley kwiley at cs.unm.edu
Sat Nov 12 01:33:47 MST 2005


On Nov 12, 2005, at 1:17 AM, Bram Stolk wrote:

> Keith Wiley wrote:
>
>> However, when I drop a canonball into the cup of the pendulum, it   
>> falls right through the pendulum to the ground as if there is no   
>> collision detection going on.  Even weirder, the ball does   
>> successfully collide (and rest against) the pendulum sometimes,  
>> but  not always.  In particular, it falls through the pendulum  
>> under two  specified circumstances.  One, when the cup of the  
>> trebuchet is  resting on the ground (so the canonball drops into a  
>> cup that is  already at ground level, ready for launch).  It  
>> passes right through  and rolls away on the ground.  Two, if I  
>> "trick" it into accepting  the canonball by not adding the  
>> canonball until a moment *after* I  release the trebuchet (so the  
>> cup is already moving upwards and no  longer on the ground when  
>> the canonball is added), then the canonball  gets pushed by the  
>> pendulum and cup for some of the rotation, but  before the  
>> rotation completes, it falls through the pendulum (you can  also  
>> get the pendulum to "accept"
>
> Wow!
> Cool demo!
>
> It works for me (UNSTABLE branch from cvs)
> My observations:
>
> 1) both cases "cup on grnd", "trick", show proper collisions for  
> sphere.
>
> 2) the cup is very jiggly.
>
> 3) in one run, I managed to hit the buggy on its roof *grin*
>    the buggy then proceeded a bit to the wall. Looked great.
>
> My remarks:
>
> - Try the cvs unstable version to see if it works for you as well
>
> - I don't think your "trick shot" is valid: If you introduce new
>   objs, or change positions, you must present them to the sim
>   in a non colliding state. At least, this is what I recall
>   reading in the ode manual.
>
> - This demo could be included in test/ in CVS unstable.
>
>    Bram
>

Thanks.  A few points though.  Like I said, I have two ways of  
constructing the trebuchet: 1. fixed joints between a bunch of  
independent bodies, and 2. two composited bodies consisting of  
multiple geoms each, one for the frame and one for the pendulum.  In  
the code you downloaded, the first method is enabled, which I admit  
works just fine.  The jiggly cup is weird to me.  I don't think I  
understand how to properly use fixed joints yet.

If you want to see the bug in action, fine the following line and  
change it to a 2:

#define TREBUCHET_METHOD 1
becomes
#define TREBUCHET_METHOD 2

That should demonstrate the bug.

Here's what I've figured out about the bug so far.  I have very  
precisely characterized the problem.  The error is occurring in  
dSpaceCollide.  For any pair of geoms whose basic cardinal-aligned  
bounding boxes overlap, dSpaceCollide calls a callback.  Generally,  
as I understand it, the callback, your code, then calls dCollide to  
get a list of contact points, if there are any contacts.

When multiple geoms are grouped into a single body, it is still  
important to test any external geom against all geoms in the body,  
e.g., a canonball against all geoms making up the pendulum (axle,  
arm, counterweight, and all sides of the cup).  However, I believe  
there is a bug in dSpaceCollide.  Sometimes, after detecting a  
collision involving one geom in a body, I think dSpaceCollide doesn't  
bother to consider collisions against other geoms in the same body.   
I can see this very clearly in the debugger because my callback  
doesn't get called for all of the geoms whose bounding boxes overlap  
the canonball's bounding box.

 From frame to frame, where the bounding box overlaps don't really  
change, I can see this bug occur.  In one frame I will get two  
callbacks, one for the arm and one for the back of the cup.  If  
dCollide finds a contact with the arm, I will still get a second  
callback for the cup.  However, if dCollide finds a contact for the  
cup, there is no second callback for the arm, which is why the  
canonball falls through the arm and rolls away.

I'm looking at the code right now trying to find the bug, but I'm  
brand new to ODE and it's taking me a while to decipher the path of  
execution.

________________________________________________________________________
Keith Wiley         kwiley at cs.unm.edu         http://www.unm.edu/~keithw

"I used to be with it, but then they changed what it was.  Now, what I'm
with isn't it, and what's it seems weird and scary to me."
                                            --  Abe (Grandpa) Simpson
________________________________________________________________________




More information about the ODE mailing list