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 GenerateTaskDocs

From Leeroopedia
Revision as of 12:53, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Haosulab_ManiSkill_GenerateTaskDocs.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Robotics, Simulation, Scene_Building
Last Updated 2026-02-15 08:00 GMT

Overview

External tool for automatically generating task documentation pages for all registered ManiSkill environments, producing categorized Markdown files with task cards, video thumbnails, and metadata tables.

Description

generate_task_docs.py is a documentation generation script that introspects the ManiSkill environment registry to produce structured documentation for all tasks. It is run as a standalone script, not as part of the simulation runtime.

The script performs the following steps:

  1. Module discovery -- Walks the mani_skill/envs/tasks directory tree, importing all Python modules and collecting classes defined within each module.
  2. Filtering -- Retains only classes that are registered in the REGISTERED_ENVS registry and have docstrings.
  3. Categorization -- Groups tasks into categories: tabletop, humanoid, mobile_manipulation, quadruped, control, drawing. Each category has a predefined header and description.
  4. HTML table generation -- Creates an HTML table for each category with columns: Task (env_id), Preview (first/last frame thumbnails), Dense Reward, Success/Fail Conditions, Demos, Max Episode Steps.
  5. Thumbnail extraction -- For environments with _sample_video_link, extracts first and last frames from demo videos, resizes to 256px, and saves as compressed PNGs.
  6. Task cards -- Generates detailed task cards using class docstrings wrapped in MyST dropdown components, with reward badges and video embeds.
  7. Validation -- Warns about mismatches between declared reward modes and implemented reward functions.

Output is written to docs/source/tasks/{category}/index.md files.

Usage

Run as a standalone script to regenerate task documentation after adding or modifying environments: python docs/generate_task_docs.py

Code Reference

Source Location

Signature

# Constants
TASK_CATEGORIES_TO_INCLUDE = ["tabletop", "humanoid", "mobile_manipulation", "quadruped", "control", "drawing"]
TASK_CATEGORIES_NAME_MAP = {"tabletop": "table_top_gripper"}
GENERATED_TASKS_DOCS_FOLDER = "tasks"

# Main function
def main(): ...

Invocation

python docs/generate_task_docs.py

I/O Contract

Input Output
ManiSkill environment registry (REGISTERED_ENVS) Markdown documentation files in docs/source/tasks/
Demo video files in figures/environment_demos/ Thumbnail PNGs in docs/source/_static/env_thumbnails/

Generated documentation structure per category:

Section Content
Header Category name and description
Task Table HTML table with env IDs, previews, reward badges, max steps
Task Cards Dropdown sections per environment with docstring and video

Usage Examples

# Run from the repository root
# python docs/generate_task_docs.py

# The script uses these ManiSkill imports:
import mani_skill.envs
from mani_skill.utils.download_demo import DATASET_SOURCES
from mani_skill.utils.registration import REGISTERED_ENVS

Related Pages

Page Connections

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