RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.27k stars 1.26k forks source link

Lagged and Similar contact models limit stiffness like SAP does in near-rigid regime #21510

Closed jbinagia closed 1 month ago

jbinagia commented 4 months ago

Is your feature request related to a problem? Please describe. My feature request is related to the following problem, described on the Drake slack channel (link).

In short, users of Drake from Amazon Robotics (the Gemini team) would like to use the new Lagged / Similar contact models, for the reasons discussed in the Drake documentation and paper "A Theory of Irrotational Contact Fields" (i.e. Hunt-Crossley dissipation, no gliding artifact in slip, etc.). Unlike the SAP model, these two models exhibit unstable plane-on-plane contact for floating models if the modulus (or stiffness) is too large, e.g. see thread here and the following video:

https://github.com/RobotLocomotion/drake/assets/30089571/66bfb879-4926-4cb2-968c-8cfa53872991

While we can decrease the hydroelastic modulus of our floating models, this creates a new issue of deep penetration when these models are picked up under strong suction (the suction force being much larger than the weight of the model itself). A video illustrating this behavior alongside a simple reproduction in pydrake (using deepnote) is provided in the additional context. Thus, we would like to continue using the modulus value of ~1e6 to prevent deep penetration with suction cups.

The SAP model circumvents the instability shown in the video above by automatically limiting stiffness for near-rigid contact. This allows us to use a modulus large enough to prevent deep penetration between suction cups and floating models while also removing unwanted instability for floating model stacked on top of one another.

Another way to state my request is: I would like to be able to use the Lagged / Similar models without having to re-adjust all the moduli for my models, moduli that presently work well alongside the SAP model.

Describe the solution you'd like According to @xuchenhan-tri, there is nothing inherent in the Lagged and Similar models to prevent giving them the same "stiffness limiting" behavior that the SAP model currently possesses. This is my preferred solution since it provides consistent behavior across the three contact models and is robust for users of the sim; i.e. the sim effectively automatically handles contacts that it knows to be unstable due to poor conditioning in the limit of rigid contact.

Describe alternatives you've considered N/A - although I am open to suggestions.

Additional context

https://github.com/RobotLocomotion/drake/assets/30089571/2f26e171-7c4d-4a70-9f3f-4e57b724afec

https://github.com/RobotLocomotion/drake/assets/30089571/d7ff5a13-eb3e-455e-95c6-09e08bba83b5

amcastro-tri commented 4 months ago

A little update on this:

This is not a problem inherent to kSimilar or kLagged. The same problem does happen with kSap, but it so happens to show up later in the sim. Simply run your example to sim_time=20 (instead of 5) and you will also see it with kSap.

Regularization is not the reason for differences. At E=1e6, regularization almost plays no effect (except for a few triangles). The differences are due to different dynamics in the model. At the (very) large dissipation used for the kSap model, things just happen at a slower rate.

Also, geometry plays an important role. The problem happens much more slowly as we use a smaller resolution hint for the cylinder. Still the problem shows up if we run long enough.

For additiona info, I verified that we get a fan of these many triangles for the cicular bases of the cylinder:

I am still investigating, but this seems a curious problem with the hydro representation used for these geometries. @SeanCurtis-TRI and @DamrongGuoy might want to also take a look at this.

jbinagia commented 4 months ago

@amcastro-tri Thanks for looking into this - I just wanted to make an important clarification. I agree that regularization plays no role in the deep penetration issue. My point was that that with kSap, deep penetration is completely avoided by using a modulus E = 1e6. For kSimilar and kLagged, E = 1e6 cannot be used because those models do not apply regularization for near-rigid contact (recall our earlier thread here where that was discussed in the context of two floating models making plane-on-plane contact due to gravity). I updated the original request to make this more clear.

SeanCurtis-TRI commented 4 months ago

@amcastro-tri I'm not sure what you're referring to by "a fan of these many triangles for the circular bases of the cylinder"?

Can you provide guidance for what @DamrongGuoy or I would need to do to observe what you're talking about? Otherwise, there's nothing much we can do to shed any further light.

amcastro-tri commented 4 months ago

@SeanCurtis-TRI, I suggest you run the deepnote, it's much easier to understand if you see the video (ah, the video is on Slack if that's faster. See link above).

You will see that the resolution hint leads to a very coarse discretization of the cylinder (a box really). This should not be a problem in theory. However you will see that, regardless of the contact approximation used (kSap, kSimilar, or kLagged), the box start experiencing an instability. This instability is the result of forces (and torques) that are not symmetric. That alone is fine, but surprisingly as the sim progresses we never reach a steady state with the box in a horizontal position.

TBH I cannot grok why that'd be the case.

SeanCurtis-TRI commented 4 months ago

@amcastro-tri If you want us to comment on something specific then you should fuel that comment with something *specific".

  1. The deepnote linked doesn't run successfully without being edited (Ecombined is commented out in the first block but used in the fourth).
  2. The videos in slack don't highlight the thing I think you want me to comment on. And if one does, I'm not sure which one does because there are multiple videos in that conversation.

All that aside, and having run the simulation and observed the visualization, it seems you're trying to make a point about the tessellated cylinder.

amcastro-tri commented 3 months ago

Sorry for the trouble @SeanCurtis-TRI. I only pinged you gusy because I found the behaviour "curious" at least. I figured you guys would find this curious as well. No action item thus far, just food for thought for the moment.

amcastro-tri commented 1 month ago

The problem here essentially that we'd like to increase stiffness to model these suction cups. However this leads to instablities for flat contact surfaces. This is best described in #21514. Therefore I am closing this issue since ##21514 does a better job at describing the actual problem.