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 RotateValveEnv

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

Overview

Concrete implementation of the valve rotation dexterous manipulation task in ManiSkill using the DClaw robot.

Description

The RotateValveEnv requires a DClaw tri-finger robot to rotate a Robel valve by a specified amount. The task has five difficulty levels (0-4):

  • Level 0: Rotate valve by a quarter turn (pi/2 radians).
  • Levels 1-3: Rotate valve by a half turn (pi radians), with increasing randomization of valve configuration.
  • Level 4: Rotate valve by a full turn (2*pi radians) with random valve configurations.

Registered variants:

  • RotateValveLevel0-v1 through RotateValveLevel4-v1 (max_episode_steps=200 each)

The supported robot is dclaw. Reward modes include "dense", "normalized_dense", "sparse", and "none". The valve is built as an articulated object using build_robel_valve.

Usage

Use this environment for researching dexterous manipulation with tri-finger grippers. The difficulty levels provide a curriculum from simple quarter-turn rotation to full-turn rotation with randomized valve geometry.

Code Reference

Source Location

Signature

class RotateValveEnv(BaseEnv):
    agent: Union[DClaw]
    def __init__(self, *args, robot_init_qpos_noise=0.02, valve_init_pos_noise=0.02,
                 difficulty_level: int = -1, **kwargs): ...

@register_env("RotateValveLevel0-v1", max_episode_steps=200)
class RotateValveLevel0Env(RotateValveEnv): ...

Import

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

I/O Contract

Inputs

Name Type Required Description
obs_mode str No Observation mode
reward_mode str No Reward mode: "dense", "normalized_dense", "sparse", "none"
control_mode str No Control mode for the DClaw robot

Outputs

Name Type Description
obs dict/array Observation including finger joint state, valve angle, target angle
reward float Reward based on angular distance to target rotation
terminated bool Whether episode ended by success/failure
truncated bool Whether episode hit max steps (200)
info dict Contains success flag and rotation progress

Usage Examples

Basic Usage

import gymnasium as gym
import mani_skill.envs

env = gym.make("RotateValveLevel0-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