Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Haosulab ManiSkill PokeCube

From Leeroopedia
Knowledge Sources
Domains Robotics, Simulation, Tabletop_Manipulation
Last Updated 2026-02-15 08:00 GMT

Overview

Concrete implementation of the cube poking task environment in ManiSkill.

Description

The PokeCubeEnv requires a robot to poke a red cube with a peg and push it to a target goal position marked by a red/white circular target. The peg is placed flat on the table and the cube is positioned in front of it.

Registered as PokeCube-v1 with max_episode_steps=50. Supported robots: panda and fetch. Reward modes include "normalized_dense", "dense", "sparse", and "none".

Randomizations: peg xy position in [-0.1, 0.1], cube x fixed relative to peg (peg_x + 0.12 + 0.1), cube y in [-0.1, 0.1], cube z-rotation in [-pi/6, pi/6], goal position fixed at cube_xy + [0.05 + goal_radius, 0]. Success requires the cube to be within the goal radius of the target position.

Usage

Use this environment for non-prehensile tool-use manipulation research. The robot must use a peg as an intermediary to push the cube, testing tool-based interaction skills.

Code Reference

Source Location

Signature

@register_env("PokeCube-v1", max_episode_steps=50)
class PokeCubeEnv(BaseEnv):
    SUPPORTED_ROBOTS = ["panda", "fetch"]
    agent: Union[Panda, Fetch]

Import

import gymnasium as gym
import mani_skill.envs
env = gym.make("PokeCube-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 peg pose, cube pose, goal position, TCP pose
reward float Dense reward based on reaching peg, pushing cube to 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("PokeCube-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()

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment