Repository navigation
[Tasks] Enable continuous Shadow Hand handovers - #8361
AntoineRichard merged 15 commits into
Conversation
…r-alternating-goal-codex
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]>
…r-alternating-goal-codex
|
run-ci |
|
| self.dwell += succeeded.long() | ||
| env_ids = (self.dwell >= dwell_steps).nonzero(as_tuple=False).flatten() | ||
| self.success.record_goal_reached(env_ids) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
HandoverGoalinhandover_common.py; extendhandover_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, andtest_handover_env.py, validating both registered workflows. - API: API changes look good.
- Compatibility and deprecation: No breaking changes identified.
- Implementation:
HandoverGoal.updatecalls CUDAnonzeroevery step in both workflows, serializing the hot path; replace index extraction with boolean-mask updates and mask-aware success accounting. - Style consistency:
handover_common.pyplacesGOAL_MARKER_CFGafter a public class, violating constants-before-classes ordering; move the marker constant aboveHandoverGoal. - 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) |
There was a problem hiding this comment.
🟡 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.
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
🟡 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.
| 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() |
There was a problem hiding this comment.
🟡 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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
🟡 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).
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
🟡 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.
…r-alternating-goal-codex
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.
|
run-ci |
The count is cumulative across brief exits, while dwell reads as a consecutive streak, as it means in other tasks.
|
run-ci |
Match the env_ids / env_mask pair used across the repository instead of overloading env_ids with a boolean mask.
|
run-ci |
|
run-ci |
|
run-ci |
|
@AntoineRichard for review |
…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]>
…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
left a comment
There was a problem hiding this comment.
LGTM! Thanks @hujc7 !
| @@ -0,0 +1,136 @@ | |||
| # Copyright (c) 2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). | |||
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
is there a better way to write this, it looks a bit odd written this way
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
if the helper is just for a one-liner, better to not use a helper
|
Backported to |
## 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`:  ## 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)
…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
Summary
Both Shadow Hand handover tasks (
-Directand manager) now pass the object back and forth until a drop or timeout, instead of stopping at one delivery.Description
success_steps_required, must be positive)Metrics/success_rate=goals / (goals + 1); newMetrics/consecutive_success= transfers per episodeposition_offsetis in each hand's local root frameHandoverGoaldrives both workflows; its per-step update is mask-based, with no host sync.Validation
pytest test_handover_env.py test_reorient_utils.py test_handover_env_cfg.py test_handover_physics_presets.py(insource/isaaclab_tasks/test/core/): 17 passed, RTX PRO 6000. Real Newton scenes cover both workflows; negative controls fail without goal switching or reset masking.Type of change
Release backport
developScreenshots
Default recording view, Kit visualizer,
Isaac-Shadow-Handover-Direct:Checklist
isaaclab --formatpassed.isaaclab_taskschangelog fragment and minor bump added.CONTRIBUTORS.md.