Implementation:Haosulab ManiSkill HumanoidPickPlace
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Simulation, Humanoid_Control |
| Last Updated | 2026-02-15 08:00 GMT |
Overview
Concrete implementation of the humanoid pick-and-place task environment in ManiSkill using the Unitree G1 robot.
Description
The HumanoidPickPlace module defines a base class HumanoidPickPlaceEnv and a concrete task UnitreeG1PlaceAppleInBowlEnv. The task requires the Unitree G1 humanoid robot to grab an apple with its right arm and place it in a bowl on a kitchen counter.
Registered as UnitreeG1PlaceAppleInBowl-v1 with max_episode_steps=100. The supported robot is unitree_g1_simplified_upper_body_with_head_camera.
Randomizations include the bowl's xy position (+/-0.025m), the apple's xy position (+/-0.025m), and the apple's z-axis rotation. Success requires the apple to be within 0.05m euclidean distance of the bowl position, and the robot's right hand to be above the bowl by at least 0.125m. Reward modes include "normalized_dense", "dense", "sparse", and "none".
Usage
Use this environment for humanoid manipulation research involving upper-body coordination, grasping, and precise placement tasks.
Code Reference
Source Location
- Repository: Haosulab_ManiSkill
- File: mani_skill/envs/tasks/humanoid/humanoid_pick_place.py
Signature
class HumanoidPickPlaceEnv(BaseEnv):
SUPPORTED_REWARD_MODES = ["sparse", "none"]
...
@register_env("UnitreeG1PlaceAppleInBowl-v1", max_episode_steps=100)
class UnitreeG1PlaceAppleInBowlEnv(HumanoidPlaceAppleInBowl):
SUPPORTED_ROBOTS = ["unitree_g1_simplified_upper_body_with_head_camera"]
agent: UnitreeG1UpperBodyWithHeadCamera
Import
import gymnasium as gym
import mani_skill.envs
env = gym.make("UnitreeG1PlaceAppleInBowl-v1")
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| obs_mode | str | No | Observation mode |
| reward_mode | str | No | Reward mode: "normalized_dense", "dense", "sparse", "none" |
| control_mode | str | No | Control mode for the G1 robot |
Outputs
| Name | Type | Description |
|---|---|---|
| obs | dict/array | Observation including grasping state, TCP pose, bowl/apple positions |
| reward | float | Dense reward based on reaching, grasping, placing, and releasing |
| terminated | bool | Whether episode ended by success/failure |
| truncated | bool | Whether episode hit max steps (100) |
| info | dict | Contains success, hand_outside_bowl, is_grasped flags |
Usage Examples
Basic Usage
import gymnasium as gym
import mani_skill.envs
env = gym.make("UnitreeG1PlaceAppleInBowl-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()