Drake
Drake C++ Documentation
Contact Modeling in Drake

Detailed Description

Mechanics of Solids

All objects in real life are compliant and deform under the action of external loads. Deformations, as well as motion, of real life solids are well described by the theory of continuum mechanics, which provides a complete description of the full three-dimensional state of stress and deformation given a set of external loads and boundary conditions. Broadly, how compliant a solid is depends on the material (or materials) it is made of. Factors such as microstructure, imperfections, anisotropy, etc. affect the behavior of a material. Ultimately, in continuum mechanics, the behavior of a particular material can be boiled down to its stress-strain curve, or constitutive law describing the stress/strain relationship at each point within a solid composed of that material. The simplest constitutive law is that of Hooke's law, describing the behaviour of materials which exhibit a linear-elastic region in the stress-strain curve. Materials such as steel and aluminum can be modeled as Hookean, as long as strain is within the elastic range (< 1% strain for steel for example). Other materials such as rubber are hyperelastic and are best described by a Neo-Hookean law. The stiffness of a material essentially refers to how steep this stress-strain curve is. The steeper the slope of the stress-strain curve, the stiffer a material is. For Hookean materials, this translates to a larger Young's modulus (the slope of the stress-strain curve in the linear regime).

Contact Mechanics

Contact mechanics refers to the study of the deformations that solids undergo as the result of contact loads. The study of contact mechanics dates back to the pioneering work of Heinrich Hertz in 1882. The Hertzian theory of contact describes the loads and deformations when strains are small, the contacting surfaces are much smaller than the overall dimensions of the contacting bodies and the materials are linear (i.e. are described by the Hookean law).

In general, when two solids come into contact, they inevitably must undergo deformation in order to avoid the physical impossibility of interpenetration. This constraint is described by the Signorini boundary condition, which at each point in the contact surface imposes a complementarity constraint between normal stress and penetration (described by a gap function). Stresses on the contact surface are the result of these deformations.

Ultimately, contact forces are the result of integrating these contact stresses on the contact surface between the solids.

Rigid Approximation of Contact

A rigid body is an approximation to the general mechanics of solids in the mathematical limit to infinite stiffness. This mathematical approximation has been used extensively in the past for the simulation of multibody systems with contact. As an approximation to the real physical system, it leads to known problems such as indeterminate systems. Consider for instance a rigid beam supported by its two end points and by a third point of support right in the middle, through its center of gravity. Under the action of its own weight, infinite solutions to the static problem exist.

Rigid contact with Coulomb friction is a common approximation used in simulation as well. It has its own limitations, most notable the possible non-existence of a solution. An example of this is the well known Painlevé paradox [Pfeiffer & Glocker, 1996], a one degree of freedom system with only one contact that, depending on the state, has an infinite number of solutions or even no solution.

It should be noted that these artifacts are a consequence of the mathematical approximations adopted and not a flaw of the original continuum mechanics theory and even much less, a flaw in the physics itself.

Why so Rigid? Embracing Compliance

The rigid modeling of contact coupled with Coulomb friction is plagued with a wide variety of technical issues:

The literature on this topic is very rich, and there has been a great deal of effort to solve many of these problems. Unfortunately, most solutions involve the introduction of heuristics or tuning parameters hidden within the solvers that introduce yet new artifacts or trading off robustness/speed for physical accuracy.

As an example, constraint softening is introduced "...to control the sponginess and springiness..." (quoting from the [ODE User Guide]). This strategy is used to improve the numerics of the solver, which no longer approximates a true rigid system, but a compliant one. Similarly, Interior Point (IP) methods for general NCPs or more recently Incremental Potential Contact (IPC) in [Li et al., 2020], introduce barrier functions to handle constraints. These barriers can only be solved to a finite accuracy, at which the solution is essentially compliant (even if stiff). This is discussed in more detail in [Castro et al., 2023].

Compliance in Robotics

Many robots are actually compliant in the real hardware — robotic grippers and fingers are padded to improve grasping efficiency, and robot feet as those commonly found in quadrupeds and humanoid robots have rubber surfaces. Therefore, compliance must be modeled if our goal is physical accuracy to close the sim2real gap.

Embracing Compliance

The discussion above can be probably summarized as follows:

  1. The rigid approximation of contact leads to fundamental problems in the mathematics and ill-conditioned numerics in software.
  2. Real physical systems are compliant, even if stiff.
  3. Numerical techniques to deal with ill conditioning essentially boil down to introducing compliance at some level deep within the solver.

It is for these reasons that in Drake we embrace compliance, to provide accurate modeling of the physics of contact but also as a means to mitigate numerical problems associated with rigid approximations of contact. Within this framework, rigid contact can be approximated with very stiff compliance. As shown in [Castro et al., 2023] this technique is very effective even at very high stiffness values, beyond what it is really needed to model hard materials such as steel. In this way the modeling of contact is transparent to users, with physical parameters to control compliance and no need for hidden parameters in our solvers.

Read more about Drake's modeling of compliant contact in the next section, Modeling Compliant Contact.

Next topic: Modeling Compliant Contact

References

Modules

 Modeling Compliant Contact
 
 Modeling of Dry Friction
 
 Margin for Hydroelastic Contact
 In Drake, multibody systems with frictional contact are simulated via a discrete approximation, see Discrete Models for Simulation (while Drake also offers Continuous Models for Simulation, currently the discrete approximation performs best.) The accuracy of these discrete approximations depends on the selected time step size h.
 
 Estimation of Hydroelastic Parameters
 Similarly to Hertz theory of contact mechanics, in this section we derive analytical formulas to estimate the elastic force that establishes between two bodies in contact.