Skip to content

[Tasks] Enable continuous Shadow Hand handovers - #8361

Merged
AntoineRichard merged 15 commits into
isaac-sim:developfrom
hujc7:jichuanh/handover-alternating-goal-codex
Oct 13, 2026
Merged

AntoineRichard merged 15 commits into
isaac-sim:developfrom
hujc7:jichuanh/handover-alternating-goal-codex

Conversation

@hujc7

@hujc7 hujc7 commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Both Shadow Hand handover tasks (-Direct and manager) now pass the object back and forth until a drop or timeout, instead of stopping at one delivery.

Description

Area Now
Goal Starts at the left hand; switches hands after 20 cumulative steps inside the success distance (success_steps_required, must be positive)
Metrics Metrics/success_rate = goals / (goals + 1); new Metrics/consecutive_success = transfers per episode
Manager offset position_offset is in each hand's local root frame
Recording view Faces the center hand pair head-on (temporary, until #7760's env-relative camera)
  • Shared HandoverGoal drives both workflows; its per-step update is mask-based, with no host sync.
  • Manager commands do not count post-autoreset poses as success steps.
  • Breaking: retrain policies; single-goal success rates are not comparable; update custom manager offsets.

Validation

  • pytest test_handover_env.py test_reorient_utils.py test_handover_env_cfg.py test_handover_physics_presets.py (in source/isaaclab_tasks/test/core/): 17 passed, RTX PRO 6000. Real Newton scenes cover both workflows; negative controls fail without goal switching or reset masking.
  • Trained alternating policy (RSL-RL, success rate 0.89) plays in Newton GL and Kit; training not rerun on this revision.

Type of change

  • Breaking change: continuous handover objective, metric semantics, and manager offset frame.

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Screenshots

Default recording view, Kit visualizer, Isaac-Shadow-Handover-Direct:

Default recording view

Checklist

  • I have read and understood the contribution guidelines.
  • isaaclab --format passed.
  • Docstrings and changelog describe the changed behavior and metrics.
  • No new warnings: only existing dependency and articulation API deprecations.
  • Tests added; they fail without goal switching or reset masking.
  • isaaclab_tasks changelog fragment and minor bump added.
  • My name already exists in CONTRIBUTORS.md.

@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Oct 7, 2026
hujc7 and others added 4 commits October 7, 2026 03:10
Use one handover state object for hand-local targets, cumulative dwell, and per-episode transfer counts. Extend the manager command to alternate goals and exclude reset poses from dwell after autoreset.

Cover both workflows through real environment transitions, including partial resets, metric clearing, and the first physics step after autoreset. Document the manager offset frame change.
The world-framed camera aimed at the gap between environment rows at the
default 2048 environments and clipped the nearest hand. Face the center
environment's hand pair from the side, shared by both workflows, until
env-anchored task cameras land.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@hujc7
hujc7 marked this pull request as ready for review October 8, 2026 05:23
@hujc7
hujc7 requested a review from a team October 8, 2026 05:23
@hujc7

hujc7 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 8, 2026
@greptile-apps

greptile-apps Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Refactors handover task to alternate goals between hands.

The PR appears safe to merge with a non-blocking improvement to reject invalid dwell settings.

Findings

  1. P2 Invalid dwell invents transfers ▶

Summary

Both handover tasks now alternate between hand-local goals after cumulative dwell and continue until a drop or timeout.

  • Shared HandoverGoal tracks dwell, goal direction, and completed transfers.
  • Metrics now report completed transfers and goals / (goals + 1).
  • New tests cover both directions, partial resets, and reset-pose exclusion.
  • One non-blocking improvement: reject non-positive dwell settings before they invent transfers.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Start episode with left-hand goal] --> B[Run physics step]
  B --> C{Object within success distance?}
  C -- Yes --> D[Add one earned dwell step]
  C -- No --> E[Keep earned dwell]
  D --> F{Dwell threshold reached?}
  F -- Yes --> G[Count transfer, switch hand, clear dwell]
  F -- No --> H{Drop or timeout?}
  G --> H
  E --> H
  H -- No --> B
  H -- Yes --> I[Log transfers and reset episode]
  I --> A
Loading

Reviews (1) · Last reviewed commit: "Merge remote-tracking branch 'upstream/d..." · Reviewed by Greptile

Comment on lines +57 to +59
self.dwell += succeeded.long()
env_ids = (self.dwell >= dwell_steps).nonzero(as_tuple=False).flatten()
self.success.record_goal_reached(env_ids)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Invalid dwell invents transfers

With success_dwell_steps set to zero or a negative value, HandoverGoal.update selects every environment even when succeeded is false. Both tasks then switch goals and count transfers on every step without the object reaching either hand.

Both configurations document that this value must be positive, but neither checks it. Add a shared check and a test for rejected values so a mistaken setting fails early instead of silently breaking training.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in bd429af: HandoverGoal.update raises ValueError for non-positive success_dwell_steps, shared by both workflows; covered in test_handover_goal_update_does_not_synchronize.

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isaac Lab Review Bot

Needs attention: Scope and over-engineering (1), Implementation (2), Style consistency (2). Other reviewed categories look good.

  • PR description: The body omits the camera retarget and test command; remove or disclose the retarget, substantiate “16 focused tests,” and, if synchronization remains, report revisions, workload, hardware, backend, environment count, warmup, and throughput.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: Minimal implementation: keep stateful HandoverGoal in handover_common.py; extend handover_env.py, mdp/commands.py, and their configs; delete the camera retarget but keep visualizer deduplication; no added source modules require ownership. Replace with one smaller PR: include those files, changelog, and test_handover_env.py, validating both registered workflows.
  • API: API changes look good.
  • Compatibility and deprecation: No breaking changes identified.
  • Implementation: HandoverGoal.update calls CUDA nonzero every step in both workflows, serializing the hot path; replace index extraction with boolean-mask updates and mask-aware success accounting.
  • Style consistency: handover_common.py places GOAL_MARKER_CFG after a public class, violating constants-before-classes ordering; move the marker constant above HandoverGoal.
  • Test quality: Test quality looks good.

Needs rework. Posted 5 inline findings.

Automated review; human maintainers own approval decisions.


# The camera is world-framed, so this aims at the environment nearest the grid center for the
# default 2048 environments (x = 0.75 m); other counts shift the grid.
VISUALIZER_CFG = VisualizerCfg(eye=(2.35, -0.5, 1.1), lookat=(0.75, -0.5, 0.55), focal_length=35.0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Scope Complexity — Unrelated camera retarget depends on num_envs

Sharing one visualizer constant removes duplication, but changing eye/lookat is unrelated to continuous handovers and, per the added comment, only frames correctly at 2048 environments. Keep the constant with the previous values.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional temporary framing so recorded videos show one hand pair until the environment-relative camera from #7760 lands. The changelog fragment notes the view change, and the PR description now discloses it with the 2048-environment assumption.

"""Recording view facing one hand pair from the side, with both hands and the object between them."""


class HandoverGoal:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Style Consistency — Constant defined after public class

GOAL_MARKER_CFG now follows HandoverGoal, breaking the guide's file order of constants, then functions, then classes. Move the marker constant above the class.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in bd429af.

def update(self, succeeded: torch.Tensor, dwell_steps: int) -> torch.Tensor:
"""Accumulate earned dwell, switch completed goals, and return their environment indices."""
self.dwell += succeeded.long()
env_ids = (self.dwell >= dwell_steps).nonzero(as_tuple=False).flatten()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Implementation — Per-step nonzero syncs device

nonzero plus banked_ids.numel() synchronizes the device every step in both workflows, contrary to the adjacent sync-free logging convention. Update side, dwell, and position with masked torch.where and pass a boolean mask to SuccessTracker.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in bd429af: goal switching, dwell, and position updates use masks and torch.where, SuccessTracker.record_goal_reached accepts a boolean mask, and the Direct environment no longer checks numel(). test_handover_goal_update_does_not_synchronize runs the update in CUDA sync-debug error mode and fails on the previous code.

self.sim.default_visualizer_cfg = VisualizerCfg(
eye=(1.15, -1.65, 1.15), lookat=(0.0, -0.5, 0.55), focal_length=35.0
)
self.sim.default_visualizer_cfg = VISUALIZER_CFG

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Implementation — Shared mutable visualizer config instance

__post_init__ assigns the module-level VISUALIZER_CFG, so every HandoverManagerEnvCfg shares one object; configclass deep-copy of defaults does not apply to this assignment. Previously each instance built its own. Assign replace(VISUALIZER_CFG).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 40129f8 with clone(VISUALIZER_CFG).

env_ids = slice(None)
# The base class averages the metric over ``env_ids`` and zeroes it, so the episode's success bit is
# written before delegating. Success means the object is at the goal when the episode ends, not that
# it passed through it; the latch guards the first reset, before any distance is measured.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Style Consistency — Removed rationale for metric pop

The deleted comment explained why success_rate is popped so CommandManager does not also log Metrics/<term>/success_rate; the pops remain and now have no explanation. Restore a short rationale covering both keys.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored for both keys in 2aa9bbb.

hujc7 added 5 commits October 8, 2026 02:28
Switch goals with masks instead of nonzero indices, count reached goals
from a mask, and reject non-positive dwell steps, which would switch goals
every step. Define the goal marker before the goal class.
@hujc7

hujc7 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 8, 2026
The count is cumulative across brief exits, while dwell reads as a
consecutive streak, as it means in other tasks.
@hujc7

hujc7 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 8, 2026
@hujc7
hujc7 requested a review from AntoineRichard October 8, 2026 10:44
Match the env_ids / env_mask pair used across the repository instead of
overloading env_ids with a boolean mask.
@hujc7

hujc7 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 8, 2026
@hujc7

hujc7 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 8, 2026
@hujc7

hujc7 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 8, 2026
@hujc7

hujc7 commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator Author

@AntoineRichard for review

kellyguo11 added a commit that referenced this pull request Oct 13, 2026
…8474)

## Summary

Reorientation task videos in play mode now show a close view of one hand
and its cube, with the goal cube beside it. Before, the five direct and
contrib tasks recorded from the distant default camera, the three
manager tasks aimed at the world origin, where the play-mode grid has no
environment, and the goal cube was drawn behind the hand, outside the
view.

# Description

The visualizer camera is world-framed. `play_mode()` caps the scene at
50 environments (64 for the camera tasks), and neither grid places an
environment at the origin. `core/reorient/utils.py` now holds:

- `VISUALIZER_CFG` — the manager tasks' existing view, shifted onto the
environment at x = 0.375 m of the 50-environment grid; used by every
reorientation task.
- `CAMERA_VISUALIZER_CFG` — the same view on the environment at (1, -1)
m of the 64-environment grid; set by both camera tasks in `play_mode()`.
- `GOAL_MARKER_OFFSET` — the goal cube's display offset from the in-hand
position, so it sits beside the held cube; the Allegro Hand uses a wider
offset to clear its larger hand. Manager tasks use the command's
existing `marker_pos_offset`; direct tasks gain `goal_marker_offset`,
used when `goal_marker_position` (now `None` by default) is unset.
Setting `goal_marker_position` keeps the old fixed placement. The camera
tasks drop their fixed override too: the goal cube was never in their
tiled camera view and still is not (checked on the saved camera images),
so the policy input is unchanged. The marker is display-only; the goal
itself is unchanged.

Once #7760 lands, the views can switch to `origin_type="env"` and drop
the play-grid offsets. The contrib OpenAI config replaces `sim`
wholesale, so it sets the view explicitly. Training-size recordings now
aim between two environments. The hand-over view is handled in #8361.

Related: #7760

| Task | Before | After |
| --- | --- | --- |
| `Isaac-Reorient-Cube-Shadow-Direct` | default camera | close view |
| `Isaac-Reorient-Cube-Shadow-Camera-Direct` | default camera | close
view |
| `Isaac-Reorient-Cube-Allegro-Direct` | default camera | close view |
| `IsaacContrib-Reorient-Cube-Shadow-OpenAI-FF-Direct` | default camera
| close view |
| `IsaacContrib-Reorient-Cube-Shadow-OpenAI-LSTM-Direct` | default
camera | close view |
| `Isaac-Reorient-Cube-Shadow` | between environments | close view |
| `Isaac-Reorient-Cube-Shadow-Camera` | between environments | close
view |
| `Isaac-Reorient-Cube-Allegro` | between environments | close view |

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

## Screenshots

Last frame of a 60-step zero-action clip in play mode (`play_mode()`
applied), kitless Newton GL: `isaaclab zero_agent --task <task> --video
--video_length 60 --max_steps 62 physics=newton_mjwarp` with the
environment configuration resolved with `play_mode=True`. Before is
`develop` at fdade38; after is this branch.

| Task | Before | After |
| --- | --- | --- |
| `Isaac-Reorient-Cube-Shadow-Direct` | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/177bcd7ee996c07ea7d87e5dfcd8a798703cbfca/pr-assets/reorient-play-views/before--Isaac-Reorient-Cube-Shadow-Direct.jpg"
width="400"> | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/c883ac51fa687a2d84881e15df50fe20423bbbe7/pr-assets/reorient-play-views-final/after--Isaac-Reorient-Cube-Shadow-Direct.jpg"
width="400"> |
| `Isaac-Reorient-Cube-Shadow-Camera-Direct` | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/177bcd7ee996c07ea7d87e5dfcd8a798703cbfca/pr-assets/reorient-play-views/before--Isaac-Reorient-Cube-Shadow-Camera-Direct.jpg"
width="400"> | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/c883ac51fa687a2d84881e15df50fe20423bbbe7/pr-assets/reorient-play-views-final/after--Isaac-Reorient-Cube-Shadow-Camera-Direct.jpg"
width="400"> |
| `Isaac-Reorient-Cube-Allegro-Direct` | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/177bcd7ee996c07ea7d87e5dfcd8a798703cbfca/pr-assets/reorient-play-views/before--Isaac-Reorient-Cube-Allegro-Direct.jpg"
width="400"> | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/c883ac51fa687a2d84881e15df50fe20423bbbe7/pr-assets/reorient-play-views-final/after--Isaac-Reorient-Cube-Allegro-Direct.jpg"
width="400"> |
| `IsaacContrib-Reorient-Cube-Shadow-OpenAI-FF-Direct` | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/177bcd7ee996c07ea7d87e5dfcd8a798703cbfca/pr-assets/reorient-play-views/before--IsaacContrib-Reorient-Cube-Shadow-OpenAI-FF-Direct.jpg"
width="400"> | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/c883ac51fa687a2d84881e15df50fe20423bbbe7/pr-assets/reorient-play-views-final/after--IsaacContrib-Reorient-Cube-Shadow-OpenAI-FF-Direct.jpg"
width="400"> |
| `IsaacContrib-Reorient-Cube-Shadow-OpenAI-LSTM-Direct` | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/177bcd7ee996c07ea7d87e5dfcd8a798703cbfca/pr-assets/reorient-play-views/before--IsaacContrib-Reorient-Cube-Shadow-OpenAI-LSTM-Direct.jpg"
width="400"> | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/c883ac51fa687a2d84881e15df50fe20423bbbe7/pr-assets/reorient-play-views-final/after--IsaacContrib-Reorient-Cube-Shadow-OpenAI-LSTM-Direct.jpg"
width="400"> |
| `Isaac-Reorient-Cube-Shadow` | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/177bcd7ee996c07ea7d87e5dfcd8a798703cbfca/pr-assets/reorient-play-views/before--Isaac-Reorient-Cube-Shadow.jpg"
width="400"> | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/c883ac51fa687a2d84881e15df50fe20423bbbe7/pr-assets/reorient-play-views-final/after--Isaac-Reorient-Cube-Shadow.jpg"
width="400"> |
| `Isaac-Reorient-Cube-Shadow-Camera` | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/177bcd7ee996c07ea7d87e5dfcd8a798703cbfca/pr-assets/reorient-play-views/before--Isaac-Reorient-Cube-Shadow-Camera.jpg"
width="400"> | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/c883ac51fa687a2d84881e15df50fe20423bbbe7/pr-assets/reorient-play-views-final/after--Isaac-Reorient-Cube-Shadow-Camera.jpg"
width="400"> |
| `Isaac-Reorient-Cube-Allegro` | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/177bcd7ee996c07ea7d87e5dfcd8a798703cbfca/pr-assets/reorient-play-views/before--Isaac-Reorient-Cube-Allegro.jpg"
width="400"> | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/c883ac51fa687a2d84881e15df50fe20423bbbe7/pr-assets/reorient-play-views-final/after--Isaac-Reorient-Cube-Allegro.jpg"
width="400"> |

## Checklist

Docker and GPU tests run on demand. Push the commits you want tested,
then
comment `run-ci` on the pull request.

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`uv run isaaclab --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have validated the changed behavior with focused coverage and
applied the [test-audit
criteria](https://github.com/isaac-sim/IsaacLab/blob/develop/skills/developer/test-audit/SKILL.md)
to any test changes
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package (do **not** edit
`CHANGELOG.rst` or bump package versions — CI handles that)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Co-authored-by: Kelly Guo <[email protected]>
isaaclab-bot Bot pushed a commit that referenced this pull request Oct 13, 2026
…8474)

## Summary

Reorientation task videos in play mode now show a close view of one hand
and its cube, with the goal cube beside it. Before, the five direct and
contrib tasks recorded from the distant default camera, the three
manager tasks aimed at the world origin, where the play-mode grid has no
environment, and the goal cube was drawn behind the hand, outside the
view.

# Description

The visualizer camera is world-framed. `play_mode()` caps the scene at
50 environments (64 for the camera tasks), and neither grid places an
environment at the origin. `core/reorient/utils.py` now holds:

- `VISUALIZER_CFG` — the manager tasks' existing view, shifted onto the
environment at x = 0.375 m of the 50-environment grid; used by every
reorientation task.
- `CAMERA_VISUALIZER_CFG` — the same view on the environment at (1, -1)
m of the 64-environment grid; set by both camera tasks in `play_mode()`.
- `GOAL_MARKER_OFFSET` — the goal cube's display offset from the in-hand
position, so it sits beside the held cube; the Allegro Hand uses a wider
offset to clear its larger hand. Manager tasks use the command's
existing `marker_pos_offset`; direct tasks gain `goal_marker_offset`,
used when `goal_marker_position` (now `None` by default) is unset.
Setting `goal_marker_position` keeps the old fixed placement. The camera
tasks drop their fixed override too: the goal cube was never in their
tiled camera view and still is not (checked on the saved camera images),
so the policy input is unchanged. The marker is display-only; the goal
itself is unchanged.

Once #7760 lands, the views can switch to `origin_type="env"` and drop
the play-grid offsets. The contrib OpenAI config replaces `sim`
wholesale, so it sets the view explicitly. Training-size recordings now
aim between two environments. The hand-over view is handled in #8361.

Related: #7760

| Task | Before | After |
| --- | --- | --- |
| `Isaac-Reorient-Cube-Shadow-Direct` | default camera | close view |
| `Isaac-Reorient-Cube-Shadow-Camera-Direct` | default camera | close
view |
| `Isaac-Reorient-Cube-Allegro-Direct` | default camera | close view |
| `IsaacContrib-Reorient-Cube-Shadow-OpenAI-FF-Direct` | default camera
| close view |
| `IsaacContrib-Reorient-Cube-Shadow-OpenAI-LSTM-Direct` | default
camera | close view |
| `Isaac-Reorient-Cube-Shadow` | between environments | close view |
| `Isaac-Reorient-Cube-Shadow-Camera` | between environments | close
view |
| `Isaac-Reorient-Cube-Allegro` | between environments | close view |

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

## Screenshots

Last frame of a 60-step zero-action clip in play mode (`play_mode()`
applied), kitless Newton GL: `isaaclab zero_agent --task <task> --video
--video_length 60 --max_steps 62 physics=newton_mjwarp` with the
environment configuration resolved with `play_mode=True`. Before is
`develop` at fdade38; after is this branch.

| Task | Before | After |
| --- | --- | --- |
| `Isaac-Reorient-Cube-Shadow-Direct` | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/177bcd7ee996c07ea7d87e5dfcd8a798703cbfca/pr-assets/reorient-play-views/before--Isaac-Reorient-Cube-Shadow-Direct.jpg"
width="400"> | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/c883ac51fa687a2d84881e15df50fe20423bbbe7/pr-assets/reorient-play-views-final/after--Isaac-Reorient-Cube-Shadow-Direct.jpg"
width="400"> |
| `Isaac-Reorient-Cube-Shadow-Camera-Direct` | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/177bcd7ee996c07ea7d87e5dfcd8a798703cbfca/pr-assets/reorient-play-views/before--Isaac-Reorient-Cube-Shadow-Camera-Direct.jpg"
width="400"> | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/c883ac51fa687a2d84881e15df50fe20423bbbe7/pr-assets/reorient-play-views-final/after--Isaac-Reorient-Cube-Shadow-Camera-Direct.jpg"
width="400"> |
| `Isaac-Reorient-Cube-Allegro-Direct` | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/177bcd7ee996c07ea7d87e5dfcd8a798703cbfca/pr-assets/reorient-play-views/before--Isaac-Reorient-Cube-Allegro-Direct.jpg"
width="400"> | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/c883ac51fa687a2d84881e15df50fe20423bbbe7/pr-assets/reorient-play-views-final/after--Isaac-Reorient-Cube-Allegro-Direct.jpg"
width="400"> |
| `IsaacContrib-Reorient-Cube-Shadow-OpenAI-FF-Direct` | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/177bcd7ee996c07ea7d87e5dfcd8a798703cbfca/pr-assets/reorient-play-views/before--IsaacContrib-Reorient-Cube-Shadow-OpenAI-FF-Direct.jpg"
width="400"> | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/c883ac51fa687a2d84881e15df50fe20423bbbe7/pr-assets/reorient-play-views-final/after--IsaacContrib-Reorient-Cube-Shadow-OpenAI-FF-Direct.jpg"
width="400"> |
| `IsaacContrib-Reorient-Cube-Shadow-OpenAI-LSTM-Direct` | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/177bcd7ee996c07ea7d87e5dfcd8a798703cbfca/pr-assets/reorient-play-views/before--IsaacContrib-Reorient-Cube-Shadow-OpenAI-LSTM-Direct.jpg"
width="400"> | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/c883ac51fa687a2d84881e15df50fe20423bbbe7/pr-assets/reorient-play-views-final/after--IsaacContrib-Reorient-Cube-Shadow-OpenAI-LSTM-Direct.jpg"
width="400"> |
| `Isaac-Reorient-Cube-Shadow` | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/177bcd7ee996c07ea7d87e5dfcd8a798703cbfca/pr-assets/reorient-play-views/before--Isaac-Reorient-Cube-Shadow.jpg"
width="400"> | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/c883ac51fa687a2d84881e15df50fe20423bbbe7/pr-assets/reorient-play-views-final/after--Isaac-Reorient-Cube-Shadow.jpg"
width="400"> |
| `Isaac-Reorient-Cube-Shadow-Camera` | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/177bcd7ee996c07ea7d87e5dfcd8a798703cbfca/pr-assets/reorient-play-views/before--Isaac-Reorient-Cube-Shadow-Camera.jpg"
width="400"> | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/c883ac51fa687a2d84881e15df50fe20423bbbe7/pr-assets/reorient-play-views-final/after--Isaac-Reorient-Cube-Shadow-Camera.jpg"
width="400"> |
| `Isaac-Reorient-Cube-Allegro` | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/177bcd7ee996c07ea7d87e5dfcd8a798703cbfca/pr-assets/reorient-play-views/before--Isaac-Reorient-Cube-Allegro.jpg"
width="400"> | <img
src="https://raw.githubusercontent.com/hujc7/IsaacLab/c883ac51fa687a2d84881e15df50fe20423bbbe7/pr-assets/reorient-play-views-final/after--Isaac-Reorient-Cube-Allegro.jpg"
width="400"> |

## Checklist

Docker and GPU tests run on demand. Push the commits you want tested,
then
comment `run-ci` on the pull request.

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`uv run isaaclab --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have validated the changed behavior with focused coverage and
applied the [test-audit
criteria](https://github.com/isaac-sim/IsaacLab/blob/develop/skills/developer/test-audit/SKILL.md)
to any test changes
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package (do **not** edit
`CHANGELOG.rst` or bump package versions — CI handles that)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Co-authored-by: Kelly Guo <[email protected]>

(cherry picked from commit 4f718b8)

@AntoineRichard AntoineRichard left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @hujc7 !

@AntoineRichard
AntoineRichard enabled auto-merge (squash) October 13, 2026 11:36
@@ -0,0 +1,136 @@
# Copyright (c) 2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to avoid specialized tests for tasks logic, especially ones that require running the task, let's remove this test file

ValueError: If not exactly one of ``env_ids`` and ``env_mask`` is given.
"""
self._goals_reached[env_ids] += 1.0
if (env_ids is None) == (env_mask is None):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a better way to write this, it looks a bit odd written this way

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just pythonic: env_ids is None and env_mask is None instead of mixing


return {"right_hand": rew_dist, "left_hand": rew_dist}

def _visualize_goal(self) -> None:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the helper is just for a one-liner, better to not use a helper

@AntoineRichard
AntoineRichard merged commit 229ecb5 into isaac-sim:develop Oct 13, 2026
59 checks passed
@isaaclab-bot

isaaclab-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.0.0 as c463d13.

isaaclab-bot Bot pushed a commit that referenced this pull request Oct 13, 2026
## Summary

Both Shadow Hand handover tasks (`-Direct` and manager) now pass the
object back and forth until a drop or timeout, instead of stopping at
one delivery.

# Description

| Area | Now |
|---|---|
| Goal | Starts at the left hand; switches hands after 20 cumulative
steps inside the success distance (`success_steps_required`, must be
positive) |
| Metrics | `Metrics/success_rate` = `goals / (goals + 1)`; new
`Metrics/consecutive_success` = transfers per episode |
| Manager offset | `position_offset` is in each hand's local root frame
|
| Recording view | Faces the center hand pair head-on (temporary, until
#7760's env-relative camera) |

- Shared `HandoverGoal` drives both workflows; its per-step update is
mask-based, with no host sync.
- Manager commands do not count post-autoreset poses as success steps.
- **Breaking:** retrain policies; single-goal success rates are not
comparable; update custom manager offsets.

**Validation**
- `pytest test_handover_env.py test_reorient_utils.py
test_handover_env_cfg.py test_handover_physics_presets.py` (in
`source/isaaclab_tasks/test/core/`): 17 passed, RTX PRO 6000. Real
Newton scenes cover both workflows; negative controls fail without goal
switching or reset masking.
- Trained alternating policy (RSL-RL, success rate 0.89) plays in Newton
GL and Kit; training not rerun on this revision.

## Type of change

- Breaking change: continuous handover objective, metric semantics, and
manager offset frame.

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

## Screenshots

Default recording view, Kit visualizer, `Isaac-Shadow-Handover-Direct`:

![Default recording
view](https://raw.githubusercontent.com/hujc7/IsaacLab/jichuanh/pr8361-assets/pr8361/handover-front-view-kit.png)

## Checklist

- [x] I have read and understood the contribution guidelines.
- [x] `isaaclab --format` passed.
- [x] Docstrings and changelog describe the changed behavior and
metrics.
- [ ] No new warnings: only existing dependency and articulation API
deprecations.
- [x] Tests added; they fail without goal switching or reset masking.
- [x] `isaaclab_tasks` changelog fragment and minor bump added.
- [x] My name already exists in `CONTRIBUTORS.md`.

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>

(cherry picked from commit 229ecb5)
ooctipus pushed a commit that referenced this pull request Oct 19, 2026
…opt-in action-rate penalty (#8557)

# Description

Since the Shadow Hand handover alternates its goal between the hands
(#8361), every episode starts with the object in the right hand, so the
right-to-left transfer is always learned first and the return pass has
to be discovered from there. SKRL MAPPO with the shipped configuration
never discovers it and holds the object after the first transfer.

This PR changes both handover tasks (`Isaac-Shadow-Handover-Direct` and
`Isaac-Shadow-Handover`) for every library:

- `randomize_start_hand` (default `True`): each episode starts with the
object in a random hand and the first goal at the other, so both
transfers are learned from the start.
`HandoverGoal(randomize_start=True)` draws the first goal side.
- The object starts at the holding hand's hold point, the same
hand-local offset used as the goal (`hold_position_offset`, renamed from
the Direct `goal_position_offset` and the command's `position_offset`),
3 cm closer to the palm than before. `HandoverGoal.start_position` gives
that point to both tasks.
- The manager-based task now places the object in
`HandoverCommand._resample_command`, after the goal reset, instead of
the `reset_object` event, so it starts in the hand chosen by the goal
command.
- `action_rate_penalty_scale` (Direct, default `0.0`, opt-in): each
hand's reward is reduced by `scale * sum((a_t - a_{t-1})^2)`. At `1e-3`
it smooths the motion but slowed RSL-RL learning (one of three Kit PhysX
seeds learned only one direction), so it is off by default.

## Results

One L40 per run, each library's default agent configuration and training
length. Develop is one seed.

`Isaac-Shadow-Handover-Direct`: each final checkpoint is scored with the
policy mean action over 900 policy steps x 50 environments (about 100
episodes). A run has learned when both transfer directions complete;
drops are non-timeout terminations, lower is better.

| Library | Physics | develop (fixed start) | this PR, seeds 42 / 43 /
44 |
|---|---|---|---|
| SKRL MAPPO | Kit PhysX | not learned (holds after the first transfer)
| 3/3 learned, 7 / 2 / 6 drops |
| SKRL MAPPO | OvPhysX | learned, 39 drops | 3/3, 14 / 7 / 23 |
| SKRL MAPPO | Newton | not learned | 3/3, 0 / 1 / 0 |
| RSL-RL | Kit PhysX | learned, 8 | 3/3, 10 / 9 / 13 |
| RSL-RL | OvPhysX | learned, 33 | 3/3, 13 / 21 / 8 |
| RSL-RL | Newton | learned, 7 | 3/3, 0 / 2 / 2 |

Starting at the hold point lowers the drops of random start alone on
every library and backend (summed over the three seeds, previous start
pose vs this PR: SKRL 22 vs 15, 90 vs 44, 16 vs 1; RSL-RL 39 vs 32, 92
vs 42, 27 vs 4 for Kit PhysX, OvPhysX, Newton). In playback every
learned policy hands the object back and forth in both directions. The
action-rate penalty was measured with the previous start pose: it cuts
the squared action change about 13-31x for RSL-RL; joint-velocity and
joint-acceleration penalties were also tried and, at gains that visibly
smoothed the motion, left some SKRL seeds dropping the object every
episode.

`Isaac-Shadow-Handover` (RSL-RL): training curves, mean over the last 5%
of training. A drop ends the episode when the object falls below 0.24 m;
every other episode times out.

| Physics | develop: episodes ending in a drop / consecutive success |
this PR, seeds 42 / 43 / 44: drop share | this PR mean |
|---|---|---|---|
| Kit PhysX | 27.5% / 10.7 | 23.4% / 21.2% / 22.9% | 22.5% / 11.7 |
| OvPhysX | 26.8% / 11.5 | 24.4% / 14.9% / 23.1% | 20.8% / 12.1 |
| Newton | 12.0% / 12.8 | 8.2% / 8.9% / 6.4% | 7.8% / 13.0 |

All nine runs learned; a right-hand-only start with the hold point gave
the same results within seed noise.

The published Direct handover checkpoints were trained with the fixed
start and need to be replaced with checkpoints trained on this
configuration.

## Type of change

- Breaking change (existing functionality will not work without user
modification)

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

## Checklist

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`uv run isaaclab --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have validated the changed behavior with focused coverage and
applied the [test-audit
criteria](https://github.com/isaac-sim/IsaacLab/blob/develop/skills/developer/test-audit/SKILL.md)
to any test changes
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package (do **not** edit
`CHANGELOG.rst` or bump package versions — CI handles that)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants