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 Walkers

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

Overview

Concrete tool for selecting and configuring walker bodies in the dm_control locomotion library, providing pre-built humanoid, rodent, quadruped, and ball morphologies with standardized interfaces for attachment, actuation, and observation.

Description

The locomotion walkers module provides several walker classes that each wrap a MuJoCo XML model with a consistent Python interface. Each walker exposes properties for its root body, actuators, end effectors, ground contact geoms, observable joints, and egocentric camera. Walkers can be attached to arenas via Template:Code, configured with custom marker colors for multi-agent settings, and provide rich proprioceptive observables including joint positions, velocities, body height, and appendage positions in the egocentric frame.

The available walkers include:

  • CMUHumanoidPositionControlled: A 56-DoF humanoid based on the CMU motion capture skeleton with position-controlled actuators scaled to [-1, 1].
  • Rat: A position-controlled rodent with a flexible spine (vertebra joints), four limbs, tendon actuators, and detailed proprioception.
  • Ant: A quadruped "ant" walker with 8 actuators (2 per leg), body orientation observables, and an aliveness function.
  • JumpingBallWithHead: A simplified rolling/jumping ball with a visible head for orientation, optional camera control actuators, and optional ear markers.

Usage

Use these walkers when building locomotion tasks with the Composer framework. Select a walker that matches the complexity needed for the research question: CMU Humanoid for realistic bipedal locomotion, Rat for neuroscience-inspired quadruped control, Ant for standard RL benchmarks, or JumpingBallWithHead for simplified navigation tasks.

Code Reference

Source Location

Class File Lines
CMUHumanoidPositionControlled Template:Code L360-422
Rat Template:Code L60-259
Ant Template:Code L31-148
JumpingBallWithHead Template:Code L28-145

Signature

class CMUHumanoidPositionControlled(CMUHumanoid):
    def _build(self, model_version='2019', name='walker',
               marker_rgba=None, include_face=False,
               initializer=None, scale_default=False):
        ...

class Rat(legacy_base.Walker):
    def _build(self, params=None, name='walker',
               torque_actuators=False, foot_mods=False,
               initializer=None):
        ...

class Ant(legacy_base.Walker):
    def _build(self, name='walker', marker_rgba=None,
               initializer=None):
        ...

class JumpingBallWithHead(legacy_base.Walker):
    def _build(self, name='walker', marker_rgba=None,
               camera_control=False, initializer=None,
               add_ears=False, camera_height=None):
        ...

Import

from dm_control.locomotion.walkers import cmu_humanoid
from dm_control.locomotion.walkers import rodent
from dm_control.locomotion.walkers import ant
from dm_control.locomotion.walkers import jumping_ball

I/O Contract

Inputs

Parameter Type Description
name str Model name for the walker MJCF root element. Defaults to Template:Code.
marker_rgba sequence of 4 floats or None Optional RGBA color applied to marker geoms (front legs for Ant, head for ball) to distinguish walkers in multi-agent settings.
initializer WalkerInitializer or None Optional initializer object for configuring the walker's initial state.
observable_options dict or None (CMU Humanoid) Dictionary mapping observable names to configuration dicts (e.g., Template:Code}).
torque_actuators bool (Rat only) If True, converts position actuators to torque actuators.
camera_control bool (JumpingBallWithHead only) If True, exposes camera height and tilt as actuated degrees of freedom.

Outputs (Properties)

Property Type Description
mjcf_model mjcf.RootElement The root MJCF element of the walker's body model.
actuators tuple All actuator elements in the model.
root_body mjcf.Element The primary body used for attachment and tracking.
end_effectors tuple Terminal limb bodies (feet for humanoid/rat/ant, head for ball).
ground_contact_geoms tuple Geoms that may legitimately contact the ground.
observable_joints tuple Joints exposed as proprioceptive observations.
egocentric_camera mjcf.Element First-person camera element.
upright_pose WalkerPose Default upright position and orientation.

Usage Examples

Creating a position-controlled CMU Humanoid with egocentric vision:

from dm_control.locomotion.walkers import cmu_humanoid

walker = cmu_humanoid.CMUHumanoidPositionControlled(
    observable_options={'egocentric_camera': dict(enabled=True)})

# Access walker properties
print(len(walker.actuators))    # 56 actuators
print(walker.standing_height)   # 1.5 meters
print(walker.root_body.name)    # 'root'

Creating an Ant walker with colored markers:

from dm_control.locomotion.walkers import ant

walker = ant.Ant(marker_rgba=(1, 0, 0, 1))

# 8 actuators (2 per leg: hip and ankle)
print(len(walker.actuators))    # 8
print(len(walker.end_effectors))  # 4 feet

Creating a JumpingBallWithHead with camera control:

from dm_control.locomotion.walkers import jumping_ball

walker = jumping_ball.JumpingBallWithHead(
    camera_control=True, add_ears=True)

# Includes kick, roll_x, roll_y, steer, camera_height, camera_tilt actuators
print(len(walker.actuators))

Attaching a walker to an arena:

from dm_control.locomotion.walkers import cmu_humanoid
from dm_control.locomotion.arenas import floors

walker = cmu_humanoid.CMUHumanoidPositionControlled()
arena = floors.Floor(size=(10, 10))

# Attach walker and create root joints for free movement
attachment_frame = arena.attach(walker)
walker.create_root_joints(attachment_frame)

Related Pages

Page Connections

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