Perfectly inelastic collision not possible because contact joints can only produce outward forces

16 views
Skip to first unread message

Dean Brettle

unread,
Oct 11, 2024, 7:03:32 PM10/11/24
to ode-users

 If I collide 2 bodies with bounce = 0 and the ERP and CFM for the contact joint set (using the damped spring model for the contact joint) such that the damped spring is not underdamped, the collision should be inelastic (i.e. the bodies should stick to each other). However, this does not occur. Instead, the initial penetration is stopped and reverses (as expected) but the outward speed never goes down. It increases up to a maximum velocity and then they “bounce” off of each other at that velocity. This appears to be because the force solved for at the contact joint is currently required to be outward here:

 // set LCP limits for normal 
pairLoHi[ROW_NORMAL * pairskip + GI2_LO] = 0;
pairLoHi[ROW_NORMAL * pairskip + GI2_HI] = dInfinity;

It seems like that should be:

// set LCP limits for normal
pairLoHi[ROW_NORMAL * pairskip + GI2_LO] = -dInfinity; pairLoHi[ROW_NORMAL * pairskip + GI2_HI] = dInfinity;

Am I missing something?

Full disclosure: I haven’t reproduced the problem using the current development version of ODE, but I was able to reproduce the problem in Webots (which uses a fork of an older version of ODE), and confirmed that the problem is fixed by a change to Webots' ODE that appears to be equivalent to the above proposed change. I’m posting here because looking at the current ODE source code appeared to reveal the same issue. Is there a good reason that it is the way it is? Would the proposed fix have undesirable side effects?

Thanks!

Oleh Derevenko

unread,
Oct 13, 2024, 12:46:26 PM10/13/24
to ode-...@googlegroups.com
Dean,

I can add a new bit for mode in dSurfaceParameters and allow negative limit with it. This way, you will be able to set the custom low limit only where necessary and all the rest joints will remain unaffected.
Do you (or anyone) know what value units these limits apply to? I. e., can user select a meaningful finite value there or just the minus infinity?

Oleh Derevenko

-- Skype with underscore

 


From: ode-...@googlegroups.com <ode-...@googlegroups.com> on behalf of Dean Brettle <dean.b...@gmail.com>
Sent: Saturday, October 12, 2024 1:50
To: ode-users <ode-...@googlegroups.com>
Subject: [ode-users] Perfectly inelastic collision not possible because contact joints can only produce outward forces
 
You don't often get email from dean.b...@gmail.com. Learn why this is important
--
You received this message because you are subscribed to the Google Groups "ode-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ode-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ode-users/f3c5228b-a729-41ee-a731-75bf5df7cc54n%40googlegroups.com.



This e-mail may contain privileged and confidential information. If you are not the intended recipient, be aware that any use, disclosure, copying or distribution of this e-mail or any attachments is prohibited. If you have received this e-mail in error, please notify us immediately by returning it to the sender and delete this copy from your system. Thank you.

Oleh Derevenko

unread,
Oct 18, 2024, 7:52:04 AM10/18/24
to ode-...@googlegroups.com
Dean, if you are not communicating I see little sense in adding this change for you as, anyway, you will probably ignore it and my work will be wasted.

Oleh Derevenko

-- Skype with underscore

 



From: 'Oleh Derevenko' via ode-users <ode-...@googlegroups.com>
Sent: Sunday, October 13, 2024 19:46
To: ode-...@googlegroups.com <ode-...@googlegroups.com>
Subject: Re: [ode-users] Perfectly inelastic collision not possible because contact joints can only produce outward forces
 

Dean Brettle

unread,
Oct 18, 2024, 9:28:09 AM10/18/24
to ode-...@googlegroups.com
Very sorry Oleh. I've been testing the change within the Webots version and looking into the fallout. It certainly effects normal collisions where bounce > 0 and it caused several tests to fail. I've been trying to fix one of those tests and that has taken me down an entirely different rabbit hole leading to a separate possible bug in collision handling that I'll post about in a separate thread.

As far as the original collision issue and possible fix is concerned, I recommend waiting to apply the fix until a more thorough investigation is complete. I'll let you know if/when I have more info. Many thanks for your help and apologies again for my slow response.


Oleh Derevenko

unread,
Oct 18, 2024, 4:28:47 PM10/18/24
to ode-...@googlegroups.com
I'm not going to change it unconditionally like you described it. I would add another flag for Contact Joint and you would get the negative limit only for that single joint you set the flag for.


Oleh Derevenko

-- Skype with underscore

 


From: ode-...@googlegroups.com <ode-...@googlegroups.com> on behalf of Dean Brettle <de...@brettle.com>
Sent: Friday, October 18, 2024 16:27

To: ode-...@googlegroups.com <ode-...@googlegroups.com>
Subject: Re: [ode-users] Perfectly inelastic collision not possible because contact joints can only produce outward forces
 
You don't often get email from de...@brettle.com. Learn why this is important

Dean Brettle

unread,
Oct 18, 2024, 5:15:47 PM10/18/24
to ode-users
> I'm not going to change it unconditionally like you described it. I would add another flag for Contact Joint and you would get the negative limit only for that single joint you set the flag for.

Understood, and it's quite possible that a special flag like you describe will be needed. I'm just still holding out hope that there is some more general solution that supports both elastic and inelastic collisions accurately. Another option that might be worth considering is only setting the lo limit to -dInfinity when bounce = 0.

Regarding your earlier questions:

> Do you (or anyone) know what value units these limits apply to? I. e., can user select a meaningful finite value there or just the minus infinity?

I believe the limits are in units of force (e.g. Newtons) because I think they are limits on lambda and and lambda has units of force when dealing with contact joints. So, a finite value of -F would mean don't apply an inward force of magnitude greater than F when enforcing the contact joint constraints. Off hand I can't imagine a situation where one would want to specify F, so if it were me, I'd just always use -dInfinity until someone demonstrates a need. Your call, obviously.

Fyi, whatever you decide to do (or not do) is unlikely to impact me because I'll need to implement my own fix in the webots version of ode anyway.

--Dean

Oleh Derevenko

unread,
Oct 18, 2024, 5:55:43 PM10/18/24
to ode-...@googlegroups.com
It makes sense to make changes only if somebody needs them. If you have another independent ODE there and you are not going to upgrade to a newer version from ODE repository, just be doing what you are doing, and I'll be doing what I need to be doing for myself. I'm not jealous. 🙂

Oleh Derevenko

-- Skype with underscore

 



Sent: Saturday, October 19, 2024 0:15
To: ode-users <ode-...@googlegroups.com>

Fyi, whatever you decide to do (or not do) is unlikely to impact me because I'll need to implement my own fix in the webots version of ode anyway.



Reply all
Reply to author
Forward
0 new messages