Implementation:Haosulab ManiSkill PickCube
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Simulation, Tabletop_Manipulation |
| Last Updated | 2026-02-15 08:00 GMT |
Overview
Concrete implementation of the cube picking task environment in ManiSkill -- the baseline tabletop manipulation benchmark.
Description
The PickCubeEnv is the baseline manipulation task for testing robot grasping and placement capabilities. The robot must grasp a red cube and move it to a target goal position marked by a green sphere.
Registered variants:
PickCube-v1(max_episode_steps=50): Default with Panda robot.PickCubeSO100-v1(max_episode_steps=50): With SO100 robot.PickCubeWidowXAI-v1(max_episode_steps=50): With WidowXAI robot.
Supported robots: panda, fetch, xarm6_robotiq, so100, widowxai. Reward modes include "normalized_dense", "dense", "sparse", and "none".
Randomizations: cube xy position in [-0.05, 0.05], cube z-rotation, and goal position xy in [-0.05, 0.05] with z in [0, 0.3]. Success requires the cube to be within goal_thresh (default 0.025m) of the goal and the robot to be static (qvel < 0.2). Robot-specific configurations are loaded from PICK_CUBE_CONFIGS.
Usage
Use this environment as the primary benchmark for validating tabletop manipulation capabilities. It supports multiple robot embodiments and provides a well-tuned dense reward function.
Code Reference
Source Location
- Repository: Haosulab_ManiSkill
- File: mani_skill/envs/tasks/tabletop/pick_cube.py
Signature
@register_env("PickCube-v1", max_episode_steps=50)
class PickCubeEnv(BaseEnv):
SUPPORTED_ROBOTS = ["panda", "fetch", "xarm6_robotiq", "so100", "widowxai"]
agent: Union[Panda, Fetch, XArm6Robotiq, SO100, WidowXAI]
goal_thresh = 0.025
Import
import gymnasium as gym
import mani_skill.envs
env = gym.make("PickCube-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, cube pose, goal position, is_grasped |
| reward | float | Dense reward: reaching + grasping + placing + static |
| terminated | bool | Whether episode ended by success |
| truncated | bool | Whether episode hit max steps (50) |
| info | dict | Contains success, is_obj_placed, is_robot_static, is_grasped |
Usage Examples
Basic Usage
import gymnasium as gym
import mani_skill.envs
env = gym.make("PickCube-v1", obs_mode="state", render_mode="rgb_array")
obs, info = env.reset()
for _ in range(50):
action = env.action_space.sample()
obs, reward, terminated, truncated, info = env.step(action)
if terminated or truncated:
obs, info = env.reset()
env.close()