newton.ShapeFrictionMode#
- class newton.ShapeFrictionMode(*values)[source]#
Bases:
IntEnumFriction 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 highermujoco:geom_priorityor an explicit contact pair decides instead), so a rigid contact is only frictionless when both shapes areNONE. 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, andSLIDING_TORSIONAL_ROLLINGcorrespond to MuJoCo’scondim1, 3, 4, and 6.SLIDING_ROLLINGhas nocondim; see Friction modes and condim for howSolverMuJoCoapplies it.The mode fixes which friction constraints a solver creates when it is constructed; the coefficients
shape_material_mu,shape_material_mu_torsional, andshape_material_mu_rollingset their strength and may change at runtime.Particles have no friction mode, so they count as
NONEand 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.SolverMuJoCoflexes 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.