Implementation:Haosulab ManiSkill PlaceSphere
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Simulation, Tabletop_Manipulation |
| Last Updated | 2026-02-15 08:00 GMT |
Overview
Concrete implementation of the sphere placement task environment in ManiSkill.
Description
The PlaceSphereEnv requires a robot to pick up a sphere and place it into a shallow bin on the table. The bin is built from five box shapes (a base and four edge walls) forming a small container. The sphere has radius 0.02m.
Registered as PlaceSphere-v1 with max_episode_steps=50. Supported robots: panda and fetch. Reward modes include "normalized_dense", "dense", "sparse", and "none".
Randomizations: sphere position in [-0.1, -0.05] x [-0.1, 0.1], bin position in [0, 0.1] x [-0.1, 0.1]. Success requires the sphere to be on top of the bin (xy within 0.005m, z within 0.005m of expected height), the sphere to be static, and the gripper to not be grasping the sphere.
Usage
Use this environment for precise placement research. The combination of grasping a sphere and placing it in a small bin tests both grasping and fine-grained positioning skills.
Code Reference
Source Location
- Repository: Haosulab_ManiSkill
- File: mani_skill/envs/tasks/tabletop/place_sphere.py
Signature
@register_env("PlaceSphere-v1", max_episode_steps=50)
class PlaceSphereEnv(BaseEnv):
SUPPORTED_ROBOTS = ["panda", "fetch"]
agent: Union[Panda, Fetch]
radius = 0.02
Import
import gymnasium as gym
import mani_skill.envs
env = gym.make("PlaceSphere-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, sphere pose, bin position |
| reward | float | Dense reward: reaching + grasping + placing + ungrasping + static |
| terminated | bool | Whether episode ended by success |
| truncated | bool | Whether episode hit max steps (50) |
| info | dict | Contains success, is_obj_grasped, is_obj_on_bin, is_obj_static |
Usage Examples
Basic Usage
import gymnasium as gym
import mani_skill.envs
env = gym.make("PlaceSphere-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()