newton.ShapeFrictionMode#

class newton.ShapeFrictionMode(*values)[source]#

Bases: IntEnum

Friction components a shape enables in its rigid contacts.

The modes follow the contact models of grasping: frictionless point contact, point contact with sliding friction, and soft-finger contact that adds torsional friction about the normal. Rolling resistance can be added with or without torsional friction. The values are bit flags (sliding 1, torsional 2, rolling 4); torsional and rolling friction always come with sliding friction.

A contact enables the components that either of its shapes enables (in SolverMuJoCo, a higher mujoco:geom_priority or an explicit contact pair decides instead), so a rigid contact is only frictionless when both shapes are NONE. The strength of an enabled component combines the coefficients of both shapes by the solver’s usual rule, also when only one of them enables it.

NONE, SLIDING, SLIDING_TORSIONAL, and SLIDING_TORSIONAL_ROLLING correspond to MuJoCo’s condim 1, 3, 4, and 6. SLIDING_ROLLING has no condim; see Friction modes and condim for how SolverMuJoCo applies it.

The mode fixes which friction constraints a solver creates when it is constructed; the coefficients shape_material_mu, shape_material_mu_torsional, and shape_material_mu_rolling set their strength and may change at runtime.

Particles have no friction mode, so they count as NONE and a contact between a particle and a shape follows the shape’s mode. Because particles do not rotate, torsional and rolling friction do not act on them. SolverMuJoCo flexes keep sliding friction, see Particles and flexes.

NONE = 0#

Frictionless contact.

SLIDING = 1#

Sliding friction tangential to the contact.

SLIDING_ROLLING = 5#

Sliding friction and rolling friction.

SLIDING_TORSIONAL = 3#

Sliding friction and torsional friction about the contact normal.

SLIDING_TORSIONAL_ROLLING = 7#

Sliding, torsional, and rolling friction.