Drake
Working with Contacts in Drake
Collaboration diagram for Working with Contacts in Drake:


This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.

The behavior of a simulation with contact will depend on three factors:

• the choice of integrator,
• contact parameters,
• nature of collision geometry.

The three factors are interdependent; specific choices for one factor may require supporting changes in the other factors.

## Contact Parameters

### Parameters

The determination of contact forces is a combination of per-object contact material parameters and global model parameters. See The Details of Computing Contact Forces for elaboration on the parameters.

Per-object Contact Material Parameters

• Young's modulus, E, (with units of pascals, i.e., N/m²) is the tensile elasticity of the material. It may also be referred to generally as "elasticity" or colloquially as "stiffness".
• Generally, these values can be looked up in a table. Typical values are quite large ranging from soft rubber at 1×10⁷ N/m² to diamond at 1.2×10¹² N/m².
• The default value is that of medium rubber: 1×10⁸ N/m².
• dissipation, d, (with units of 1/velocity) is a material property that correctly reproduces the empirically observed velocity dependence of the coefficient of restitution, where e = (1-d⋅v) for small impact velocity v.
• In theory, at least, d can be measured right off the coefficient of restitution-vs.-impact velocity curves; it is the negated slope at low impact velocities. In practice, the curve is difficult to produce and very little data exists to provide physical values.
• [Hunt 1975] reports values of d between 0.08-0.32 sec/m for steel, bronze or ivory. From this, we advocate relatively small values.
• The default value is 0.32 sec/m.
• coefficient of static friction, μ_s, (unitless) is the standard Coulomb coefficient of friction for a body with zero relative motion.
• The coefficient of static friction must be greater than or equal to the coefficient of dynamic friction.
• The default value 0.9.
• coefficient of dynamic friction, μ_d, (unitless) is the standard Coulomb coefficient of friction for a body with non-zero relative motion.
• The coefficient of dynamic friction must be less than or equal to the coefficient of static friction.
• The default value is 0.5.

Global Model Parameters

• slip velocity, vₛ, (with units of m/s) determines the behavior of contact bodies during stiction. Essentially, stiction is approximated. When bodies should be in stiction, the model allows the contacting points a relative slip velocity up to this value. See tangent_force for details.
• The default value is 0.01 m/s.
• characteristic radius, R, (with units of m) defines a characteristic contact patch scale. See Drake Contact Implementation for details. This defines a circular contact patch with area πR².
• The default value is 0.2 mm (e.g., 2×10⁻⁴ m).

### Issues with Parameter Values

• Contact Material Parameters

With the exception of the dissipation parameter, the values for material parameters should be predicated on realistic values. The majority of these values can and should be looked up in tables. The goal is for these physical quantities to remain meaningful and constant while the underlying contact model implementation improves and makes better use of them.

As for the dissipation parameter, we generally recommend leaving it at the default value unless there's particular insight and principle in changing it.

• Picking a good value for vₛ

In selecting a value for vₛ, you must ask yourself the question, "When two objects are ostensibly in stiction, how much slip am I willing to allow?" There are two opposing design issues in picking a value for vₛ. On the one hand, small values of vₛ make the problem numerically stiff during stiction, potentially increasing the integration cost. On the other hand, it should be picked to be appropriate for the scale of the problem. For example, a car simulation could allow a "large" value for vₛ of 1 cm/s (1×10⁻² m/s), but reasonable stiction for grasping a 10 cm box might require limiting residual slip to 1×10⁻³ m/s or less. Ultimately, picking the largest viable value will allow your simulation to run faster.

• Picking a good value for R

One of the quirks of the implemented contact model, is that is largely unaware of the size of the contact surface between bodies. However, the contact force depends on that area. This global setting allows you to hint to the model the size of the contact patches; larger contact patches produce larger contact forces. For example, a small toy tire on a table has a much smaller contact patch than full-size tires on a road. Even if we assume the same rubber, the full-size tires would experience a larger contact force (all other factors being equal). Rather than increasing the Young's modulus for the car's tires (as compared to the rubber ball), we recommend increasing the characteristic radius in the contact model. As a word of warning, don't think of this characteristic radius as corresponding to a literal measure of the real world. The default size corresponds closely with a point contact (where the contact is roughly the area of the head of a pin). This small contact area is sufficient for manipulation even though it does not reasonably represent the physical world. If the forces seem weak, increase the characteristic size, but only increase it to the smallest value that gives sufficient forces; making it larger will make the forces stiffer which will lead to a more computationally expensive simulation.

## Choice of Integrator

Empirical evidence suggests that any integrator except ExplicitEulerIntegrator can work with this contact model. Generally, the RungeKutta2Integrator and SemiExplicitEulerIntegrator require similar time steps to produce equivalent behavior. Generally, for a vₛ value of 1e-2 m/s, a timestep on the order of 1e-4 is required for both of these. The error-controlled RungeKutta3Integrator will choose very small steps and accuracy must be set tight enough to ensure stability. There is also a first-order, fully-implicit integrator: ImplicitEulerIntegrator that can be considered for handling stiff systems.

## Choosing the Right Collision Geometry

The compliant point contact model only reports a single contact between bodies. More particularly, the contact is characterized by a single point. The point is associated with a characteristic area in the model (see above). This has two implications:

• Sampled contact area

Increasing the area associated with the point will increase the magnitude of the contact force. An alternative solution is to increase the number of collision geometries associated with a body such that each point corresponds to a smaller portion of the body's surface area. This essentially changes the interpretation of the point to be closer in line with a smaller characteristic area.

This would have particular value if your simulation scenario has contacts of disparate scales. A single, global characteristic radius may be insufficient. By increasing the samples on large contact patches, those contact points will be compatible with the smaller characteristic area which works for the small contact patches.

• Surface-on-surface contacts

If the contact between bodies is better characterized as a surface instead of a point (such as one box lying on another), the contact point will

• not be guaranteed to be at the center of pressure, possibly inducing unrealistic torque, and
• not be temporally coherent. This will lead to instability artifacts which can only be addressed through smaller time steps.

Both of these issues can be addressed by changing the geometry that represent the body's contact surface. For some shapes (e.g., boxes), we can introduce two sets of collision elements: discrete "points" at the corners, and a box capturing the volume (see block_for_pick_and_place.urdf as an example). With this strategy, the contact "points" are actually small-radius spheres. The volume-capturing box should actually be inset from those spheres such that when the box is lying on a plane (such that the logical contact manifold would be a face), only the contact points make contact, providing reliable points of contact. However, for arbitrary configurations contact with the box will provide more general contact.

Next topic: The Details of Computing Contact Forces