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 RollBall

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

Overview

Concrete implementation of the ball rolling task environment in ManiSkill.

Description

The RollBallEnv requires a robot to push and roll a ball to a goal region at the other end of the table. The goal is marked by a red/white circular target.

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

Randomizations: ball xy position in [0.2, 0.5] x [-0.4, 0.7], goal position in [-0.4, -0.7] x [0.2, -0.9]. Success requires the ball to be within the goal region. This is a non-prehensile manipulation task requiring controlled pushing and rolling of a sphere.

Usage

Use this environment for non-prehensile manipulation research involving rolling contact dynamics. The ball's tendency to roll makes precise control challenging.

Code Reference

Source Location

Signature

@register_env("RollBall-v1", max_episode_steps=80)
class RollBallEnv(BaseEnv):
    SUPPORTED_ROBOTS = ["panda", "fetch"]
    agent: Union[Panda, Fetch]

Import

import gymnasium as gym
import mani_skill.envs
env = gym.make("RollBall-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 ball pose, goal position, TCP pose
reward float Dense reward based on pushing ball toward goal region
terminated bool Whether episode ended by success
truncated bool Whether episode hit max steps (80)
info dict Contains success flag

Usage Examples

Basic Usage

import gymnasium as gym
import mani_skill.envs

env = gym.make("RollBall-v1", obs_mode="state", render_mode="rgb_array")
obs, info = env.reset()
for _ in range(80):
    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