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 CMU Mocap Initializer

From Leeroopedia
Revision as of 12:42, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Google_deepmind_Dm_control_CMU_Mocap_Initializer.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Robotics, Motion Capture
Last Updated 2026-02-15 04:00 GMT

Overview

The CMUMocapInitializer is a walker initializer that sets joint poses from CMU motion capture data, enabling walkers to start episodes from realistic human motion poses.

Description

CMUMocapInitializer extends UprightInitializer and loads a motion capture trajectory from HDF5 data at construction time. It uses cmu_mocap_data.get_path_for_cmu to locate the HDF5 file for a given CMU dataset version, then loads the specified trajectory clip via HDF5TrajectoryLoader.

During initialize_pose, it first calls the parent UprightInitializer to establish an upright base pose, then samples a random timestep uniformly from the loaded trajectory. It extracts the walker timestep data and applies the joint positions (qpos), joint velocities (qvel), linear velocity, and angular velocity from the sampled frame to the walker. This results in the walker starting each episode in a realistic human pose with appropriate velocities, rather than a static default pose.

This initializer is only suitable for walkers that match the motion capture data -- specifically the CMU humanoid walker models. Using it with incompatible walkers will produce incorrect results since the joint mapping must correspond to the motion capture data.

Usage

Use CMUMocapInitializer when you want a CMU humanoid walker to start episodes from diverse, realistic human poses sampled from motion capture data. This is particularly useful for imitation learning and motion tracking tasks where starting from natural poses improves training efficiency.

Code Reference

Source Location

Signature

class CMUMocapInitializer(initializers.UprightInitializer):
    def __init__(self, mocap_key='CMU_077_02', version='2019'):
    def initialize_pose(self, physics, walker, random_state):

Import

from dm_control.locomotion.walkers.initializers.mocap import CMUMocapInitializer

I/O Contract

Inputs

Name Type Required Description
mocap_key str No Key identifying the trajectory clip in the HDF5 file (default: 'CMU_077_02')
version str No CMU dataset version string (default: '2019')

Inputs (initialize_pose)

Name Type Required Description
physics mjcf.Physics Yes The MuJoCo physics instance
walker Walker Yes The walker entity to initialize (must be a compatible CMU humanoid)
random_state numpy.random.RandomState Yes Random state for sampling the initial timestep

Outputs

Name Type Description
initialize_pose return None Modifies walker pose in-place through the physics instance

Usage Examples

from dm_control.locomotion.walkers.initializers.mocap import CMUMocapInitializer

# Create an initializer using default CMU clip
initializer = CMUMocapInitializer(mocap_key='CMU_077_02', version='2019')

# Use it when constructing a CMU humanoid walker
walker = CMUHumanoidPositionControlledV2020(
    initializer=initializer
)

# The initializer is called automatically during episode initialization
# It can also be called directly:
initializer.initialize_pose(physics, walker, random_state=np.random)

Related Pages

Page Connections

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