diff --git a/dm_control/mjcf/physics_test.py b/dm_control/mjcf/physics_test.py index aa9d4d0b..d9fae265 100644 --- a/dm_control/mjcf/physics_test.py +++ b/dm_control/mjcf/physics_test.py @@ -579,5 +579,31 @@ def test_error_when_pickling_synchronizing_array_wrapper(self): mjcf_physics._PICKLING_NOT_SUPPORTED.format(type=type(xpos_view))): pickle.dumps(xpos_view) + def test_plugins(self): + root = mjcf.RootElement() + root.extension.add('plugin', plugin='mujoco.elasticity.cable') + + # Replicate example in mujoco/model/plugin/elasticity/cable.xml + composite = root.worldbody.add( + 'composite', + type='cable', + curve='s', + count=[41, 1, 1], + size=[1, 0, 0], + offset=[-0.3, 0, 0.6], + initial='none', + ) + plugin = composite.add('plugin', plugin='mujoco.elasticity.cable') + plugin.add('config', key='twist', value='1e7') + plugin.add('config', key='bend', value='4e6') + plugin.add('config', key='vmax', value='0.05') + composite.add('joint', kind='main', damping=0.015) + composite.geom.type = 'capsule' + composite.geom.size = [0.005, 0, 0] + composite.geom.rgba = [0.8, 0.2, 0.1, 1] + composite.geom.condim = 1 + + mjcf.Physics.from_mjcf_model(root) + if __name__ == '__main__': absltest.main() diff --git a/dm_control/mjcf/schema.xml b/dm_control/mjcf/schema.xml index 1f9184b8..24e71540 100644 --- a/dm_control/mjcf/schema.xml +++ b/dm_control/mjcf/schema.xml @@ -268,7 +268,7 @@ - + @@ -577,7 +577,7 @@ - + @@ -811,7 +811,7 @@ - + @@ -914,6 +914,23 @@ + + + + + + + + + + + + + + + + + @@ -961,7 +978,7 @@ - + @@ -1058,19 +1075,24 @@ - + - + + + + + + - - + + @@ -1124,7 +1146,7 @@ - + @@ -1187,7 +1209,7 @@ - + @@ -1247,7 +1269,7 @@ - + @@ -1279,6 +1301,23 @@ + + + + + + + + + + + + + + + + + @@ -1344,15 +1383,35 @@ - + - + + + + + + + + + + + + + + + + + + + + + @@ -1395,7 +1454,7 @@ - + @@ -1830,7 +1889,7 @@ - + @@ -2224,7 +2283,7 @@ - +