Drake
CompliantMaterial Class Reference

The set of per-object compliant material parameters with one material applied to each collision object. More...

#include <drake/attic/multibody/rigid_body_plant/compliant_material.h>

Public Member Functions

 CompliantMaterial ()=default
 Constructs a default material. More...
 
 CompliantMaterial (double youngs_modulus, double dissipation, double static_friction, double dynamic_friction)
 Constructs fully specified material. More...
 
CompliantMaterialset_youngs_modulus (double value)
 Set the value for Young's modulus. More...
 
double youngs_modulus (double default_value=kDefaultYoungsModulus) const
 Extract the value for Young's modulus with an optional default value. More...
 
bool youngs_modulus_is_default () const
 Reports if the elasticity value is configured to use a default. More...
 
void set_youngs_modulus_to_default ()
 Reset the elasticity value to report the default value. More...
 
CompliantMaterialset_dissipation (double value)
 Set the dissipation value. More...
 
double dissipation (double default_value=kDefaultDissipation) const
 Extract the dissipation value with an optional default value. More...
 
bool dissipation_is_default () const
 Reports if the dissipation value is configured to use a default. More...
 
void set_dissipation_to_default ()
 Reset the dissipation value to report the default value. More...
 
CompliantMaterialset_friction (double value)
 Sets both coefficients of friction to the same value. More...
 
CompliantMaterialset_friction (double static_friction, double dynamic_friction)
 Sets the two coefficients of friction. More...
 
double static_friction (double default_value=kDefaultStaticFriction) const
 Extract the static friction coefficient with an optional default value. More...
 
double dynamic_friction (double default_value=kDefaultDynamicFriction) const
 Extract the dynamic friction coefficient with an optional default value. More...
 
bool friction_is_default () const
 Reports if the friction values are configured to use a default. More...
 
void set_friction_to_default ()
 Reset both friction coefficient values to report the default value. More...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 CompliantMaterial (const CompliantMaterial &)=default
 
CompliantMaterialoperator= (const CompliantMaterial &)=default
 
 CompliantMaterial (CompliantMaterial &&)=default
 
CompliantMaterialoperator= (CompliantMaterial &&)=default
 

Static Public Attributes

static const double kDefaultYoungsModulus = 1e8
 
static const double kDefaultDissipation = 0.32
 
static const double kDefaultStaticFriction = 0.9
 
static const double kDefaultDynamicFriction = 0.5
 

Detailed Description

The set of per-object compliant material parameters with one material applied to each collision object.

The material parameters include:

  • Young's modulus with units of pascals (i.e.,N/m²). This is a measure of the tensile elasticity of the material and, as such, may also be referred to as "elasticity" or, occasionally, "stiffness". The default value is that of a hard rubber: 1e8 pascals.
  • dissipation with units of s/m (i.e., 1/velocity). Its default value is 0.32, drawn from the Hunt-Crossly 1975 paper representing the dissipation for ivory.
  • coefficients of friction (static and dynamic). Unitless values with default values of 0.9 for the static coefficient of friction and 0.5 for the dynamic coefficient.

Each collision geometry is associated with compliant contact material properties. The value of properties can be explicit or default.

Explicit values are those values that are explicitly set (via the API or in a source specification file – e.g., URDF or SDF). When queried, the property set with explicit values will always report the explicit value.

Default values are left "open". For default values the context in which the property value is queried matters. Material properties set to be "default" will return the hard-coded default value or a user-provided default value. Thus, two different invocations on the same instance can provide different values iff the property is configured to be default, and the different invocations provide different default values.

Using the dissipation property to provide a concrete example:

// Constructor sets all properties to be default configured.
material.dissipation(); // Reports the hard-coded default value.
material.dissipation(1.2); // Reports the provided default value, 1.2.
material.set_dissipation(10); // dissipation is no longer default.
material.dissipation(); // Reports the explicit value, 10.
material.dissipation(1.2); // Reports the explicit value, 10.

See drake_contacts for semantics of these properties for dynamics.

Constructor & Destructor Documentation

◆ CompliantMaterial() [1/4]

CompliantMaterial ( const CompliantMaterial )
default

◆ CompliantMaterial() [2/4]

◆ CompliantMaterial() [3/4]

CompliantMaterial ( )
default

Constructs a default material.

◆ CompliantMaterial() [4/4]

CompliantMaterial ( double  youngs_modulus,
double  dissipation,
double  static_friction,
double  dynamic_friction 
)

Constructs fully specified material.

Will throw an exception in any of the following circumstances:

  • youngs_modulus <= 0
  • dissipation < 0
  • static_friction < 0
  • dynamic_friction < 0
  • static_friction < dynamic_friction

No value will be configured to use default values.

Member Function Documentation

◆ dissipation()

double dissipation ( double  default_value = kDefaultDissipation) const

Extract the dissipation value with an optional default value.

The default value is checked in Debug build.

Parameters
valueThe dissipation value with units of 1/velocity, i.e., s/m.

◆ dissipation_is_default()

bool dissipation_is_default ( ) const

Reports if the dissipation value is configured to use a default.

A newly constructed instance will report true. Furthermore, it must return true if set_dissipation_to_default() has been called and false if set_dissipation() has been called.

◆ dynamic_friction()

double dynamic_friction ( double  default_value = kDefaultDynamicFriction) const

Extract the dynamic friction coefficient with an optional default value.

The default value is checked for non-negativity in Debug build.

If the caller provides a default value for accessing static and dynamic friction, it is the callers responsibility to confirm that the dynamic friction default is less than or equal to the static friction default.

◆ friction_is_default()

bool friction_is_default ( ) const

Reports if the friction values are configured to use a default.

A newly constructed instance will report true. Furthermore, it must return true if set_friction_to_default() has been called and false if set_friction() has been called.

◆ operator=() [1/2]

CompliantMaterial& operator= ( const CompliantMaterial )
default

◆ operator=() [2/2]

CompliantMaterial& operator= ( CompliantMaterial &&  )
default

◆ set_dissipation()

CompliantMaterial & set_dissipation ( double  value)

Set the dissipation value.

Attempting to set a negative value will throw an exception. Returns a reference to *this so that multiple invocations of set can be chained together.

◆ set_dissipation_to_default()

void set_dissipation_to_default ( )

Reset the dissipation value to report the default value.

◆ set_friction() [1/2]

CompliantMaterial & set_friction ( double  value)

Sets both coefficients of friction to the same value.

Exceptions
std::exceptionif the value is negative. Returns a reference to *this so that multiple invocations of set can be chained together.

◆ set_friction() [2/2]

CompliantMaterial & set_friction ( double  static_friction,
double  dynamic_friction 
)

Sets the two coefficients of friction.

The dynamic_friction values must be less than or equal to the static_friction. An exception will be thrown if dynamic_friction > static_friction or if either value is negative. Returns a reference to *this so that multiple invocations of set can be chained together.

◆ set_friction_to_default()

void set_friction_to_default ( )

Reset both friction coefficient values to report the default value.

◆ set_youngs_modulus()

CompliantMaterial & set_youngs_modulus ( double  value)

Set the value for Young's modulus.

Attempting to set a negative value will throw an exception. Returns a reference to *this so that multiple invocations of set can be chained together.

Parameters
valueThe Young's modulus value with units of pascals.

◆ set_youngs_modulus_to_default()

void set_youngs_modulus_to_default ( )

Reset the elasticity value to report the default value.

◆ static_friction()

double static_friction ( double  default_value = kDefaultStaticFriction) const

Extract the static friction coefficient with an optional default value.

The default value is checked for non-negativity in Debug build.

If the caller provides a default value for accessing static and dynamic friction, it is the callers responsibility to confirm that the dynamic friction default is less than or equal to the static friction default.

◆ youngs_modulus()

double youngs_modulus ( double  default_value = kDefaultYoungsModulus) const

Extract the value for Young's modulus with an optional default value.

The default value is checked in Debug build.

◆ youngs_modulus_is_default()

bool youngs_modulus_is_default ( ) const

Reports if the elasticity value is configured to use a default.

A newly constructed instance will report true. Furthermore, it must return true if set_youngs_modulus_to_default() has been called and false if set_youngs_modulus() has been called.

Member Data Documentation

◆ kDefaultDissipation

const double kDefaultDissipation = 0.32
static

◆ kDefaultDynamicFriction

const double kDefaultDynamicFriction = 0.5
static

◆ kDefaultStaticFriction

const double kDefaultStaticFriction = 0.9
static

◆ kDefaultYoungsModulus

const double kDefaultYoungsModulus = 1e8
static

The documentation for this class was generated from the following files: