Implementation:Haosulab ManiSkill PullCube
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Simulation, Tabletop_Manipulation |
| Last Updated | 2026-02-15 08:00 GMT |
Overview
Concrete implementation of the cube pulling task environment in ManiSkill.
Description
The PullCubeEnv requires a robot to pull a cube toward a target position. The target is marked by a red/white circular goal region positioned behind the cube (relative to the robot).
Registered as PullCube-v1 with max_episode_steps=50. Supported robots: panda and fetch. Reward modes include "normalized_dense", "dense", "sparse", and "none".
Randomizations: cube xy position in [-0.1, 0.1], goal position fixed at cube_xy - [0.1 + goal_radius, 0]. Success requires the cube to be within the goal region on the table.
Usage
Use this environment for non-prehensile pulling manipulation research. Unlike pushing tasks, pulling requires the robot to position itself behind the object and drag it toward the goal.
Code Reference
Source Location
- Repository: Haosulab_ManiSkill
- File: mani_skill/envs/tasks/tabletop/pull_cube.py
Signature
@register_env("PullCube-v1", max_episode_steps=50)
class PullCubeEnv(BaseEnv):
SUPPORTED_ROBOTS = ["panda", "fetch"]
agent: Union[Panda, Fetch]
Import
import gymnasium as gym
import mani_skill.envs
env = gym.make("PullCube-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 cube pose, goal position, TCP pose |
| reward | float | Dense reward based on reaching and pulling the cube toward goal |
| terminated | bool | Whether episode ended by success |
| truncated | bool | Whether episode hit max steps (50) |
| info | dict | Contains success flag |
Usage Examples
Basic Usage
import gymnasium as gym
import mani_skill.envs
env = gym.make("PullCube-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()