Implementation:Haosulab ManiSkill HumanoidStand
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Simulation, Humanoid_Control |
| Last Updated | 2026-02-15 08:00 GMT |
Overview
Concrete implementation of the humanoid standing balance task environment in ManiSkill.
Description
The HumanoidStand module defines standing balance tasks for Unitree humanoid robots. The base class HumanoidStandEnv provides common logic, and two robot-specific variants are registered:
UnitreeH1Stand-v1(max_episode_steps=1000): Unitree H1 humanoid must maintain standing posture.UnitreeG1Stand-v1(max_episode_steps=1000): Unitree G1 humanoid must maintain standing posture.
The scene contains only a ground plane. The robot is initialized from its "standing" keyframe with small random perturbations (noise of 0.05). Evaluation checks agent.is_standing() and agent.is_fallen(). Failure occurs when the robot falls. Reward modes include "sparse" and "none".
Usage
Use this environment as a baseline balance task for humanoid robots. It tests the ability to maintain upright posture from slightly perturbed initial conditions.
Code Reference
Source Location
- Repository: Haosulab_ManiSkill
- File: mani_skill/envs/tasks/humanoid/humanoid_stand.py
Signature
class HumanoidStandEnv(BaseEnv):
SUPPORTED_REWARD_MODES = ["sparse", "none"]
...
@register_env("UnitreeH1Stand-v1", max_episode_steps=1000)
class UnitreeH1StandEnv(HumanoidStandEnv):
SUPPORTED_ROBOTS = ["unitree_h1_simplified"]
...
@register_env("UnitreeG1Stand-v1", max_episode_steps=1000)
class UnitreeG1StandEnv(HumanoidStandEnv):
SUPPORTED_ROBOTS = ["unitree_g1_simplified_legs"]
...
Import
import gymnasium as gym
import mani_skill.envs
env = gym.make("UnitreeH1Stand-v1")
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| obs_mode | str | No | Observation mode |
| reward_mode | str | No | Reward mode: "sparse", "none" |
| control_mode | str | No | Control mode for the humanoid robot |
Outputs
| Name | Type | Description |
|---|---|---|
| obs | dict/array | Observation based on obs_mode |
| reward | float | Sparse reward: 1 if standing, 0 otherwise |
| terminated | bool | Whether the robot has fallen |
| truncated | bool | Whether episode hit max steps (1000) |
| info | dict | Contains is_standing, fail flags |
Usage Examples
Basic Usage
import gymnasium as gym
import mani_skill.envs
env = gym.make("UnitreeH1Stand-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()