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 Draw

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

Overview

Concrete implementation of the free drawing base task environment in ManiSkill.

Description

The TableTopFreeDrawEnv provides a table with a white canvas and a robot with a stick that draws red lines. This environment is primarily a reference implementation for building custom drawing tasks. Drawing is simulated by placing cylinder-shaped dots on the canvas surface when the brush (robot TCP) is close enough.

Registered as TableTopFreeDraw-v1 with max_episode_steps=1000. The supported robot is panda_stick (PandaStick). The reward mode is "none" only, as there is no specific drawing objective.

Key parameters: MAX_DOTS=1010 (total ink), DOT_THICKNESS=0.003, CANVAS_THICKNESS=0.02, BRUSH_RADIUS=0.01, BRUSH_COLORS=0.8, 0.2, 0.2, 1. No randomizations or success conditions are defined.

Usage

Use this environment as a starting point for creating custom drawing tasks. It demonstrates the painting mechanism and can be extended by subclasses (e.g., DrawTriangle, DrawSVG) that add specific target shapes and success conditions.

Code Reference

Source Location

Signature

@register_env("TableTopFreeDraw-v1", max_episode_steps=1000)
class TableTopFreeDrawEnv(BaseEnv):
    SUPPORTED_REWARD_MODES = ["none"]
    SUPPORTED_ROBOTS: ["panda_stick"]
    agent: PandaStick
    MAX_DOTS = 1010
    BRUSH_RADIUS = 0.01

Import

import gymnasium as gym
import mani_skill.envs
env = gym.make("TableTopFreeDraw-v1")

I/O Contract

Inputs

Name Type Required Description
obs_mode str No Observation mode
reward_mode str No Reward mode: "none"
control_mode str No Control mode for panda_stick robot

Outputs

Name Type Description
obs dict/array Observation including TCP pose
reward float Always 0 (no reward)
terminated bool Whether episode ended
truncated bool Whether episode hit max steps (1000)
info dict Empty dict (no evaluation metrics)

Usage Examples

Basic Usage

import gymnasium as gym
import mani_skill.envs

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