Files
Mujoco_WASM/plugin/elasticity
Sam Haves f2461f9ce6 Modify mj_PLUGIN_LIB_INIT to support multiple plugins in the same compilation unit.
Previously on MSVC we used DllMain to register plugins, you cannot have multiple definitions of DllMain in a single unit so you would get errors if you tried to register two plugins. This modifies the implementation to insert a function pointer into the C runtime initialization instead.

PiperOrigin-RevId: 896612678
Change-Id: I07732147b955d741c836acff6da986db0e9b9eff
2026-04-08 11:35:16 -07:00
..
2022-12-06 08:23:49 -08:00

MuJoCo

Elasticity plugins

These are first-party plugins that implement passive forces based on discretized continuum mechanics models. They can be applied to flexes and bodies (via the composite functionality). Sample models can be found in this folder.

Cable

Implemented in cable.cc.

The cable plugin discretizes an inextensible 1D continuum. It is intended to simulate the twist and bending of rods where the stretching in negligible compared to the other deformation modes.

Parameters:

  • twist [Pa]: twisting stiffness.
  • bend [Pa]: bending stiffness.
  • flat [bool]: if true, the stress-equilibrium configuration is that of a straight cable; if false or unspecified, it is the configuration defined in the XML.
  • vmax [N/m^2]: If greater than zero, the cable is colored using mechanical stresses; the value represent the maximum stress in the color scale.