Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Google deepmind Dm control Locomotion Arenas

From Leeroopedia
Metadata
Knowledge Sources dm_control
Domains Reinforcement Learning, Robotics, Environment Design
Last Updated 2026-02-15 00:00 GMT

Overview

Concrete tool for building terrain environments in the dm_control locomotion library, providing flat floors, gap corridors, wall corridors, bowl-shaped heightfields, and procedurally generated mazes with target and spawn positions.

Description

The locomotion arenas module provides several arena classes for constructing the physical terrain in which walkers operate. Each arena generates a MuJoCo XML model containing ground geometry, optional obstacles, lighting, skybox textures, and top-down cameras. Arenas support per-episode regeneration: dimensions, obstacle placements, and maze layouts can be resampled from distributions each time the environment resets.

The available arenas include:

  • Floor: A simple flat plane with configurable size, reflectance, and optional aesthetic textures. Suitable for open-area tasks such as target reaching.
  • GapsCorridor: A corridor with alternating platforms and gaps. Platform and gap lengths can be fixed values or sampled from distributions.
  • WallsCorridor: A corridor with protruding wall obstacles that alternate sides. Wall gap, width, height, and color are configurable.
  • Bowl: A sinusoidal bowl-shaped heightfield with random smooth bumps, designed for escape tasks where the agent must climb out.
  • RandomMazeWithTargets: A procedurally generated 2D maze using the LabMaze library, with rooms, corridors, spawn points, and target positions.

Usage

Use these arenas to define the physical space for locomotion experiments. Choose Floor for simple tasks, corridor arenas for forward locomotion with obstacles, Bowl for escape tasks, and maze arenas for navigation and foraging tasks.

Code Reference

Source Location

Class File Lines
Floor Template:Code L26-104
GapsCorridor Template:Code L178-337
WallsCorridor Template:Code L340-443
Bowl Template:Code L34-135
RandomMazeWithTargets Template:Code L394-460

Signature

class Floor(composer.Arena):
    def _build(self, size=(8, 8), reflectance=.2, aesthetic='default',
               name='floor', top_camera_y_padding_factor=1.1,
               top_camera_distance=100):
        ...

class GapsCorridor(EmptyCorridor):
    def _build(self, platform_length=1., gap_length=2.5,
               corridor_width=4, corridor_length=40,
               ground_rgba=(0.5, 0.5, 0.5, 1),
               visible_side_planes=False, aesthetic='default',
               name='gaps_corridor'):
        ...

class WallsCorridor(EmptyCorridor):
    def _build(self, wall_gap=2.5, wall_width=2.5, wall_height=2.0,
               swap_wall_side=True, wall_rgba=(1, 1, 1, 1),
               corridor_width=4, corridor_length=40,
               visible_side_planes=False,
               include_initial_padding=True,
               name='walls_corridor'):
        ...

class Bowl(composer.Arena):
    def _build(self, size=(10, 10), aesthetic='default', name='bowl'):
        ...

class RandomMazeWithTargets(MazeWithTargets):
    def _build(self, x_cells, y_cells, xy_scale=2.0, z_height=2.0,
               max_rooms=4, room_min_size=3, room_max_size=5,
               spawns_per_room=1, targets_per_room=1,
               max_variations=26, simplify=True,
               skybox_texture=None, wall_textures=None,
               floor_textures=None, aesthetic='default',
               name='random_maze'):
        ...

Import

from dm_control.locomotion.arenas import floors
from dm_control.locomotion.arenas import corridors
from dm_control.locomotion.arenas import bowl
from dm_control.locomotion.arenas import mazes

I/O Contract

Inputs

Parameter Type Description
size tuple of 2 floats (Floor, Bowl) Dimensions of the ground plane in meters.
corridor_width float or Variation (Corridors) Width of the corridor in meters.
corridor_length float or Variation (Corridors) Length of the corridor in meters.
platform_length float or Variation (GapsCorridor) Length of each platform segment.
gap_length float or Variation (GapsCorridor) Length of each gap between platforms.
wall_gap float or Variation (WallsCorridor) Distance between consecutive walls.
wall_width float or Variation (WallsCorridor) How far each wall extends into the corridor.
wall_height float or Variation (WallsCorridor) Height of the obstructing walls.
x_cells, y_cells int (odd) (RandomMazeWithTargets) Number of cells in each direction for maze generation.
xy_scale float (RandomMazeWithTargets) Size of each maze cell in meters.
aesthetic str Visual style identifier (Template:Code or a named style) affecting textures and skybox.

Outputs (Properties)

Property Type Description
mjcf_model mjcf.RootElement The root MJCF element of the arena.
ground_geoms tuple Ground geometry elements for contact detection.
corridor_length float (Corridors) Current realized corridor length after regeneration.
corridor_width float (Corridors) Current realized corridor width after regeneration.
size tuple (Floor) The size of the floor arena.
target_positions tuple of arrays (MazeWithTargets) Cartesian positions of targets in the current maze.
spawn_positions tuple of arrays (MazeWithTargets) Cartesian positions of spawn points in the current maze.

Usage Examples

Creating a flat floor arena:

from dm_control.locomotion.arenas import floors

arena = floors.Floor(size=(10, 10), reflectance=0.3)
print(arena.size)  # (10, 10)

Creating a gaps corridor with randomized dimensions:

from dm_control.composer.variation import distributions
from dm_control.locomotion.arenas import corridors

arena = corridors.GapsCorridor(
    platform_length=distributions.Uniform(0.3, 2.5),
    gap_length=distributions.Uniform(0.5, 1.25),
    corridor_width=10,
    corridor_length=100)

Creating a walls corridor:

from dm_control.composer.variation import distributions
from dm_control.locomotion.arenas import corridors

arena = corridors.WallsCorridor(
    wall_gap=4.0,
    wall_width=distributions.Uniform(1, 7),
    wall_height=3.0,
    corridor_width=10,
    corridor_length=100,
    include_initial_padding=False)

Creating a bowl arena for escape tasks:

from dm_control.locomotion.arenas import bowl

arena = bowl.Bowl(size=(20, 20))

Creating a random maze with targets and textures:

from dm_control.locomotion.arenas import mazes
from dm_control.locomotion.arenas import labmaze_textures

skybox = labmaze_textures.SkyBox(style='sky_03')
walls = labmaze_textures.WallTextures(style='style_01')
floor_tex = labmaze_textures.FloorTextures(style='style_01')

arena = mazes.RandomMazeWithTargets(
    x_cells=11, y_cells=11, xy_scale=3,
    max_rooms=4, room_min_size=4, room_max_size=5,
    spawns_per_room=1, targets_per_room=3,
    skybox_texture=skybox,
    wall_textures=walls,
    floor_textures=floor_tex)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment