mjlab.scene#

Classes

Scene#

class mjlab.scene.Scene[source]#
__init__(scene_cfg: SceneCfg, device: str) None[source]#
to_zip(path: Path) None[source]#

Export the scene to a zip file.

Warning: The generated zip may require manual adjustment of asset paths to be reloadable. Specifically, you may need to add assetdir=”assets” to the compiler directive in the XML.

Parameters:

path – Output path for the zip file.

TODO: Verify if this is fixed in future MuJoCo releases.

property sensor_context: SensorContext | None#

Shared sensing resources, or None if no cameras/raycasts.

class mjlab.scene.SceneCfg[source]#

Configuration for a simulation scene.

num_envs: int = 1#

Number of parallel environments.

env_spacing: float = 2.0#

Spacing between environment origins in meters.

terrain: TerrainEntityCfg | None = None#

Terrain configuration. If None, no terrain is added.

entities: dict[str, EntityCfg]#

Mapping of entity names to their configurations.

sensors: tuple[SensorCfg, ...]#

Sensor configurations to attach to the scene.

extent: float | None = None#

Override for mjModel.stat.extent. If None, MuJoCo computes it automatically.

spec_fn: Callable[[MjSpec], None] | None = None#

Optional callback to modify the MjSpec after entities and sensors have been added but before compilation.