Implementation:Haosulab ManiSkill StackPyramid
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Simulation, Tabletop_Manipulation |
| Last Updated | 2026-02-15 08:00 GMT |
Overview
Concrete implementation of the pyramid stacking task environment in ManiSkill.
Description
The StackPyramidEnv requires a robot to arrange three cubes into a pyramid: pick up a red cube, place it next to a green cube, then stack a blue cube on top of both.
Registered as StackPyramid-v1 with max_episode_steps=250. Supported robots: panda and fetch. Reward modes include "normalized_dense", "dense", "sparse", and "none".
Randomizations: all three cubes have z-axis rotation randomized, xy positions randomized on the table such that they do not collide. Success requires the pyramid structure to be stable with the blue cube resting on top of the red and green cubes without falling.
Usage
Use this environment for multi-step sequential manipulation research. The pyramid task requires planning and executing a specific sequence of pick-and-place operations.
Code Reference
Source Location
- Repository: Haosulab_ManiSkill
- File: mani_skill/envs/tasks/tabletop/stack_pyramid.py
Signature
@register_env("StackPyramid-v1", max_episode_steps=250)
class StackPyramidEnv(BaseEnv):
SUPPORTED_ROBOTS = ["panda", "fetch"]
agent: Union[Panda, Fetch]
Import
import gymnasium as gym
import mani_skill.envs
env = gym.make("StackPyramid-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 robot |
Outputs
| Name | Type | Description |
|---|---|---|
| obs | dict/array | Observation including TCP pose, three cube poses, is_grasped |
| reward | float | Dense reward based on sequential placement milestones |
| terminated | bool | Whether episode ended by success |
| truncated | bool | Whether episode hit max steps (250) |
| info | dict | Contains success flag and stage progress |
Usage Examples
Basic Usage
import gymnasium as gym
import mani_skill.envs
env = gym.make("StackPyramid-v1", obs_mode="state", render_mode="rgb_array")
obs, info = env.reset()
for _ in range(250):
action = env.action_space.sample()
obs, reward, terminated, truncated, info = env.step(action)
if terminated or truncated:
obs, info = env.reset()
env.close()