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:Isaac sim IsaacGymEnvs AllegroKukaTwoArmsRegrasping

From Leeroopedia
Knowledge Sources
Domains Robotic_Manipulation, Bimanual_Manipulation
Last Updated 2026-02-15 11:00 GMT

Overview

AllegroKukaTwoArmsRegrasping is a dual-arm regrasping task environment where two Kuka arms with Allegro hands must cooperate to transfer an object between them to reach a target position.

Description

The AllegroKukaTwoArmsRegrasping class extends AllegroKukaTwoArmsBase to implement a bimanual regrasping task. In this task, two robotic arm-hand systems are positioned facing each other, and they must coordinate to pick up an object, pass it from one hand to the other, and place it at a randomly sampled target location. The target can be randomly positioned near either the first or the second arm, requiring the agent to learn handoff strategies.

The target position is sampled within a configurable volume, with an additional randomization that offsets the x-coordinate by +/-0.75 to place the target near one arm or the other. A goal ball asset (with gravity disabled and scaled to 0.5) is loaded to visually indicate the target position, colored in a light blue shade (0.6, 0.72, 0.98). The task uses a single object keypoint at the origin since only positional accuracy is tracked, not orientation.

Curriculum learning is applied via tolerance_curriculum to gradually tighten the success tolerance as the policy improves. The _true_objective method provides a PBT-compatible objective using tolerance_successes_objective, which ensures that decreasing tolerance thresholds are prioritized over increasing raw success counts during optimization.

Usage

Use this class when training a reinforcement learning policy for bimanual dexterous regrasping tasks. It is designed for research into multi-arm coordination and object handoff strategies. Register it in the IsaacGymEnvs task registry and configure it using Hydra configuration files with dual-arm environment settings.

Code Reference

Source Location

Signature

class AllegroKukaTwoArmsRegrasping(AllegroKukaTwoArmsBase):
    def __init__(self, cfg, rl_device, sim_device, graphics_device_id, headless, virtual_screen_capture, force_render):
        ...

    def _object_keypoint_offsets(self):
        ...

    def _load_additional_assets(self, object_asset_root, arm_y_offset: float):
        ...

    def _create_additional_objects(self, env_ptr, env_idx, object_asset_idx):
        ...

    def _after_envs_created(self):
        ...

    def _reset_target(self, env_ids: Tensor) -> None:
        ...

    def _extra_object_indices(self, env_ids: Tensor) -> List[Tensor]:
        ...

    def compute_kuka_reward(self) -> Tuple[Tensor, Tensor]:
        ...

    def _true_objective(self) -> Tensor:
        ...

    def _extra_curriculum(self):
        ...

Import

from isaacgymenvs.tasks.allegro_kuka.allegro_kuka_two_arms_regrasping import AllegroKukaTwoArmsRegrasping

I/O Contract

Inputs

Name Type Required Description
cfg dict Yes Hydra configuration dictionary containing environment parameters, dual-arm settings, target volume, and curriculum parameters
rl_device str Yes Device string for the RL algorithm (e.g., "cuda:0")
sim_device str Yes Device string for the simulation (e.g., "cuda:0")
graphics_device_id int Yes GPU device ID for rendering
headless bool Yes Whether to run without a display
virtual_screen_capture bool Yes Whether to capture virtual screen output
force_render bool Yes Whether to force rendering even in headless mode

Outputs

Name Type Description
rew_buf Tensor Per-environment reward buffer computed by the dual-arm compute_kuka_reward
is_success Tensor Boolean tensor indicating which environments achieved the target position
true_objective Tensor PBT objective combining tolerance progress and success count

Usage Examples

# Register and instantiate the AllegroKukaTwoArmsRegrasping task
from isaacgymenvs.tasks.allegro_kuka.allegro_kuka_two_arms_regrasping import AllegroKukaTwoArmsRegrasping

# Typically created through the task registry with Hydra config
env = AllegroKukaTwoArmsRegrasping(
    cfg=task_cfg,
    rl_device="cuda:0",
    sim_device="cuda:0",
    graphics_device_id=0,
    headless=True,
    virtual_screen_capture=False,
    force_render=False,
)

# Run a step in the environment
obs = env.reset()
actions = policy(obs)
obs, rewards, dones, info = env.step(actions)

Related Pages

Page Connections

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