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:Haosulab ManiSkill HumanoidEnv

From Leeroopedia
Knowledge Sources
Domains Robotics, Simulation, Control
Last Updated 2026-02-15 08:00 GMT

Overview

Concrete implementation of the Humanoid locomotion control task environment in ManiSkill, adapted from the DeepMind Control Suite.

Description

The HumanoidEnv defines a bipedal humanoid robot locomotion task. The humanoid robot is loaded from MJCF and controlled with PD joint position controllers. Three registered variants exist:

  • MS-HumanoidStand-v1 (max_episode_steps=100): The humanoid must maintain a standing posture at a target height of 1.4m.
  • MS-HumanoidWalk-v1 (max_episode_steps=100): The humanoid must walk at a target speed of 1 m/s.
  • MS-HumanoidRun-v1 (max_episode_steps=100): The humanoid must run at a target speed of 10 m/s.

The base class HumanoidEnvBase provides shared logic for scene loading, observation computation, and reward calculation. Rewards are computed from standing height, movement speed, and control cost. The supported robot is humanoid.

Usage

Use this environment for benchmarking bipedal locomotion control algorithms. The three variants provide increasing difficulty levels from standing to running, with dense and normalized dense reward modes available.

Code Reference

Source Location

Signature

class HumanoidEnvBase(BaseEnv):
    agent: Union[Humanoid]
    def __init__(self, *args, robot_uids="humanoid", **kwargs): ...

@register_env("MS-HumanoidStand-v1", max_episode_steps=100)
class HumanoidStandEnv(HumanoidEnvBase): ...

@register_env("MS-HumanoidWalk-v1", max_episode_steps=100)
class HumanoidWalkEnv(HumanoidEnvBase): ...

@register_env("MS-HumanoidRun-v1", max_episode_steps=100)
class HumanoidRunEnv(HumanoidEnvBase): ...

Import

import gymnasium as gym
import mani_skill.envs
env = gym.make("MS-HumanoidWalk-v1")

I/O Contract

Inputs

Name Type Required Description
obs_mode str No Observation mode (default: "state")
reward_mode str No Reward mode: "dense", "normalized_dense", "none"
control_mode str No Control mode for the humanoid robot

Outputs

Name Type Description
obs dict/array Observation including joint positions, velocities, extremity positions, head height, torso vertical orientation
reward float Composed of standing reward, movement reward, and control cost
terminated bool Whether episode ended by success/failure
truncated bool Whether episode hit max steps (100)
info dict Contains evaluation metrics

Usage Examples

Basic Usage

import gymnasium as gym
import mani_skill.envs

env = gym.make("MS-HumanoidWalk-v1", obs_mode="state", render_mode="rgb_array")
obs, info = env.reset()
for _ in range(100):
    action = env.action_space.sample()
    obs, reward, terminated, truncated, info = env.step(action)
    if terminated or truncated:
        obs, info = env.reset()
env.close()

Related Pages

Page Connections

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