# MuJoCo Python bindings This submodule contains Python bindings for the MuJoCo physics engine. See our [tech report](https://arxiv.org/abs/1801.00690) for further details. ## Quickstart ```python from dm_control import mujoco # Load a model from an MJCF XML string. xml_string = """ """ physics = mujoco.Physics.from_xml_string(xml_string) # Render the default camera view as a numpy array of pixels. pixels = physics.render() # Reset the simulation, move the slide joint upwards and recompute derived # quantities (e.g. the positions of the body and geoms). with physics.reset_context(): physics.named.data.qpos['up_down'] = 0.5 # Print the positions of the geoms. print(physics.named.data.geom_xpos) # FieldIndexer(geom_xpos): # x y z # 0 floor [ 0 0 0 ] # 1 box [ 0 0 0.8 ] # 2 sphere [ 0.2 0.2 1 ] # Advance the simulation for 1 second. while physics.time() < 1.: physics.step() # Print the new z-positions of the 'box' and 'sphere' geoms. print(physics.named.data.geom_xpos[['box', 'sphere'], 'z']) # [ 0.19996362 0.39996362] ```