Implementation:Haosulab ManiSkill TwoRobotStackCube
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Simulation, Tabletop_Manipulation |
| Last Updated | 2026-02-15 08:00 GMT |
Overview
Concrete implementation of the two-robot cooperative cube stacking task environment in ManiSkill.
Description
The TwoRobotStackCube environment features two Panda robot arms that must cooperate to stack two cubes. The green cube is near the right robot and the blue cube is near the left robot. One robot must place the green cube on a target region, then the other must stack the blue cube on top. This requires coordination and sequential planning between the two robots.
Registered as TwoRobotStackCube-v1 with max_episode_steps=100. Uses MultiAgent with two Panda robots. Reward modes include "normalized_dense", "dense", "sparse", and "none".
Randomizations: both cubes have random z-axis rotations, positions are set such that each robot can only reach one cube initially. A target region (marked by a red/white ground target) is randomized for the base cube placement. Success requires the blue cube to be stacked on top of the green cube on the target.
Usage
Use this environment for multi-agent cooperative manipulation research involving sequential, multi-step coordination between two robot arms.
Code Reference
Source Location
- Repository: Haosulab_ManiSkill
- File: mani_skill/envs/tasks/tabletop/two_robot_stack_cube.py
Signature
@register_env("TwoRobotStackCube-v1", max_episode_steps=100)
class TwoRobotStackCube(BaseEnv):
agent: MultiAgent
Import
import gymnasium as gym
import mani_skill.envs
env = gym.make("TwoRobotStackCube-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 two Panda robots |
Outputs
| Name | Type | Description |
|---|---|---|
| obs | dict/array | Observation including both robots' states, cube poses, target position |
| reward | float | Dense reward based on sequential stacking milestones |
| terminated | bool | Whether episode ended by success |
| truncated | bool | Whether episode hit max steps (100) |
| info | dict | Contains success flag and stage progress |
Usage Examples
Basic Usage
import gymnasium as gym
import mani_skill.envs
env = gym.make("TwoRobotStackCube-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()