Implementation:Isaac sim IsaacGymEnvs AllegroKukaTwoArmsBase
| Knowledge Sources | |
|---|---|
| Domains | Robotic_Manipulation, Bimanual_Manipulation |
| Last Updated | 2026-02-15 11:00 GMT |
Overview
AllegroKukaTwoArmsBase is the foundational VecTask subclass for dual-arm Allegro-Kuka bimanual manipulation tasks, setting up two mirrored KUKA arms with Allegro hands for coordinated two-handed object manipulation.
Description
The AllegroKukaTwoArmsBase class in isaacgymenvs/tasks/allegro_kuka/allegro_kuka_two_arms.py extends VecTask to support bimanual dexterous manipulation. It instantiates two KUKA LBR iiwa arms (7 DOF each) with Allegro hands (16 DOF each), yielding 46 total degrees of freedom. The two arms are positioned symmetrically using configurable X and Y offsets (armXOfs, armYOfs), and the class enforces num_arms == 2.
The observation and action spaces are doubled compared to the single-arm AllegroKukaBase. The observation pipeline in compute_observations() constructs state vectors for both arms including all DOF positions/velocities, fingertip poses for both hands (8 fingertips total), object pose, and goal state. Actions are applied independently to each arm-hand system through pre_physics_step(), supporting either position targets or torque commands for all 46 DOFs.
The reward function compute_kuka_reward() implements keypoint-based rewards that account for both hands' contributions to the manipulation objective. It computes distance deltas from both sets of fingertips to the object, lifting rewards, and coordination bonuses. The class handles synchronized resets of both arm-hand systems and supports domain randomization and curriculum learning inherited from the VecTask infrastructure.
Usage
Use AllegroKukaTwoArmsBase as the base class for bimanual manipulation tasks where two coordinated hands are needed, such as large object manipulation, object handoff between hands, or tasks requiring simultaneous grasping and re-positioning. Subclasses override task-specific reward and reset logic.
Code Reference
Source Location
- Repository: IsaacGymEnvs
- File: isaacgymenvs/tasks/allegro_kuka/allegro_kuka_two_arms.py
- Lines: 1-1415
Signature
class AllegroKukaTwoArmsBase(VecTask):
def __init__(self, cfg, rl_device, sim_device, graphics_device_id,
headless, virtual_screen_capture, force_render):
"""Initialize dual arm+hand+object simulation with 46 DOF control.
Enforces num_arms == 2 with configurable arm offsets."""
def create_sim(self):
"""Create Isaac Gym simulation with ground plane and environments."""
def _create_envs(self, num_envs, spacing, num_per_row):
"""Load two KUKA+Allegro assets and object, create parallel environments."""
def pre_physics_step(self, actions):
"""Apply actions to both arm-hand systems (46 DOFs total)."""
def post_physics_step(self):
"""Update state tensors for both arms, compute observations and rewards."""
def compute_observations(self):
"""Build observation: both arms' DOF state, 8 fingertips, object, goals."""
def compute_kuka_reward(self):
"""Bimanual keypoint reward: distance, lifting, coordination bonuses."""
def reset_idx(self, env_ids):
"""Reset both arms and object with randomized initial conditions."""
Import
from isaacgymenvs.tasks.allegro_kuka.allegro_kuka_two_arms import AllegroKukaTwoArmsBase
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| cfg | dict | Yes | Task configuration including env.asset.kukaAllegro (asset path), env.numArms (must be 2), env.armXOfs, env.armYOfs, env.numEnvs, env.episodeLength, reward scale parameters, and control mode settings |
| rl_device | str | Yes | Device for RL computations (e.g., "cuda:0") |
| sim_device | str | Yes | Device for physics simulation (e.g., "cuda:0") |
| graphics_device_id | int | Yes | GPU ID for rendering (-1 for headless) |
| headless | bool | Yes | Whether to run without visualization |
| actions | Tensor | Yes | Per-step action tensor of shape (num_envs, 46) covering both arms and hands |
Outputs
| Name | Type | Description |
|---|---|---|
| obs_buf | Tensor | Observation tensor containing both arms' DOF positions/velocities, all 8 fingertip poses, object state, and goal information |
| rew_buf | Tensor | Per-environment scalar rewards combining bimanual distance, lifting, and coordination components |
| reset_buf | Tensor | Boolean tensor indicating which environments need resetting |
| extras | dict | Additional info including success flags, consecutive successes, and per-arm reward components |
Usage Examples
# AllegroKukaTwoArmsBase is subclassed for specific bimanual tasks.
# Example: Creating a two-arm reorientation task
from isaacgymenvs.tasks.allegro_kuka.allegro_kuka_two_arms import AllegroKukaTwoArmsBase
class AllegroKukaTwoArmsReorientation(AllegroKukaTwoArmsBase):
def __init__(self, cfg, rl_device, sim_device, graphics_device_id,
headless, virtual_screen_capture, force_render):
super().__init__(cfg, rl_device, sim_device, graphics_device_id,
headless, virtual_screen_capture, force_render)
# Task-specific initialization for bimanual reorientation
def compute_kuka_reward(self):
# Override with bimanual coordination reward
super().compute_kuka_reward()
# Add handoff or coordinated manipulation bonus
# YAML config must specify:
# env:
# numArms: 2
# armXOfs: 0.4
# armYOfs: 0.3