Implementation:Haosulab ManiSkill InsertFlower
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Simulation, Dexterous_Manipulation |
| Last Updated | 2026-02-15 08:00 GMT |
Overview
Concrete implementation of the flower insertion dexterous manipulation task in ManiSkill using a floating ability hand.
Description
The InsertFlowerEnv requires the FloatingAbilityHandRight robot to grasp a flower and insert it into a target area. The task uses assets from the OakInk-v2 dataset.
Registered as InsertFlower-v1 with max_episode_steps=300 and asset_download_ids=["oakink-v2"]. The supported robot is floating_ability_hand_right.
The flower spawn position is randomized within a half-size of 0.05m on the table surface. The target insertion area is defined by min=[-0.3, -0.25, 0.25] and max=[-0.2, -0.15, 0.35]. The hand is initialized at a height of 0.25m above the table.
Usage
Use this environment for dexterous manipulation research involving grasping and precise insertion with a floating hand. It tests fine-grained control with the ability hand robot.
Code Reference
Source Location
- Repository: Haosulab_ManiSkill
- File: mani_skill/envs/tasks/dexterity/insert_flower.py
Signature
@register_env(
"InsertFlower-v1", max_episode_steps=300, asset_download_ids=["oakink-v2"]
)
class InsertFlowerEnv(BaseEnv):
agent: Union[FloatingAbilityHandRight]
hand_init_height = 0.25
flower_spawn_half_size = 0.05
Import
import gymnasium as gym
import mani_skill.envs
env = gym.make("InsertFlower-v1")
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| obs_mode | str | No | Observation mode |
| reward_mode | str | No | Reward mode |
| control_mode | str | No | Control mode for the ability hand |
Outputs
| Name | Type | Description |
|---|---|---|
| obs | dict/array | Observation including hand state, flower pose, target area |
| reward | float | Task reward |
| terminated | bool | Whether episode ended by success/failure |
| truncated | bool | Whether episode hit max steps (300) |
| info | dict | Contains success flag |
Usage Examples
Basic Usage
import gymnasium as gym
import mani_skill.envs
env = gym.make("InsertFlower-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()